rusticl/kernel: preserve fp16 denorms to fix vload/vstore_half

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19041>
This commit is contained in:
Karol Herbst 2022-10-12 23:43:22 +02:00 committed by Marge Bot
parent 5fa7c53631
commit 1c86a5f309
2 changed files with 12 additions and 0 deletions

View file

@ -623,6 +623,11 @@ fn convert_spirv_to_nir(
} else {
let mut nir = p.to_nir(name, d);
/* this is a hack until we support fp16 properly and check for denorms inside
* vstore/vload_half
*/
nir.preserve_fp16_denorms();
lower_and_optimize_nir_pre_inputs(d, &mut nir, &d.lib_clc);
let mut args = KernelArg::from_spirv_nir(&args, &mut nir);
let internal_args = lower_and_optimize_nir_late(d, &mut nir, &mut args);

View file

@ -254,6 +254,13 @@ impl NirShader {
}
}
pub fn preserve_fp16_denorms(&mut self) {
unsafe {
self.nir.as_mut().info.float_controls_execution_mode |=
float_controls::FLOAT_CONTROLS_DENORM_PRESERVE_FP16 as u16;
}
}
pub fn add_var(
&self,
mode: nir_variable_mode,