I have a vertex shader that takes a 3D position and an integer as input parameters. The vertex shader passes the integer to the geometry shader that will generates quads depending on that integer value. The relevant HLSL code looks as following:
struct VS_In {
float4 p: SV_POSITION;
uint gType : TEXCOORD;
};
void VShader(inout VS_In v) {
v.p = mul(v.p, mTrans);
}
[maxvertexcount(8)]
void GShader(point VS_In input[1], inout TriangleStream<PS_In> stream )
{
EpmitGlyph(stream, input[0].p, input[0].gType);
....
}
The code works as expected when the DeviceCreationFlags.Debug is NOT set. When the debug flag is set, the program always fails at the context.DrawIndexed() call with the following error message:
D3D11 ERROR: ID3D11DeviceContext::DrawIndexed: Input Assembler - Vertex Shader linkage error: Signatures between stages are incompatible. Semantic 'TEXCOORD' has mismatched data types between the output stage and input stage. [ EXECUTION ERROR #344: DEVICE_SHADER_LINKAGE_COMPONENTTYPE]
It looks like that the integer parameter gType has wrong data type, as TEXCOORD should be float4 according to HLSL documentation. I tried to use different sematics for the gType parameter, but none worked. My question is: Can I pass generic integer values to the vertex shader via the vertex buffer? If yes, how should I declare its semantic so that the debug layer doesn't complain about it?