diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 336678b4d30..1e34a7fc47a 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -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); diff --git a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs index c72132b1ac5..90bf7c90000 100644 --- a/src/gallium/frontends/rusticl/mesa/compiler/nir.rs +++ b/src/gallium/frontends/rusticl/mesa/compiler/nir.rs @@ -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,