D3D10_Input_element_desc question

Started by
1 comment, last by zqueezy 13 years, 1 month ago
hey folks,
I wanna use arrays in my HLSL shader. the following situation occured to me:

struct VS_INPUT
{
float2 Pos : SV_POSITION;
float4 Other[6] : MY_CUSTOM;
};

I wanna give the vertices a lot of custom data... My question is what's the actual limit? I came across this problem when writing the input element description which looked roughly like this:

const D3D10_INPUT_ELEMENT_DESC myLayout[] =
{
{ "SV_POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "MY_CUSTOM", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 0, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "MY_CUSTOM", 1, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "MY_CUSTOM", 2, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "MY_CUSTOM", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "MY_CUSTOM", 4, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 },
{ "MY_CUSTOM", 5, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 },

I come from an OpenGL world, where the streams are limited to (usually) 16 vbos. Here, I have theoretically 6 streams bound to 1 (array) attribute that all use slot 1.
When the limit of DirectX is n streams (MSDN), does it mean I still have n-2 streams left for usage now or does my example leave me with n-7 streams?
(I wanna have even more float4 OtherX[6] : MY_CUSTOMX;)

kind of a weird question but thanks for any help
zqueezy
Advertisement
I think you are looking for this #define D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT which is in the DX10 header and is set to the value 16. Why did you think it was less than that?

Here you have used 7 streams and will have 9 left.
Danke Dieter!

This topic is closed to new replies.

Advertisement