aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2019-10-22 16:07:45 -0700
committerKristian H. Kristensen <[email protected]>2019-11-07 16:36:42 -0800
commit5d67da13a3f9e22bc5490e2e658f46806125fce1 (patch)
tree67536c293ae1f6732ced6b6003d7a49687205190 /src/gallium/drivers/freedreno/ir3/ir3_gallium.c
parent1f3b52ce503597ccb170b7caae3b3f19890dce46 (diff)
freedreno/ir3: Emit link map as byte or dwords offsets as needed
Stages that load inputs with ldlw (TCS, GS) need byte offsets, stages that load with ldg (TES) need dwords offsets. Signed-off-by: Kristian H. Kristensen <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_gallium.c')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
index 9fad7446080..8b329687978 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
@@ -400,13 +400,27 @@ link_geometry_stages(const struct ir3_shader_variant *producer,
const struct ir3_shader_variant *consumer,
uint32_t *locs)
{
- uint32_t num_loc = 0;
+ uint32_t num_loc = 0, factor;
+
+ switch (consumer->type) {
+ case MESA_SHADER_TESS_CTRL:
+ case MESA_SHADER_GEOMETRY:
+ /* These stages load with ldlw, which expects byte offsets. */
+ factor = 4;
+ break;
+ case MESA_SHADER_TESS_EVAL:
+ /* The tess eval shader uses ldg, which takes dword offsets. */
+ factor = 1;
+ break;
+ default:
+ unreachable("bad shader stage");
+ }
nir_foreach_variable(in_var, &consumer->shader->nir->inputs) {
nir_foreach_variable(out_var, &producer->shader->nir->outputs) {
if (in_var->data.location == out_var->data.location) {
locs[in_var->data.driver_location] =
- producer->shader->output_loc[out_var->data.driver_location] * 4;
+ producer->shader->output_loc[out_var->data.driver_location] * factor;
debug_assert(num_loc <= in_var->data.driver_location + 1);
num_loc = in_var->data.driver_location + 1;