summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2019-06-10 21:59:12 +0200
committerConnor Abbott <[email protected]>2019-07-18 14:21:41 +0200
commit4423552ff04647aae75dc2cc0dc0ce580b80b3a3 (patch)
tree559f0b654dc6b9eb5442221be685e444c28a3d2c /src/compiler
parent6e5e4bf0505f0723e500f2827d45c5d0191fb098 (diff)
nir/lower_viewport: Check variable mode first
The location is unused for shader_temp and function_temp variables, and due to the way we nir_lower_io_to_temproraries demotes shader_out variables to shader_temp variables, it happened to equal VARYING_SLOT_POS for the gl_Position temporary, which made this pass fail with the offline compiler due to this coming before vars_to_ssa. Reviewed-by: Qiang Yu <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_viewport_transform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_viewport_transform.c b/src/compiler/nir/nir_lower_viewport_transform.c
index 94b54524ab7..4bbc88d75f5 100644
--- a/src/compiler/nir/nir_lower_viewport_transform.c
+++ b/src/compiler/nir/nir_lower_viewport_transform.c
@@ -56,7 +56,8 @@ nir_lower_viewport_transform(nir_shader *shader)
continue;
nir_variable *var = nir_intrinsic_get_var(intr, 0);
- if (var->data.location != VARYING_SLOT_POS)
+ if (var->data.mode != nir_var_shader_out ||
+ var->data.location != VARYING_SLOT_POS)
continue;
nir_builder b;