Skip to content

Conversation

@samsinsane
Copy link
Contributor

Related to #3058

@CLAassistant
Copy link

CLAassistant commented Apr 25, 2020

CLA assistant check
All committers have signed the CLA.

@kdashg
Copy link
Contributor

kdashg commented Jun 18, 2020

fshaderDeclarationInsideSwitchLiteralDefault fails on Firefox Windows with ANGLE, but passes without ANGLE (native gl amd).

@kdashg
Copy link
Contributor

kdashg commented Jun 18, 2020

This might be a D3D bug, given the failure is with this seemingly-reasonable hlsl:

// FRAGMENT SHADER BEGIN
// GLSL BEGIN
#version 300 es
precision highp float;
out vec4 my_FragColor;
void main()
{
    my_FragColor = vec4(1, 0, 0, 1);
    switch (0)
    {
        default:
            ivec2 i;
            i = ivec2(1, 0);
            my_FragColor = vec4(0, i[0], 0, 1);
    }
}
// GLSL END
// INITIAL HLSL BEGIN
float4 vec4_ctor(int x0, int x1, int x2, int x3)
{
    return float4(x0, x1, x2, x3);
}
#ifdef ANGLE_ENABLE_LOOP_FLATTEN
#define LOOP [loop]
#define FLATTEN [flatten]
#else
#define LOOP
#define FLATTEN
#endif
#define ATOMIC_COUNTER_ARRAY_STRIDE 4
// Varyings
static float4 out_my_FragColor = {0, 0, 0, 0};
cbuffer DriverConstants : register(b1)
{
};
@@ PIXEL OUTPUT @@
PS_OUTPUT main(@@ PIXEL MAIN PARAMETERS @@){
@@ MAIN PROLOGUE @@
(out_my_FragColor = float4(1.0, 0.0, 0.0, 1.0));
{
int2 _i2324 = {0, 0};
switch (0) {
default:
(_i2324 = int2(1, 0));
(out_my_FragColor = vec4_ctor(0, _i2324[0], 0, 1));
break;
}
}
return generateOutput();
}
// INITIAL HLSL END
// FRAGMENT SHADER END

Copy link
Member

@kenrussell kenrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test case and sorry for the long delay reviewing it. Can confirm that the tests pass on macOS, so this looks like a problem specific to ANGLE's D3D11 backend, and yes, potentially a bug in Microsoft's HLSL compiler fxc.exe. Have filed https://bugs.chromium.org/p/angleproject/issues/detail?id=4807 about this and will try to engage the D3D team at Microsoft to help confirm. CC'ing @RafaelCintron .

@kenrussell kenrussell merged commit 02aaeea into KhronosGroup:master Jun 30, 2020
@samsinsane samsinsane deleted the switchTests branch June 30, 2020 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants