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

Author: Italo Nicola <italonic...@collabora.com>
Date:   Tue Sep 12 19:57:39 2023 +0000

gallium: stop calling resource_copy_region for multisampled copy_image

The hook explicitly says it's not supposed to be called for nr_samples > 1.

Signed-off-by: Italo Nicola <italonic...@collabora.com>
Reviewed-by: Alyssa Rosenzweig <aly...@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24942>

---

 src/mesa/state_tracker/st_cb_copyimage.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_copyimage.c 
b/src/mesa/state_tracker/st_cb_copyimage.c
index fefbff78999..2bf95a66358 100644
--- a/src/mesa/state_tracker/st_cb_copyimage.c
+++ b/src/mesa/state_tracker/st_cb_copyimage.c
@@ -509,8 +509,14 @@ copy_image(struct pipe_context *pipe,
    if (src->format == dst->format ||
        util_format_is_compressed(src->format) ||
        util_format_is_compressed(dst->format)) {
-      pipe->resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
-                                 src, src_level, src_box);
+
+      if (src->nr_samples <= 1 && dst->nr_samples <= 1) {
+         pipe->resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
+                                    src, src_level, src_box);
+      } else {
+         blit(pipe, dst, dst->format, dst_level, dstx, dsty, dstz,
+              src, src->format, src_level, src_box);
+      }
       return;
    }
 

Reply via email to