sm 2.0 and 64 arithmetic instruction limit

Hello!

There’s a limit of “64 arithmetic instructions” for shader model 2.0 in Unity, but how to count the number of such instructions in the shader code? What does translate to arithmetic instructions, what does not and what are the most expensive things to do in a shader in regard to a number of such instructions?

I hope my question makes sense, thank you :slight_smile:

Some knowledge of D3D assembly shaders and/or OpenGL ARB_fragment_program shaders would help there. For any existing shader, you can press “Open Compiled Shader” in the inspector, and it will display the actual shader assembly generated from your Cg/HLSL code. So… well… that way you can learn :slight_smile: