From 4d8d6a28c8ea533cc8959694805fa845500399e6 Mon Sep 17 00:00:00 2001 From: Lorenzo Rossi Date: Sat, 19 Apr 2025 14:53:23 -0500 Subject: [PATCH] nak: Use s2r for SV_CLOCK on Kepler cs2r is new starting with Maxwell. Prior to that we need to use s2r which still works just fine, it's just slower. Part-of: --- src/nouveau/compiler/nak/from_nir.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nouveau/compiler/nak/from_nir.rs b/src/nouveau/compiler/nak/from_nir.rs index 40921d90c29..9e209665a38 100644 --- a/src/nouveau/compiler/nak/from_nir.rs +++ b/src/nouveau/compiler/nak/from_nir.rs @@ -2982,7 +2982,9 @@ impl<'a> ShaderFromNir<'a> { ); let comps = intrin.def.bit_size / 32; let dst = b.alloc_ssa(RegFile::GPR, comps); - if idx == NAK_SV_CLOCK || idx == NAK_SV_CLOCK + 1 { + if self.sm.sm() >= 50 + && (idx == NAK_SV_CLOCK || idx == NAK_SV_CLOCK + 1) + { debug_assert!(idx + comps <= NAK_SV_CLOCK + 2); b.push_op(OpCS2R { dst: dst.into(),