[DX9] Weird vertex constant register count in caps

Started by
3 comments, last by Schrompf 13 years, 5 months ago
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
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
Advertisement
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).
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.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
I couldn't tell you why, but any GPU I've ever worked with has always supported a max of 256 constant registers. Kinda annoying for skinning.

I would recommend that for DX10+ level GPU's, you use a texture for skinning.
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.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

This topic is closed to new replies.

Advertisement