From: Jason Ekstrand Date: Fri, 19 Jul 2019 15:42:56 +0000 (-0500) Subject: glsl: Treat gl_FragCoord as a varying even when it's a system value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44268b1c72e327a812678f123000942083407944;p=mesa.git 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 --- 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; }