PDA

View Full Version : Cg and fp40



Erik Pettersson
10-03-2005, 01:37 AM
If this question is too Cg specific, then I apoligize and will try to find a more Cg-specialized forum somewhere.

I try to run a Cg program that uses branching, but I can't get the fp40 profile working correctly. If I run this code:


assert(cgGLIsProfileSupported(CG_FRAGMENT_FP40));
cgGLEnableProfile(CG_FRAGMENT_FP40);
fragProg = cgCreateProgramFromFile(context, CG_SOURCE, filename, CG_FRAGMENT_FP40, "big_frag_prog", 0);
assert(cgIsProgram(fragProg));
cgGLLoadProgram(fragProg); // This line fails!The last line fails with:


Compiling Cg fragment program: big_frag_prog
Cg error:
CG ERROR : The program could nod load.

(0) : warning C6504: Unknown profile option 'NumTexInstructionSlots' ignored
(0) : warning C6504: Unknown profile option 'NumMathInstructionSlots' ignored
(0) : warning C6504: Unknown profile option 'MaxTexIndirections' ignored
(0) : warning C6504: Unknown profile option 'MaxDrawBuffers' ignoredThe profile options it mentions belongs to the arbfp1 profile (at least according to 'cgc --help'), so I think it somehow tries to compile using the arbfp1 profile anyway. Anyone have any idea what the problem could be?

I have initialized both GL_ARB_FRAGMENT_PROGRAM and GL_NV_FRAGMENT_PROGRAM2.

I use Cg 1.4.0-rc1 (the latest, I think).

pillbug
10-11-2005, 05:56 AM
You might want to try and compile your program on the command line first. This might generate an error..

Off the cuff ..

cgc -profile fp40 -o myasm.shdr myfile.cg

cgc -help

Hope that helps...