From 90645f3eea346ccb2eeddc41b72b5abc73d6a56c Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Tue, 13 Apr 2021 22:14:03 +0200 Subject: [PATCH] clover/spirv: Properly size 3-component vector args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Pierre Moreau Part-of: (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(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;