aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-03-21 17:20:00 -0700
committerJason Ekstrand <[email protected]>2018-04-09 19:45:25 -0700
commit14e0a222d959523252a300aec8dc94abe7d64529 (patch)
tree4ac996ce9b67497e0c696b853c0dcdf8049d01b8 /src/compiler/spirv
parent131d454c35400fc61b317121ab12881140457208 (diff)
spirv: Use the LOCAL_GROUP_SIZE system value
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_variables.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index b2897407fb1..0673fe80675 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1276,8 +1276,8 @@ vtn_get_builtin_location(struct vtn_builder *b,
set_mode_system_value(b, mode);
break;
case SpvBuiltInWorkgroupSize:
- /* This should already be handled */
- vtn_fail("unsupported builtin");
+ *location = SYSTEM_VALUE_LOCAL_GROUP_SIZE;
+ set_mode_system_value(b, mode);
break;
case SpvBuiltInWorkgroupId:
*location = SYSTEM_VALUE_WORK_GROUP_ID;
@@ -1407,19 +1407,6 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
case SpvDecorationBuiltIn: {
SpvBuiltIn builtin = dec->literals[0];
- if (builtin == SpvBuiltInWorkgroupSize) {
- /* This shouldn't be a builtin. It's actually a constant. */
- nir_var->data.mode = nir_var_global;
- nir_var->data.read_only = true;
-
- nir_constant *c = rzalloc(nir_var, nir_constant);
- c->values[0].u32[0] = b->shader->info.cs.local_size[0];
- c->values[0].u32[1] = b->shader->info.cs.local_size[1];
- c->values[0].u32[2] = b->shader->info.cs.local_size[2];
- nir_var->constant_initializer = c;
- break;
- }
-
nir_variable_mode mode = nir_var->data.mode;
vtn_get_builtin_location(b, builtin, &nir_var->data.location, &mode);
nir_var->data.mode = mode;