From 6e70699e24ad7c06e43ba856cec9371f142ebaf2 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Mon, 22 Jan 2024 21:05:23 +0100 Subject: [PATCH] rusticl/program: add clc_validator_options helper function Part-of: --- src/gallium/frontends/rusticl/core/program.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/frontends/rusticl/core/program.rs b/src/gallium/frontends/rusticl/core/program.rs index eeb9c113538..1f81df429bb 100644 --- a/src/gallium/frontends/rusticl/core/program.rs +++ b/src/gallium/frontends/rusticl/core/program.rs @@ -59,6 +59,13 @@ fn get_disk_cache() -> &'static Option { } } +fn clc_validator_options(dev: &Device) -> clc_validator_options { + clc_validator_options { + // has to match CL_DEVICE_MAX_PARAMETER_SIZE + limit_max_function_arg: dev.param_max_size() as u32, + } +} + pub enum ProgramSourceType { Binary, Linked, @@ -603,10 +610,7 @@ impl Program { let (spirv, log) = match &self.src { ProgramSourceType::Il(spirv) => { - let options = clc_validator_options { - // has to match CL_DEVICE_MAX_PARAMETER_SIZE - limit_max_function_arg: dev.param_max_size() as u32, - }; + let options = clc_validator_options(dev); if Platform::dbg().allow_invalid_spirv { (Some(spirv.clone()), String::new()) } else {