Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

D3D10_Input_element_desc question

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 zqueezy   Members   

122
Like
0Likes
Like

Posted 08 March 2011 - 04:28 PM

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

#2 DieterVW   Members   

724
Like
1Likes
Like

Posted 08 March 2011 - 08:12 PM

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.

#3 zqueezy   Members   

122
Like
0Likes
Like

Posted 09 March 2011 - 05:52 PM

Danke Dieter!




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.