From c0f0baeaca1c9a84f9631fc67f33c0a6e295b841 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 8 Nov 2025 14:29:47 +0100 Subject: [PATCH] rusticl/queue: fix error code for invalid sampler kernel arg Fixes: 5795ee0e083 ("rusticl: translate spirv to nir and first steps to kernel arg handling") Part-of: --- src/gallium/frontends/rusticl/api/kernel.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/rusticl/api/kernel.rs b/src/gallium/frontends/rusticl/api/kernel.rs index b3571cf25be..164d0aa1c11 100644 --- a/src/gallium/frontends/rusticl/api/kernel.rs +++ b/src/gallium/frontends/rusticl/api/kernel.rs @@ -416,13 +416,18 @@ fn set_kernel_arg( return Err(CL_INVALID_ARG_VALUE); } } - // If the argument is of type sampler_t, the arg_value entry must be a pointer to the - // sampler object. - KernelArgType::Constant(_) | KernelArgType::Sampler => { + KernelArgType::Constant(_) => { if arg_value.is_null() { return Err(CL_INVALID_ARG_VALUE); } } + KernelArgType::Sampler => { + // CL_INVALID_SAMPLER for an argument declared to be of type sampler_t when the + // specified arg_value is not a valid sampler object. + if arg_value.is_null() { + return Err(CL_INVALID_SAMPLER); + } + } _ => {} };