Jump to content
  • Advertisement
Sign in to follow this  
flipcoder

Pixel Shader Uniform Cannot be Found

This topic is 958 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, 

 

What could be the reasons the Direct3D 9 GetConstantByName fails to find a uniform declared in a pixel shader? I verified the variable name, and the shader compiles fine with no errors. Any thoughts?

 

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

Are you using the uniform? If not, then possibly it has been stripped out (not 100% sure DX9 will do this, but it's a quick thing to check)

Share this post


Link to post
Share on other sites

Are you using the uniform? If not, then possibly it has been stripped out (not 100% sure DX9 will do this, but it's a quick thing to check)

 

Yes it's used.

Share this post


Link to post
Share on other sites

Ok found the problem. I was trying to convert from some GLSL 4.2 pixel shader code to HLSL ps profile 3. Some code not supported in ps 3. Something like this...

 

int i = CalcIndex_I();

int j = CalcIndex_J();
 
float r = my4x4UniformVar[j];
 
if (r > 0)
{
 
}
 
Initially it was not compiling, but then commenting out the code involving the uniform var, but leaving the declaration, the shader compiles fine but the uniform is opt-out!
 
Thanks a lot for all your help.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!