Jump to content
  • Advertisement
Sign in to follow this  
Dranix

GLSL: How to check the number of instructions

This topic is 3915 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Yes, it's their shaderperf studio, which tells exactly how much registers, instructions, and performance is going to be expected.

Share this post


Link to post
Share on other sites

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

Edited by ndhb

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!