Mesa (staging/21.2): clover/spirv: Properly size 3-component vector args

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 3 18:09:02 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 90645f3eea346ccb2eeddc41b72b5abc73d6a56c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=90645f3eea346ccb2eeddc41b72b5abc73d6a56c

Author: Pierre Moreau <dev at pmoreau.org>
Date:   Tue Apr 13 22:14:03 2021 +0200

clover/spirv: Properly size 3-component vector args

This resolves clover returning `CL_INVALID_ARG_SIZE` whenever the OpenCL
CTS called `clSetKernelArg()` for 3-component vectors.

Fixes: 21473865050 ("clover/spirv: Add functions for parsing arguments, linking programs, etc.")

v2: Remove “api/clsetkernelarg/set kernel argument for cl_int3” from the
  expected fails for llvmpipe

Reviewed-by: Karol Herbst <kherbst at redhat.com>
Signed-off-by: Pierre Moreau <dev at pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10256>
(cherry picked from commit a6c26a6ad94d16ad044c3b64d72ff9daf863b3be)

---

 .pick_status.json                                 | 2 +-
 src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt   | 1 -
 src/gallium/frontends/clover/spirv/invocation.cpp | 5 ++---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 7b8c3796ee2..529e6fd74b8 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -31,7 +31,7 @@
         "description": "clover/spirv: Properly size 3-component vector args",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "2147386505015e3089d51e3e5bf58489ab912aa6"
     },
diff --git a/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt b/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt
index 8f16479afaa..44fc9081f54 100644
--- a/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt
+++ b/src/gallium/drivers/llvmpipe/ci/llvmpipe-cl.txt
@@ -6,7 +6,6 @@ api/clenqueuemigratememobjects: skip
 api/clgetextensionfunctionaddressforplatform: skip
 api/clgetkernelarginfo: skip
 api/cllinkprogram: skip
-api/clsetkernelarg/set kernel argument for cl_int3: fail
 interop/egl_khr_cl_event2: skip
 program/build/include-directories: fail
 program/build/math-intrinsics: fail
diff --git a/src/gallium/frontends/clover/spirv/invocation.cpp b/src/gallium/frontends/clover/spirv/invocation.cpp
index ec425e2c7d6..ce1e85f7b61 100644
--- a/src/gallium/frontends/clover/spirv/invocation.cpp
+++ b/src/gallium/frontends/clover/spirv/invocation.cpp
@@ -330,9 +330,8 @@ namespace {
 
             const auto elem_size = types_iter->second.size;
             const auto elem_nbs = get<uint32_t>(inst, 3);
-            const auto size = elem_size * elem_nbs;
-            const auto align = elem_size * util_next_power_of_two(elem_nbs);
-            types[id] = { module::argument::scalar, size, size, align,
+            const auto size = elem_size * (elem_nbs != 3 ? elem_nbs : 4);
+            types[id] = { module::argument::scalar, size, size, size,
                           module::argument::zero_ext };
             types[id].info.address_qualifier = CL_KERNEL_ARG_ADDRESS_PRIVATE;
             break;



More information about the mesa-commit mailing list