Instruction limit of 128 exceeded
When I compile my vertex shader I get the error:
(0) : error C6002: Instruction limit of 128 exceeded; 162 instructions needed to
compile program
178 lines, 1 errors.
It contains two functions that gets called in a loop that runs 3 times. I am writing on a Nvidia 9800 GTX+. Will it help to put each function in a seperate file?
Any ideas on how to solve this problem?
Coming from a D3D background...
The maximum number of instructions a VS 1.1 shader can have is 128. Your code is presumably longer than that, because your loops will be getting unrolled, and the function calls inlined.
You could move up to VS 2.0, which has a limit of 256 instructions per shader, or make your shader simpler in some other way (Which would speed up execution too).
The maximum number of instructions a VS 1.1 shader can have is 128. Your code is presumably longer than that, because your loops will be getting unrolled, and the function calls inlined.
You could move up to VS 2.0, which has a limit of 256 instructions per shader, or make your shader simpler in some other way (Which would speed up execution too).
Quote:Original post by mlt
How do I move to VS 2.0? I thought it was a matter of hardware support?
What shading language are you using?
Quote:Original post by mltIn D3D (I'm not sure about OpenGL, but I imagine it's similar or the same), you compile a shader for a vertex shader version. You can compile a VS 3.0 shader on a card that can't even do vertex shaders in hardware, but you can only run a VS 3.0 shader on hardware that supports VS 3.0. The same goes for VS 2.0 and VS 1.1.
How do I move to VS 2.0? I thought it was a matter of hardware support?
If your card can't do VS 2.0, then the only option you have is to simplify your shader somehow - it's just too complicated for VS 1.1.
Hi.
If you are using GLSL then you do not get to pick the shader model (unlike in the DirectX world, and the GLSL spec requires functionality that really needs SM3 hardware). As you are on a NVidia card, you could run NVemulate and make sure that your advanced hardware features are turned on.
If you are using GLSL then you do not get to pick the shader model (unlike in the DirectX world, and the GLSL spec requires functionality that really needs SM3 hardware). As you are on a NVidia card, you could run NVemulate and make sure that your advanced hardware features are turned on.
Quote:Original post by HuntsManQuote:Original post by mlt
How do I move to VS 2.0? I thought it was a matter of hardware support?
What shading language are you using?
I am using Cg.
Change the Cg profile to fp40/vp40 or gp4fp/gp4vp. Both will make your shader not work on ATi. If ATi support is important, try compiling with Ashli and load somehow the resulting ARB-asm into Cg.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement