Jump to content
  • Advertisement
Sign in to follow this  
zqueezy

OpenGL D3D10_Input_element_desc question

This topic is 2750 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

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!