Sign in to follow this  
Alex F

Detecting shader restrictions

Recommended Posts

Compiling pixel shader I got this error: X4507 - maximum constant register index exceeded How can I detect maximal allowed register index, and other shader restrictions programmatically using D3D functions?

Share this post


Link to post
Share on other sites
I believe those restrictions are all included in the actual shader model spec. Check the D3D docs for the numbers.

Share this post


Link to post
Share on other sites
To get the exact value you need to call GetCaps(). The D3DCAPS9 structure has a MaxVertexShaderConst member.

The specifications will tell you the minimum available for each shader version (it's 256 for both VS 2.0 and VS 3.0), and the caps will tell you how many are actually available. However, they are often identical, since creating code and data to support a variable available register count can be awkward.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this