rusticl: correctly check global argument size
As the spec that is quoted in the comment says, if the argument is a memory object, arg_size should be different than sizeof(cl_mem). The previous verification only worked if the underlying type has the same size as sizeof(cl_mem). Signed-off-by: Italo Nicola <italonicola@collabora.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18985>
This commit is contained in:
@@ -240,6 +240,11 @@ pub fn set_kernel_arg(
|
||||
return Err(CL_INVALID_ARG_SIZE);
|
||||
}
|
||||
}
|
||||
KernelArgType::MemGlobal => {
|
||||
if arg_size != std::mem::size_of::<cl_mem>() {
|
||||
return Err(CL_INVALID_ARG_SIZE);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if arg.size != arg_size {
|
||||
return Err(CL_INVALID_ARG_SIZE);
|
||||
|
Reference in New Issue
Block a user