From a3b4401fe67bc7a6915ec198f3f0b0fd6810fc45 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 30 May 2025 14:56:08 -0400 Subject: [PATCH] nak: Handle MemScope::System on Kepler We never actually create any MemScope::System instructions anymore, but it's worth handling it now just so we don't forget. Reviewed-by: Mel Henning Part-of: --- src/nouveau/compiler/nak/ir.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/nouveau/compiler/nak/ir.rs b/src/nouveau/compiler/nak/ir.rs index 7212c7a966c..3b3c46a5cac 100644 --- a/src/nouveau/compiler/nak/ir.rs +++ b/src/nouveau/compiler/nak/ir.rs @@ -2322,6 +2322,9 @@ impl LdCacheOp { // We assume that CacheAll is also safe for shared memory. MemSpace::Global(_) => match order { MemOrder::Constant => LdCacheOp::CacheAll, + MemOrder::Strong(MemScope::System) => { + LdCacheOp::CacheInvalidate + } _ => LdCacheOp::CacheGlobal, }, MemSpace::Local | MemSpace::Shared => LdCacheOp::CacheAll, @@ -2355,11 +2358,17 @@ impl StCacheOp { pub fn select( _sm: &dyn ShaderModel, space: MemSpace, - _order: MemOrder, + order: MemOrder, _eviction_priority: MemEvictionPriority, ) -> Self { match space { - MemSpace::Global(_) => StCacheOp::CacheGlobal, + MemSpace::Global(_) => match order { + MemOrder::Constant => panic!("Cannot store to constant"), + MemOrder::Strong(MemScope::System) => { + StCacheOp::WriteThrough + } + _ => StCacheOp::CacheGlobal, + }, MemSpace::Local | MemSpace::Shared => StCacheOp::WriteBack, } }