[Mesa-dev] [PATCH v2 46/52] nir/lower_system_values: Lower SUBGROUP_*_MASK based on type

Lionel Landwerlin lionel.g.landwerlin at intel.com
Fri Oct 13 10:54:10 UTC 2017


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 13/10/17 06:48, Jason Ekstrand wrote:
> 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.
> ---
>   src/compiler/nir/nir_lower_system_values.c | 5 +++--
>   1 file 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 c21a468..f3db3847 100644
> --- a/src/compiler/nir/nir_lower_system_values.c
> +++ b/src/compiler/nir/nir_lower_system_values.c
> @@ -124,8 +124,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;




More information about the mesa-dev mailing list