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>
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);