Mesa (master): clover: fix array images view creation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 3 22:05:16 UTC 2021


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar  3 12:44:46 2021 +1000

clover: fix array images view creation

Found this on top of Karol's patches but it seems like it can just be
applied to master.

Helps with some cases of
kernel_image_methods/test_kernel_image_methods 2Darray

Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9381>

---

 src/gallium/frontends/clover/core/resource.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/frontends/clover/core/resource.cpp b/src/gallium/frontends/clover/core/resource.cpp
index e0f151c2df3..87f4e42a67f 100644
--- a/src/gallium/frontends/clover/core/resource.cpp
+++ b/src/gallium/frontends/clover/core/resource.cpp
@@ -26,6 +26,7 @@
 #include "util/u_sampler.h"
 #include "util/format/u_format.h"
 #include "util/u_inlines.h"
+#include "util/u_resource.h"
 
 using namespace clover;
 
@@ -125,7 +126,10 @@ resource::create_image_view(command_queue &q) {
       view.u.buf.size = obj.size();
    } else {
       view.u.tex.first_layer = 0;
-      view.u.tex.last_layer = 0;
+      if (util_texture_is_array(pipe->target))
+         view.u.tex.last_layer = pipe->array_size - 1;
+      else
+         view.u.tex.last_layer = 0;
       view.u.tex.level = 0;
    }
 



More information about the mesa-commit mailing list