Hello everyone
When I was working with hlsl I used to compile using fxc via proprietary tools. It helped me figure out the number of instructions, use asm shaders etc.
Nowadays I'm working only in maya so the cgfx plugin was taking care of the compilation. I've been trying to use nvidia cgc (from the CGtoolkit) to produce asm shaders, but i can't get it to work yet.
If i don't manually specify a function to compile (either pixel shader or vertex shader) i get an error on valid semantics (i'm using the -nofx option, which is supposed to avoid cgfx semantics):
technique BasicShader
{
pass P0
{
VertexProgram = compile arbvp1 vertexFunction();
FragmentProgram = compile arbfp1 pixelFunction();
}
}
it gets stuck on the first "{" for no reason :
01_color.cgfx(57) : error C0000: syntax error, unexpected '{' at token "{"
if i don't use -nofx I simply get
(0) : error C3001: no program defined
if I specify manually the function to use (-entry pixelFunction/-entry vertexFunction)
I can only get the vertex shader to compile, the pixel shader outputs:
(0) : error C6014: Required output 'POSITION' not written
which doesn't make any sense since POSITION is output by the vertex shader.
Anyone ever suceed compiling cgfx with cgc? or knows if maya has some sort of temporary asm file somewhere?
Thx
Replies
the shader i use for testing is very short, so the line 57 is the technique definition already.
if you use the asm style, you probably have to define all parameter bindings and such manually (look at directx .fx files that use precompiled asm for example). However I am not sure if that even works with cgfx at all.
however there is no hint how you do the parameter binding, I guess it would be something like
"LOCAL0 = somevar;"
within the pass defintion, similar to how registers are filled in directx... never tried it so
next time I'll hint in the title "this thread is secretly aimed at CB"
cheers