rusticl/memory: fix sampler argument size check

Not entirely sure why this hasn't caused any problems...

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30602>
(cherry picked from commit 0cfcd2ff83)
This commit is contained in:
Karol Herbst 2024-08-11 11:41:02 +02:00 committed by Eric Engestrom
parent 34b1102390
commit 2fcae878de
2 changed files with 9 additions and 2 deletions

View file

@ -914,7 +914,7 @@
"description": "rusticl/memory: fix sampler argument size check",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -365,7 +365,14 @@ fn set_kernel_arg(
return Err(CL_INVALID_ARG_SIZE);
}
}
_ => {
KernelArgType::Sampler => {
if arg_size != std::mem::size_of::<cl_sampler>() {
return Err(CL_INVALID_ARG_SIZE);
}
}
KernelArgType::Constant => {
if arg.size != arg_size {
return Err(CL_INVALID_ARG_SIZE);
}