enurming vertex shader input attribs

Started by
1 comment, last by MJP 12 years, 10 months ago
hi

how can i enrum(get name of) vertex shader attribs (input vertex type like as color and position) ?

for example i want get name of the "in_Position" and "in_Color" from following shader:


float4x4 in_ModelviewProjectionMatrix;

struct OutputVS
{
float4 posH : POSITION0;
};

OutputVS vmain(float3 in_Position : POSITION0, float3 in_Color : COLOR0)
{
....
}


i can get in_ModelviewProjectionMatrix fromconstant table but in_Position and in_Color aren't exist in constant table. i want use this variables for creating desired VertexDeclaration for my vertex shader automatically in my engine
Advertisement

hi

how can i enrum(get name of) vertex shader attribs (input vertex type like as color and position) ?

for example i want get name of the "in_Position" and "in_Color" from following shader:


float4x4 in_ModelviewProjectionMatrix;

struct OutputVS
{
float4 posH : POSITION0;
};

OutputVS vmain(float3 in_Position : POSITION0, float3 in_Color : COLOR0)
{
....
}


i can get in_ModelviewProjectionMatrix fromconstant table but in_Position and in_Color aren't exist in constant table. i want use this variables for creating desired VertexDeclaration for my vertex shader automatically in my engine


Hi, when you look at bits such as : POSITION0, they refer to the position in your vertex declaration which has the index of 0, and the same goes for the colour
I don't think there's a way to get the actual name of the vertex shader input parameters in D3D9. You can however query the semantics through D3DXGetShaderInputSemantics.

This topic is closed to new replies.

Advertisement