aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/midgard
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-10 15:54:17 -0400
committerMarge Bot <[email protected]>2020-03-11 20:28:20 +0000
commit674b24dcfd34ea8c6c2ee9a0232f59519ce1d3c1 (patch)
tree08ff90c574712a6ea826b7a3231916cb4734a0fd /src/panfrost/midgard
parent7c2647f4117a5ec73c0ce12d224318ec5557f31d (diff)
pan/midgard: Remove indexing dependency of sysvals
Ideally we would sync the compilers to use the same indexing scheme but that's a lot more Midgard refactoring than I have time for right now. This is good enough honestly. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r--src/panfrost/midgard/midgard_compile.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index d1805a5f4d7..db69619e0ec 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -338,7 +338,7 @@ midgard_nir_sysval_for_intrinsic(nir_intrinsic_instr *instr)
}
static int
-sysval_for_instr(nir_instr *instr, unsigned *dest)
+sysval_for_instr(nir_instr *instr, nir_dest *dest)
{
nir_intrinsic_instr *intr;
nir_dest *dst = NULL;
@@ -368,7 +368,7 @@ sysval_for_instr(nir_instr *instr, unsigned *dest)
}
if (dest && dst)
- *dest = nir_dest_index(dst);
+ *dest = *dst;
return sysval;
}
@@ -1371,12 +1371,14 @@ static void
emit_sysval_read(compiler_context *ctx, nir_instr *instr, signed dest_override,
unsigned nr_components, unsigned offset)
{
- unsigned dest = 0;
+ nir_dest nir_dest;
/* Figure out which uniform this is */
- int sysval = sysval_for_instr(instr, &dest);
+ int sysval = sysval_for_instr(instr, &nir_dest);
void *val = _mesa_hash_table_u64_search(ctx->sysval_to_id, sysval);
+ unsigned dest = nir_dest_index(&nir_dest);
+
if (dest_override >= 0)
dest = dest_override;