sharpdx / SharpDX-Samples

Official repository for all SharpDX Samples
346 stars 222 forks source link

System.IndexOutOfRangeException: 'Index was outside the bounds of the array.' #58

Closed bryaan closed 5 years ago

bryaan commented 5 years ago

4.2.0-ci259

Trying to compile the MiniCube.fx shader

struct VS_IN
{
    float4 pos : POSITION;
    /* float4 col : COLOR; */
};

struct PS_IN
{
    float4 pos : SV_POSITION;
    /* float4 col : COLOR; */
};

float4x4 worldViewProj;

PS_IN VS(VS_IN input)
{
    PS_IN output = (PS_IN)0;

    output.pos = mul(input.pos, worldViewProj);
    //output.col = input.col;

    return output;
}

float4 PS(PS_IN input) : SV_TARGET
{
    //return vec4(1.0, 0.0, 0.0, 1.0);
    return float4(1.0f, 0.0f, 0.0f, 1.0f);
    //return input.col;
}

var vertexShaderByteCode = ShaderBytecode.CompileFromFile(baseDir + "Models/Minicube.fx", "VS", "vs_4_0");

And on this compilation command get failure of:

"System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'"