# D3DCAPS9::MaxVertexBlendMatrixIndex - WHY??

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
Because (for DX8/9) constants are't stored in main memory, they're registers on the vertex shader.

##### Share on other sites
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.

##### Share on other sites
Quote:
 Original post by MercenareyWhy 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).

##### Share on other sites
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?

##### Share on other sites
Quote:
 Original post by MercenareyThanx 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.

##### Share on other sites
ok, thanx alot :)

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 14
• 14
• 9
• ### Forum Statistics

• Total Topics
633368
• Total Posts
3011531
• ### Who's Online (See full list)

There are no registered users currently online

×