From 14d749f13d67a220146c2a3cc0ce3c3bcca8c670 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 2 May 2024 11:27:02 -0500 Subject: [PATCH] nak: Don't saturate depth writes This is unnecessary in Vulkan and prevents unrestricted depth. Part-of: --- src/nouveau/compiler/nak/from_nir.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/nouveau/compiler/nak/from_nir.rs b/src/nouveau/compiler/nak/from_nir.rs index 303aa6d2b4f27..0d807d74e37fc 100644 --- a/src/nouveau/compiler/nak/from_nir.rs +++ b/src/nouveau/compiler/nak/from_nir.rs @@ -2265,20 +2265,7 @@ impl<'a> ShaderFromNir<'a> { srcs.push(b.undef().into()); } if info.writes_depth { - // Saturate depth writes. - // - // TODO: This seems wrong in light of unrestricted depth - // but it's needed to pass CTS tests for now. - let depth = self.fs_out_regs[depth_idx]; - let sat_depth = b.alloc_ssa(RegFile::GPR, 1); - b.push_op(OpFAdd { - dst: sat_depth.into(), - srcs: [depth.into(), 0.into()], - saturate: true, - rnd_mode: FRndMode::NearestEven, - ftz: false, - }); - srcs.push(sat_depth.into()); + srcs.push(self.fs_out_regs[depth_idx].into()); } }