Module: Mesa
Branch: main
Commit: bc91af8021a7fb44c7c4e67f25ef670d55ea109d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc91af8021a7fb44c7c4e67f25ef670d55ea109d

Author: Louis-Francis Ratté-Boulianne <[email protected]>
Date:   Fri Sep  1 11:26:02 2023 -0400

panfrost: Don't force constant modifier after converting

After converting a texture from one modifier to another, there is
no reason to force the modifier to stay constant afterwards. Set
back `modifier_constant` to false because it is changed by
`resource_setup` as it is causing issues when implementing AFBC
packing.

Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>

---

 src/gallium/drivers/panfrost/pan_resource.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c 
b/src/gallium/drivers/panfrost/pan_resource.c
index 7b8407590f3..57420b9b4fd 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -1216,6 +1216,10 @@ pan_resource_modifier_convert(struct panfrost_context 
*ctx,
 
    panfrost_resource_setup(pan_device(ctx->base.screen), rsrc, modifier,
                            blit.dst.format);
+   /* panfrost_resource_setup will force the modifier to stay constant when
+    * called with a specific modifier. We don't want that here, we want to
+    * be able to convert back to another modifier if needed */
+   rsrc->modifier_constant = false;
    pipe_resource_reference(&tmp_prsrc, NULL);
 }
 

Reply via email to