summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-10-21 18:39:06 -0700
committerJason Ekstrand <[email protected]>2015-10-21 18:39:06 -0700
commit164abff0c017b542604f945fb6c7de77e3403698 (patch)
treead45e38e770c8e191cbfbc8e93b4434f78466753
parent5790ee2bbbf039e0886ad02d0c9f0e929ad7ec87 (diff)
nir/spirv: Add support for more CS system values
-rw-r--r--src/glsl/nir/spirv_to_nir.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/glsl/nir/spirv_to_nir.c b/src/glsl/nir/spirv_to_nir.c
index 63f58bc2b2a..a3d38831267 100644
--- a/src/glsl/nir/spirv_to_nir.c
+++ b/src/glsl/nir/spirv_to_nir.c
@@ -708,18 +708,24 @@ vtn_get_builtin_location(SpvBuiltIn builtin, int *location,
*location = FRAG_RESULT_DEPTH;
*mode = nir_var_shader_out;
break;
- case SpvBuiltInHelperInvocation:
- unreachable("unsupported builtin"); /* XXX */
- break;
case SpvBuiltInNumWorkgroups:
case SpvBuiltInWorkgroupSize:
/* these are constants, need to be handled specially */
unreachable("unsupported builtin");
- case SpvBuiltInWorkgroupId:
- case SpvBuiltInLocalInvocationId:
+ break;
case SpvBuiltInGlobalInvocationId:
case SpvBuiltInLocalInvocationIndex:
- unreachable("no compute shader support");
+ /* these are computed values, need to be handled specially */
+ unreachable("unsupported builtin");
+ case SpvBuiltInWorkgroupId:
+ *location = SYSTEM_VALUE_WORK_GROUP_ID;
+ *mode = nir_var_system_value;
+ break;
+ case SpvBuiltInLocalInvocationId:
+ *location = SYSTEM_VALUE_LOCAL_INVOCATION_ID;
+ *mode = nir_var_system_value;
+ break;
+ case SpvBuiltInHelperInvocation:
default:
unreachable("unsupported builtin");
}