D3DCAPS9::MaxVertexBlendMatrixIndex - WHY??

Started by
5 comments, last by Mercenarey 18 years, 8 months ago
Why is there a limit to how many matrices a vertexshader can support? My board has 256 MB memory, but still only has MaxVertexBlendMatrixIndex = 37. Why can't I just make a float4x4 array as big as I like, and then do the mathematical operations that I want on it? Why is there a limit so much smaller than the board's maximum memory?
Quote:CalvinI am only polite because I don't know enough foul languageQuote:Original post by superpigI think the reason your rating has dropped so much, Mercenarey, is that you come across as an arrogant asshole.
Advertisement
Because (for DX8/9) constants are't stored in main memory, they're registers on the vertex shader.
vs_1_1 gives you a minimum of 96 constants, whereas vs_2_0, vs_2_x, and vs_3_0 give you a minimum of 256 constants. If you are using 4x4 matrices, then each matrix requires 4 constants. This gives you a total of 24 on vs_1_1 and 64 on others. If you are efficient and use 3x4 matrices, then each matrix requires 3 contstants. This gives you a total of 32 on vs_1_1 and 85 on others.

The D3D runtime probably reserves a number of constants so it has room for all of the other states that it must store in the constant registers.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Quote:Original post by Mercenarey
Why is there a limit to how many matrices a vertexshader can support? My board has 256 MB memory, but still only has MaxVertexBlendMatrixIndex = 37.

Why can't I just make a float4x4 array as big as I like, and then do the mathematical operations that I want on it? Why is there a limit so much smaller than the board's maximum memory?

The constant has nothing to do with shaders. It specifices the maximum matrix index you can use in indexed vertex blending (a FFP thing).

Thanx alot guys, stuff got a bit clearer now.

However, I still don't understand the MaxVertexBlendMatrixIndex property. Atm. I just ignore it, and use 60 matrices on my shader (within the limit of the 256 constants), and index into it as I like - also beyond the 37, as my property states should be max.

What the hell is this property for?
Quote:CalvinI am only polite because I don't know enough foul languageQuote:Original post by superpigI think the reason your rating has dropped so much, Mercenarey, is that you come across as an arrogant asshole.
Quote:Original post by Mercenarey
Thanx alot guys, stuff got a bit clearer now.

However, I still don't understand the MaxVertexBlendMatrixIndex property. Atm. I just ignore it, and use 60 matrices on my shader (within the limit of the 256 constants), and index into it as I like - also beyond the 37, as my property states should be max.

What the hell is this property for?

The property is used for indexed vertex blending with the FFP, also known as matrix palette skinning. Using the FFP, you can stuff a matrix index and a number of weights in your vertex structure, and set a number of world matrices using SetTransform(D3DTS_WORLDMATRIX(n), &mat) where n is the index of the matrix to set.

If you're using shaders, this stuff doesn't apply to you. And if you're using the FFP, you might as well ignore it, because IIRC most nVidia cards don't support indexed vertex blending.

ok, thanx alot :)
Quote:CalvinI am only polite because I don't know enough foul languageQuote:Original post by superpigI think the reason your rating has dropped so much, Mercenarey, is that you come across as an arrogant asshole.

This topic is closed to new replies.

Advertisement