Im currently developing a GLSL shader for doing procedural textures in 3d (~Hypertextures) with a raymarcher written in GLSL. Currently im having some problems with the NVidia compiler in driver 71.20, it generates assemby using too many temporary registers ( > 31 temp registers). If I manually compile the code with cgc.exe (v. 1.3) everything is fine (~20 temp registers).
So the question is: can I somehow give arguments to the GLSL compiler/linker in the NVidia drivers, and will this help me with my problem?
I haven’t compared the assembly from different drivers, but I will do that as soon as I get back from the holidays. It’s strange though that the compiler doesn’t complain although it exeeds the hardware limit of the current profile?
The GLSL specs defines two things that maybe could help you: #pragma optimize and #pragma debug
#pragma optimize(on) #pragma optimize(off)
can be used to turn off optimizations as an aid on developing and debugging shaders. It can only be used outside function definitions. By default, optimization is turned on for all shaders.
The debug pragma #pragma debug(on) #pragma debug(off)
can be used to enable compiling and annotating a shader with debug information, so that it can be used with a debugger. It can only be used outside function definitions. By default, debug is turned off.