panfrost: Reinterpret format for reload blits
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 19 Feb 2021 19:08:42 +0000 (14:08 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 22 Feb 2021 19:17:49 +0000 (19:17 +0000)
Fixes dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.r32ui_rgb10_a2.texture2d_to_texture2d

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9164>

src/gallium/drivers/panfrost/pan_job.c

index cb1a207..5709f01 100644 (file)
@@ -793,7 +793,8 @@ panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, u
                                                     rsrc->damage.extent.maxy);
         }
 
-        enum pipe_format format = rsrc->base.format;
+        /* Note: this may not equal surf->texture->format, we reinterpret */
+        enum pipe_format format = surf->format;
 
         if (loc == FRAG_RESULT_DEPTH) {
                 if (!util_format_has_depth(util_format_description(format)))
@@ -834,10 +835,10 @@ panfrost_load_surface(struct panfrost_batch *batch, struct pipe_surface *surf, u
         mali_ptr blend_shader = 0;
 
         if (loc >= FRAG_RESULT_DATA0 &&
-            !panfrost_blend_format(rsrc->base.format).internal) {
+            !panfrost_blend_format(format).internal) {
                 struct panfrost_blend_shader *b =
                         panfrost_get_blend_shader(batch->ctx, batch->ctx->blit_blend,
-                                                  rsrc->base.format,
+                                                  format,
                                                   rsrc->base.nr_samples,
                                                   loc - FRAG_RESULT_DATA0,
                                                   NULL);