diff --git a/libs/vkd3d-shader/glsl.c b/libs/vkd3d-shader/glsl.c index ddab6b3a..e88c0c42 100644 --- a/libs/vkd3d-shader/glsl.c +++ b/libs/vkd3d-shader/glsl.c @@ -602,6 +602,15 @@ static void shader_glsl_print_sysval_name(struct vkd3d_string_buffer *buffer, st } break; + case VKD3D_SHADER_SV_IS_FRONT_FACE: + if (version->type != VKD3D_SHADER_TYPE_PIXEL) + vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL, + "Internal compiler error: Unhandled SV_IS_FRONT_FACE in shader type #%x.", version->type); + vkd3d_string_buffer_printf(buffer, + "uintBitsToFloat(uvec4(gl_FrontFacing ? 0xffffffffu : 0u, 0u, 0u, 0u))"); + + break; + case VKD3D_SHADER_SV_TARGET: if (version->type != VKD3D_SHADER_TYPE_PIXEL) vkd3d_glsl_compiler_error(gen, VKD3D_SHADER_ERROR_GLSL_INTERNAL, @@ -731,6 +740,7 @@ static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen, break; case VKD3DSIH_DCL_INPUT: case VKD3DSIH_DCL_INPUT_PS: + case VKD3DSIH_DCL_INPUT_PS_SIV: case VKD3DSIH_DCL_OUTPUT: case VKD3DSIH_DCL_OUTPUT_SIV: case VKD3DSIH_NOP: diff --git a/tests/hlsl/is-front-face.shader_test b/tests/hlsl/is-front-face.shader_test index f52b456e..06be3fb9 100644 --- a/tests/hlsl/is-front-face.shader_test +++ b/tests/hlsl/is-front-face.shader_test @@ -22,7 +22,7 @@ float4 main(bool face : sv_isfrontface) : sv_target } [test] -todo(glsl) draw triangle strip 4 +draw triangle strip 4 probe (0, 0, 640, 480) rgba (0.0, 1.0, 0.0, 1.0) [vb 0] @@ -32,5 +32,5 @@ probe (0, 0, 640, 480) rgba (0.0, 1.0, 0.0, 1.0) 2.0 2.0 [test] -todo(glsl) draw triangle strip 4 +draw triangle strip 4 probe (0, 0, 640, 480) rgba (1.0, 2.0, 1.0, 2.0)