From: Jonathan Marek Date: Wed, 11 Sep 2019 20:45:05 +0000 (-0400) Subject: etnaviv: nir: set num_components for inputs/outputs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95fa799c86e062c40004031c2c0028d5e59d8cab;p=mesa.git etnaviv: nir: set num_components for inputs/outputs This can improve performance by allowing the LAST_VARYING_2X bit to be set when possible (and possibility more benefits on HALTI5 where the number of components is set for each varying). Signed-off-by: Jonathan Marek Reviewed-by: Christian Gmeiner --- diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index a00f89b4e21..cc03e59fede 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -596,7 +596,7 @@ etna_compile_shader_nir(struct etna_shader_variant *v) unsigned idx = var->data.driver_location; sf->reg[idx].reg = idx; sf->reg[idx].slot = var->data.location; - sf->reg[idx].num_components = 4; /* TODO */ + sf->reg[idx].num_components = glsl_get_components(var->type); sf->num_reg = MAX2(sf->num_reg, idx+1); } } else { @@ -605,7 +605,7 @@ etna_compile_shader_nir(struct etna_shader_variant *v) unsigned idx = var->data.driver_location; sf->reg[idx].reg = idx + 1; sf->reg[idx].slot = var->data.location; - sf->reg[idx].num_components = 4; /* TODO */ + sf->reg[idx].num_components = glsl_get_components(var->type); sf->num_reg = MAX2(sf->num_reg, idx+1); count++; } @@ -740,7 +740,7 @@ etna_compile_shader_nir(struct etna_shader_variant *v) sf->reg[sf->num_reg].reg = native; sf->reg[sf->num_reg].slot = var->data.location; - sf->reg[sf->num_reg].num_components = 4; /* TODO */ + sf->reg[sf->num_reg].num_components = glsl_get_components(var->type); sf->num_reg++; }