Jump to content
  • Advertisement
Sign in to follow this  
AGPX

Shader compiler bug? (DX10)

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

Hi, 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. Someone know a workaround to this? Thanks in advance. - AGPX

Share this post


Link to post
Share on other sites
Advertisement
Ok man,

I have received an e-mail from Microsoft's man. He wrote: "Barring any unforeseen circumstances, this issue should get fixed in the November release. In the meantime, a workaround is to make the vertex indices dynamic as well as the interior index (ie, vert[someindex].tex[otherindex])."

That is, instead of:

float DeltaU1 = input[2].UV[normalMapUVChannel].x - input[1].UV[normalMapUVChannel].x;



you have to write:

uint baseindex = 0; float DeltaU1 = input[baseindex + 2].UV[normalMapUVChannel].x - input[baseindex + 1].UV[normalMapUVChannel].x;


...and this works!

Ok, I've learned the lesson: next time, instead of try to simplify the expression, I will try to make it more complex!

I hope this post can help somebody else.

Bye for now,

- AGPX

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!