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: 2147386505 ("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@redhat.com>
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10256>
(cherry picked from commit a6c26a6ad9)
This commit is contained in:
Pierre Moreau 2021-04-13 22:14:03 +02:00 committed by Dylan Baker
parent 432964005b
commit 90645f3eea
3 changed files with 3 additions and 5 deletions

View file

@ -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"
},

View file

@ -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

View file

@ -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;