From 44268b1c72e327a812678f123000942083407944 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 19 Jul 2019 10:42:56 -0500 Subject: glsl: Treat gl_FragCoord as a varying even when it's a system value This fixes glsl-fcoord-invariant-pass.shader_test on drivers that set GLSLFragCoordIsSysVal which includes radeonsi among others. Reviewed-by: Kenneth Graunke --- src/compiler/glsl/ast_to_hir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compiler/glsl/ast_to_hir.cpp') diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index 9cd67ab7885..d7c396aa0eb 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -2706,7 +2706,9 @@ is_varying_var(ir_variable *var, gl_shader_stage target) case MESA_SHADER_VERTEX: return var->data.mode == ir_var_shader_out; case MESA_SHADER_FRAGMENT: - return var->data.mode == ir_var_shader_in; + return var->data.mode == ir_var_shader_in || + (var->data.mode == ir_var_system_value && + var->data.location == SYSTEM_VALUE_FRAG_COORD); default: return var->data.mode == ir_var_shader_out || var->data.mode == ir_var_shader_in; } -- cgit v1.2.3