diff options
author | Jason Ekstrand <[email protected]> | 2017-08-22 14:09:37 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-11-07 10:37:52 -0800 |
commit | 9b35faba426acc111741aa69752cb87185e548aa (patch) | |
tree | 7b598b13ff074ca25c01ebd1e364a7066939b07c /src/compiler | |
parent | 3ee91ee6ac739f7ad4d5d4b066073efbeb511b41 (diff) |
nir/lower_system_values: Lower SUBGROUP_*_MASK based on type
The SUBGROUP_*_MASK system values are uint64_t when coming in from GLSL
but uvec4 when coming in from SPIR-V. Lowering based on type allows us
to nicely handle both.
Reviewed-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_lower_system_values.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c index 48c497ef411..3594f4ae5ce 100644 --- a/src/compiler/nir/nir_lower_system_values.c +++ b/src/compiler/nir/nir_lower_system_values.c @@ -125,8 +125,9 @@ convert_block(nir_block *block, nir_builder *b) nir_intrinsic_op op = nir_intrinsic_from_system_value(var->data.location); nir_intrinsic_instr *load = nir_intrinsic_instr_create(b->shader, op); - nir_ssa_dest_init(&load->instr, &load->dest, 1, 64, NULL); - load->num_components = 1; + nir_ssa_dest_init_for_type(&load->instr, &load->dest, + var->type, NULL); + load->num_components = load->dest.ssa.num_components; nir_builder_instr_insert(b, &load->instr); sysval = &load->dest.ssa; break; |