Hello
Is there a way to know how many instruction a vertex/fragment shader coded in GLSL takes ?
thanks
Hello
Is there a way to know how many instruction a vertex/fragment shader coded in GLSL takes ?
thanks
- on Windows / Linux nVidia boards, use the Cg toolkit and the command line tool 'Cg.exe' and compile your shader with parameters -entry main -oglsl -D__GLSL_CG_DATA_TYPES -D__GLSL_CG_STDLIB -D__GLSL_SAMPLER_RECT -profile (choose vp40, fp40, arbvp1 etc) .. you will get the instructions count for Geforce, Geforce FX and Geforce 6 series) as well as the assembler output.
- on MacOSX with ATI and nVidia boards, use OpenGL Shader Builder, there is a panel which shows the intermediate output (GLSL->Compiler->Assembler (using Apple own assembler format). You will get instructions count as well.
- On Windows with ATI, you need benchmark, there is no official way to get the intermediate output of a shader (AFAIK)
thanks![]()
Why does one need to define Cg data types and the Cg standard library to compile GLSL code? Are these options (-D__GLSL_CG . . .) documented or published anywhere?- on Windows / Linux nVidia boards, use the Cg toolkit and the command line tool 'Cg.exe' and compile your shader with parameters -entry main -oglsl -D__GLSL_CG_DATA_TYPES -D__GLSL_CG_STDLIB -D__GLSL_SAMPLER_RECT -profile (choose vp40, fp40, arbvp1 etc) .. you will get the instructions count for Geforce, Geforce FX and Geforce 6 series) as well as the assembler output.
Searched yourself? This is Google's very first hit:
http://download.nvidia.com/developer...lease%2060.pdf
Ok, that didn't help:
My real question was:In future GLSL-enabled drivers, the preprocessor name __GLSL_CG_DATA_TYPES will be defined if these Cg data types are supported to allow . . .
Why does one need to define Cg data types and the Cg standard library to compile GLSL code?
To take advantage of fixed-point and half data types for better performance on NV hardware. That's my only use of Cg, I haven't had any other need so far.Originally posted by kingjosh:
Why does one need to define Cg data types and the Cg standard library to compile GLSL code?
spasi
zDimensions