From 2b1a97b742e45bebf340cae1b122b5ed9b4720cb Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 20 Feb 2025 10:56:54 -0600 Subject: [PATCH] nak: Use MemScope::GPU instead of MemScop::System MemScope::System has to synchronize with everything in the system, including across PCIe so it's horribly slow. MemScope::GPU, on the other hand, only has to synchronize within the GPU. This is way faster and still satisfies all of Vulkan's requirements because Vulkan never allows CPU<->GPU access without full semaphores and barriers. Reviewed-by: Mel Henning Part-of: --- src/nouveau/compiler/nak/from_nir.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nouveau/compiler/nak/from_nir.rs b/src/nouveau/compiler/nak/from_nir.rs index af45fc59016..3c395074317 100644 --- a/src/nouveau/compiler/nak/from_nir.rs +++ b/src/nouveau/compiler/nak/from_nir.rs @@ -2326,7 +2326,7 @@ impl<'a> ShaderFromNir<'a> { atom_op: atom_op, atom_type: atom_type, image_dim: dim, - mem_order: MemOrder::Strong(MemScope::System), + mem_order: MemOrder::Strong(MemScope::GPU), mem_eviction_priority: self .get_eviction_priority(intrin.access()), }); @@ -2345,7 +2345,7 @@ impl<'a> ShaderFromNir<'a> { MemOrder::Weak } } else { - MemOrder::Strong(MemScope::System) + MemOrder::Strong(MemScope::GPU) }; let comps = intrin.num_components; @@ -2380,7 +2380,7 @@ impl<'a> ShaderFromNir<'a> { MemOrder::Weak } } else { - MemOrder::Strong(MemScope::System) + MemOrder::Strong(MemScope::GPU) }; let comps = intrin.num_components; @@ -2423,7 +2423,7 @@ impl<'a> ShaderFromNir<'a> { b.push_op(OpSuSt { image_dim: dim, - mem_order: MemOrder::Strong(MemScope::System), + mem_order: MemOrder::Strong(MemScope::GPU), mem_eviction_priority: self .get_eviction_priority(intrin.access()), mask: (1 << comps) - 1, @@ -2518,7 +2518,7 @@ impl<'a> ShaderFromNir<'a> { atom_type: atom_type, addr_offset: offset, mem_space: MemSpace::Global(MemAddrType::A64), - mem_order: MemOrder::Strong(MemScope::System), + mem_order: MemOrder::Strong(MemScope::GPU), mem_eviction_priority: MemEvictionPriority::Normal, // Note: no intrinic access }); self.set_dst(&intrin.def, dst); @@ -2543,7 +2543,7 @@ impl<'a> ShaderFromNir<'a> { atom_type: atom_type, addr_offset: offset, mem_space: MemSpace::Global(MemAddrType::A64), - mem_order: MemOrder::Strong(MemScope::System), + mem_order: MemOrder::Strong(MemScope::GPU), mem_eviction_priority: MemEvictionPriority::Normal, // Note: no intrinic access }); self.set_dst(&intrin.def, dst); @@ -2628,7 +2628,7 @@ impl<'a> ShaderFromNir<'a> { { MemOrder::Constant } else { - MemOrder::Strong(MemScope::System) + MemOrder::Strong(MemScope::GPU) }; let access = MemAccess { mem_type: MemType::from_size(size_B, false), @@ -3072,7 +3072,7 @@ impl<'a> ShaderFromNir<'a> { let access = MemAccess { mem_type: MemType::from_size(size_B, false), space: MemSpace::Global(MemAddrType::A64), - order: MemOrder::Strong(MemScope::System), + order: MemOrder::Strong(MemScope::GPU), eviction_priority: self .get_eviction_priority(intrin.access()), };