From e927af2141ce1bcfbf87c1f62fcde26d7ebf65d7 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sun, 14 Dec 2025 17:43:12 +0100 Subject: [PATCH] vulkan: don't swap order of texture operations --- src/gfx_apis/vulkan/renderer.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gfx_apis/vulkan/renderer.rs b/src/gfx_apis/vulkan/renderer.rs index cd0cf29d..360b18b1 100644 --- a/src/gfx_apis/vulkan/renderer.rs +++ b/src/gfx_apis/vulkan/renderer.rs @@ -201,6 +201,7 @@ enum VulkanOp { struct VulkanTexOp { tex: Rc, + index: usize, range: Range, buffer_resv: Option>, acquire_sync: Option, @@ -719,13 +720,13 @@ impl VulkanRenderer { #[derive(Eq, PartialEq, PartialOrd, Ord)] enum Key { Fill { color: [u32; 4] }, - Tex, + Tex(usize), } match o { VulkanOp::Fill(f) => Key::Fill { color: f.color.map(|c| c.to_bits()), }, - VulkanOp::Tex(_) => Key::Tex, + VulkanOp::Tex(t) => Key::Tex(t.index), } }); let mops = &mut memory.ops[pass]; @@ -765,7 +766,7 @@ impl VulkanRenderer { } } }; - for op in opts { + for (index, op) in opts.into_iter().enumerate() { match op { GfxApiOpt::Sync => { sync(memory); @@ -874,6 +875,7 @@ impl VulkanRenderer { ); ops.push(VulkanOp::Tex(VulkanTexOp { tex: tex.clone(), + index, range: lo..hi, buffer_resv: ct.buffer_resv.clone(), acquire_sync: Some(ct.acquire_sync.clone()),