From 0cfcd2ff83acb8733f3fb0da56b5764fc268feec Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 11 Aug 2024 11:41:02 +0200 Subject: [PATCH] rusticl/memory: fix sampler argument size check Not entirely sure why this hasn't caused any problems... Cc: mesa-stable Part-of: --- src/gallium/frontends/rusticl/api/kernel.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/rusticl/api/kernel.rs b/src/gallium/frontends/rusticl/api/kernel.rs index c5ac9b43a2a..adcb6feddad 100644 --- a/src/gallium/frontends/rusticl/api/kernel.rs +++ b/src/gallium/frontends/rusticl/api/kernel.rs @@ -367,7 +367,14 @@ fn set_kernel_arg( return Err(CL_INVALID_ARG_SIZE); } } - _ => { + + KernelArgType::Sampler => { + if arg_size != std::mem::size_of::() { + return Err(CL_INVALID_ARG_SIZE); + } + } + + KernelArgType::Constant => { if arg.size != arg_size { return Err(CL_INVALID_ARG_SIZE); }