aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-12-12 12:49:12 -0800
committerMarge Bot <[email protected]>2020-02-04 23:18:00 +0000
commit6b586d5a48cc11ee216f18ac093a601917861cff (patch)
treeb16dc523f1ba4f638ab22525a767dde64d069c04 /src/gallium/drivers/freedreno
parentf9f5d3eb554e6096b762744125580a239d3809b0 (diff)
freedreno: Swap the whole resource layout in shadowing.
Let's not have to worry about whether this unusual code path gets updated whenever we adjust what is in the layout struct. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3059>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
index 0f48e5878ff..b92663c90a3 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -223,11 +223,7 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
/* TODO valid_buffer_range?? */
swap(rsc->bo, shadow->bo);
swap(rsc->write_batch, shadow->write_batch);
- for (int level = 0; level <= prsc->last_level; level++) {
- swap(rsc->layout.slices[level], shadow->layout.slices[level]);
- swap(rsc->layout.ubwc_slices[level], shadow->layout.ubwc_slices[level]);
- }
- swap(rsc->layout.ubwc_layer_size, shadow->layout.ubwc_layer_size);
+ swap(rsc->layout, shadow->layout);
rsc->seqno = p_atomic_inc_return(&ctx->screen->rsc_seqno);
/* at this point, the newly created shadow buffer is not referenced