I have a geometry shader (DirectX 10 SDK, June 2008), like the following:
#define MAXTEXCOORDS 8
struct VSOutput
{
float4 pos: SV_POSITION;
float2 UV[MAXTEXCOORDS]: TEXCOORD;
};
int normalMapUVChannel; // From 0 to 7
[maxvertexcount(3)]
void GS(triangle VSOutput input[3], inout TriangleStream<GSOutput> OutputStream)
{
float DeltaU1 = input[2].UV[normalMapUVChannel].x - input[1].UV[normalMapUVChannel].x;
etc...
}
The shader compiler report the following errors:
error X8000: D3D10 Internal Compiler Error: Invalid Bytecode: Overlapping input index range decl encountered. Opcode #28 (count is 1-based).
error X8000: D3D10 Internal Compiler Error: Invalid Bytecode: Can't continue validation - aborting.
The error is generated by the first line. Note if I make the index constant, the error disappear:
float DeltaU1 = input[2].UV[0].x - input[1].UV[0].x;
but in this way I need to replicate the shader 8 times (that moreover it's already replicated for other reasons), that's quite a problem. :wallbash:
Someone know a workaround to this? Thanks in advance.
- AGPX












