diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 95c51956254..1bfded8a2ff 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -443,6 +443,12 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc, swap(rsc->bo, shadow->bo); swap(rsc->valid, shadow->valid); + + /* swap() doesn't work because you can't typeof() the bitfield. */ + bool temp = shadow->needs_ubwc_clear; + shadow->needs_ubwc_clear = rsc->needs_ubwc_clear; + rsc->needs_ubwc_clear = temp; + swap(rsc->layout, shadow->layout); rsc->seqno = p_atomic_inc_return(&ctx->screen->rsc_seqno);