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>
This commit is contained in:
Karol Herbst 2024-08-11 11:41:02 +02:00 committed by Marge Bot
parent 1cad339409
commit 0cfcd2ff83

View file

@ -367,7 +367,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);
}