mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 15:10:10 +01:00
panfrost: Legalize before updating part of a AFBC-packed texture
When updating an AFBC-packed resource, we need to make sure it is
legalized before blitting the staging resource to it. We can't rely
on the blit to properly convert the resource as it will result in
blit recursion and a crash.
If the whole texture is updated however, there is no need to unpack
as the content can be discarded. Just create a new BO with the right
format.
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 33b48a5585 ("panfrost: Add debug flag to force packing of AFBC textures on upload")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27208>
This commit is contained in:
parent
ee77168d57
commit
1aa832e5f5
1 changed files with 4 additions and 0 deletions
|
|
@ -1609,6 +1609,10 @@ panfrost_ptr_unmap(struct pipe_context *pctx, struct pipe_transfer *transfer)
|
|||
prsrc->image.data.base = prsrc->bo->ptr.gpu;
|
||||
panfrost_bo_reference(prsrc->bo);
|
||||
} else {
|
||||
bool discard = panfrost_can_discard(&prsrc->base, &transfer->box,
|
||||
transfer->usage);
|
||||
pan_legalize_afbc_format(ctx, prsrc, prsrc->image.layout.format,
|
||||
true, discard);
|
||||
pan_blit_from_staging(pctx, trans);
|
||||
panfrost_flush_batches_accessing_rsrc(
|
||||
ctx, pan_resource(trans->staging.rsrc),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue