Jump to content
  • Advertisement
Sign in to follow this  
esr_ever

HLSL - internal compiler error

This topic is 2713 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've been messing with some HLSL shaders and I've run to the following error :

error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Input index range defined from 12 to 22 includes input register [13] that was not declared.
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Input index range defined from 12 to 22 includes input register [15] that was not declared.
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Input index range defined from 12 to 22 includes input register [17] that was not declared.
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Input index range defined from 12 to 22 includes input register [19] that was not declared.
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Input index range defined from 12 to 22 includes input register [21] that was not declared.

The procedure is as follows:
1. Declare a static const nively bound lookup table in the global space
(all following in pixel shader)
2. Compute an index based on comparison of values in the input struct ( say a minimum)
3. Use that index to get the appropriate element of another input struct array.

Step No 3 fails with the above. I'm pretty sure that all the indexing is sane in all paths, although just from eyeballing ( the shader's not that complex yet anyway)

The offending code chunk (slightly simplified) is :

PS_Struct
{
..various stuff..
vec3 arg[8] : SOMEARG;
vec3 data[6]: SOMEDATA;
}

static const uint3 lookup[8] = {init values, all of them from 0 to 5 inclusive}
...
// In pixel shader, given 'PS_Struct input'
int i;

// Compute vals
float vals[8];
[unroll]
for(i=0;i<8;++i)
{
vals = DoSomeStuff(input.arg)
}

// Compute minval & minindex
float minval = vals[0];
int min_i=0;
[unroll]
for(i=1;i<8;++i)
{
if(vals < minval)
{
minval = vals;
min_i = i;
}
}

uint3 iv_min = lookup[min_i];
// return float4(iv_min, 1); // this works
// return float4( input.data[iv_min[0]], 1); // this works
return float4( input.data[iv_min[0]], 1); // THIS DOESN'T


Compiler is 9.29.952.3111 from the June 2010 SDK.
Shader model used is either 4 or 5, doesn't make a difference


Thanks,
Babis

Share this post


Link to post
Share on other sites
Advertisement
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!