summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-09-11 16:45:05 -0400
committerJonathan Marek <[email protected]>2019-09-28 00:33:42 -0400
commit95fa799c86e062c40004031c2c0028d5e59d8cab (patch)
treec242e705cf4d361f9b61dc811e07a7c678ba229c
parent0036e078e3d097f8a7a94235052f6d0e647e4da1 (diff)
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 <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c6
1 files changed, 3 insertions, 3 deletions
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++;
}