Sign in to follow this  

[DX9] Weird vertex constant register count in caps

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

I query the D3D9Caps structure to learn how many vertex shader constant registers the current GPU has. This works fine on the reference device (8192), but on my ATI Radeon HD 4870 it just reports 256. Well... isn't DX10-capable hardware supposed to have 16 constant buffers with 4096 float4 registers each? Why do I see 256 there, and not 65k or at least the 4096 of a single constant buffer? Is this a driver bug or is there a hidden constraint I don't know of?

Any hint is greatly appreciated. Background: I perform hardware skinning in a vertex shader. I try to handle as many bones as possible in one go. I query the caps vertex shader constant register count to learn how large I can specify the matrix palette in the vertex shader source before I have to fallback to software skinning. Specifying a larger matrix palette manually only results in compilation failure of the shader.

Bye, Thomas

Share this post


Link to post
Share on other sites
D3D9 doesn't have constant buffers, you need DX10/11 for those. I think pretty much every DX9 card reports 256 for that limit, which is also the minimum for a Shader Model 3 card, so even if some DX10 cards reported a higher limit, you'd still want to be able to handle cards that can only use 256 constants.

The standard solution to this is that you split the model into pieces in your tool chain that have say 64 bones per piece (the absolute limit is 84 assuming a 4x3 matrix per bone, plus one world-view-projection matrix).

Share this post


Link to post
Share on other sites
Thanks for the reply. I already support minimum spec GPUs down to SM2.0, but I want to use more in case it's there. And for a Radeon4870 I KNOW that it's there. I'd be satisfied if it reports just a single of its constant buffers as linear vertex shader constant array for D3D9 - I'd still get 4096 vectors that way. So why does it tell me 256? What does ATI win be reporting me the minimum when they could get away easily with a multitude more? That's my actual question, I already handle everything else.

Share this post


Link to post
Share on other sites
Thanks to everyone for the input! I learned from you guys and other sources that most GPUs are lying about their constant registers in the D3D9 caps. Therefore I had to solve the problem in a different way. I added a post processing step to the Open Asset Import library that splits up meshes into submeshes that stay below a certain bone count limit. This of course costs additional drawcalls at every renderpass, but it's the only solution known to me that also scales back to SM2.0 hardware.

Share this post


Link to post
Share on other sites

This topic is 2579 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.

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