GLSL: How to check the number of instructions
Hello, I'm new to GLSL. I just started learning about it last week. I need to know how I can check the number of instructions I used with my shader codes. Is there a specific way or formula like a '+' operation is 1 instruction?
For example, how many instruction sets does this code use?
void main (void) {
float initial = dot(normal,lightdir)*0.3+0.7 ;
vec3 raypos = vec3(globalpos);
vec3 raydir = reflect(normalize(cameragpos-raypos),normalize(normal));
gl_FragColor = color * (initial);
}
Also, how do I check in my code about how many instructions set the graphics card support?
Thanks.
There is not realy a way check this. You can't query the number of instructions used. For Nvidia hardware you might he able to use the nvemulate too to dump the shaders assembly, but it might be different for each gfx card and won't work for ATI. Maybe Nvidia also has other tools I'm not aware of.
Yes, it's their shaderperf studio, which tells exactly how much registers, instructions, and performance is going to be expected.
Hi. If on Windows, try and take a look at OpenGL Extension Viewer. There's a registry tab, which allows writing the GLSL assembly code to disk.
http://www.realtech-vr.com
kind regards,
Nicolai
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement