rusticl/program: add clc_validator_options helper function

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27204>
This commit is contained in:
Karol Herbst
2024-01-22 21:05:23 +01:00
committed by Marge Bot
parent 421b73207c
commit 6e70699e24

View File

@@ -59,6 +59,13 @@ fn get_disk_cache() -> &'static Option<DiskCache> {
}
}
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 {