diff options
author | Kenneth Graunke <[email protected]> | 2015-03-06 01:24:30 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-03-08 20:04:02 -0700 |
commit | 8dcc1f2c10b3dc6ded38e7a6c302f60061ba587c (patch) | |
tree | cd60e01f499248d331e23afd668be741f40be541 /src/glsl | |
parent | c6f2abe67e38c52361a1d342dca6ec5ed7747913 (diff) |
nir: Only do gl_FrontFacing workaround in glsl_to_nir for the FS.
Vertex shaders can have shader inputs where location happens to be
VARYING_SLOT_FACE. Without predicating this on the shader stage,
we suddenly end up with load_front_face intrinsics in vertex shaders,
which is nonsensical.
Fixes spec/arb_vertex_buffer_object/pos-array when using NIR for VS.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/glsl_to_nir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index ddad207232e..047cb51e85d 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -251,7 +251,8 @@ nir_visitor::visit(ir_variable *ir) break; case ir_var_shader_in: - if (ir->data.location == VARYING_SLOT_FACE) { + if (stage == MESA_SHADER_FRAGMENT && + ir->data.location == VARYING_SLOT_FACE) { /* For whatever reason, GLSL IR makes gl_FrontFacing an input */ var->data.location = SYSTEM_VALUE_FRONT_FACE; var->data.mode = nir_var_system_value; |