From 2fcae878de789d37430d389324b95f55e17f5cd1 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: (cherry picked from commit 0cfcd2ff83acb8733f3fb0da56b5764fc268feec) --- .pick_status.json | 2 +- src/gallium/frontends/rusticl/api/kernel.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index a9d6d3d7748..e8da2560613 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/gallium/frontends/rusticl/api/kernel.rs b/src/gallium/frontends/rusticl/api/kernel.rs index bdab3e207e4..9520e5a8725 100644 --- a/src/gallium/frontends/rusticl/api/kernel.rs +++ b/src/gallium/frontends/rusticl/api/kernel.rs @@ -365,7 +365,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); }