diff --git a/.pick_status.json b/.pick_status.json index 7efe9bef8bb..7638e412582 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1534,7 +1534,7 @@ "description": "rusticl/queue: fix error code for invalid sampler kernel arg", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5795ee0e08355ea2445ec9d4b2235a3a35ceda83", "notes": null 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); + } + } _ => {} };