summaryrefslogtreecommitdiff
path: root/src/panfrost
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2021-01-03 22:03:57 +1300
committerMarge Bot <eric+marge@anholt.net>2021-01-18 20:49:45 +0000
commita8c91f15f0339bf03fae5b0712e4a657f8d09c72 (patch)
treee7318060adc30aa5e72a9f490b4c770a453062ca /src/panfrost
parent6f0eff548c16c12309edec812b6573c63fdc866d (diff)
pan/mdg: Fix spilling when scratch memory is used
Add the tls_size from NIR before spilling so that it doesn't alias with spill slots. Fixes: 152bc5d15e1 ("pan/mdg: Support loads and stores to scratch memory") Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8358>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/midgard/midgard_ra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c
index 04be27da50e..72c06ade683 100644
--- a/src/panfrost/midgard/midgard_ra.c
+++ b/src/panfrost/midgard/midgard_ra.c
@@ -1011,7 +1011,7 @@ mir_ra(compiler_context *ctx)
int iter_count = 1000; /* max iterations */
/* Number of 128-bit slots in memory we've spilled into */
- unsigned spill_count = 0;
+ unsigned spill_count = DIV_ROUND_UP(ctx->tls_size, 16);
mir_create_pipeline_registers(ctx);
@@ -1054,7 +1054,7 @@ mir_ra(compiler_context *ctx)
/* Report spilling information. spill_count is in 128-bit slots (vec4 x
* fp32), but tls_size is in bytes, so multiply by 16 */
- ctx->tls_size += spill_count * 16;
+ ctx->tls_size = spill_count * 16;
install_registers(ctx, l);