summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_variables.c
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2016-11-25 12:05:07 +0800
committerChih-Wei Huang <cwhuang@linux.org.tw>2016-11-25 12:05:07 +0800
commit524121d42bfdf8c1bd3565bd2adb0ffd7b52713f (patch)
tree57b645909523126d571949a0cabb16087aca9849 /src/compiler/spirv/vtn_variables.c
parent5d0d07d402fa0edead26450fb86111292e8f834f (diff)
parentf7b58a378ca94cf1c2637d640ce5b9fb8f8519a6 (diff)
downloadexternal_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.zip
external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.tar.gz
external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.tar.bz2
Merge remote-tracking branch 'mesa/13.0' into nougat-x86
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r--src/compiler/spirv/vtn_variables.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 634058c..b66ceb2 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -805,8 +805,12 @@ vtn_get_builtin_location(struct vtn_builder *b,
set_mode_system_value(mode);
break;
case SpvBuiltInPrimitiveId:
- *location = VARYING_SLOT_PRIMITIVE_ID;
- *mode = nir_var_shader_out;
+ if (*mode == nir_var_shader_out) {
+ *location = VARYING_SLOT_PRIMITIVE_ID;
+ } else {
+ *location = SYSTEM_VALUE_PRIMITIVE_ID;
+ set_mode_system_value(mode);
+ }
break;
case SpvBuiltInInvocationId:
*location = SYSTEM_VALUE_INVOCATION_ID;