From edb8ac290e26f10fadb30bc726cb9d2ef3e0aab2 Mon Sep 17 00:00:00 2001 From: IndecisiveTurtle <47210458+raphaelthegreat@users.noreply.github.com> Date: Sun, 29 Jun 2025 00:04:27 +0300 Subject: [PATCH] resource_tracking: Mark image as written when its used with atomics --- src/shader_recompiler/ir/passes/resource_tracking_pass.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index e5a4beb8b..2cf39c98e 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -455,11 +455,12 @@ void PatchImageSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors& // Read image sharp. const auto tsharp = TrackSharp(tsharp_handle, info); const auto inst_info = inst.Flags(); - const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite; + const bool is_atomic = IsImageAtomicInstruction(inst); + const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite || is_atomic; const ImageResource image_res = { .sharp_idx = tsharp, .is_depth = bool(inst_info.is_depth), - .is_atomic = IsImageAtomicInstruction(inst), + .is_atomic = is_atomic, .is_array = bool(inst_info.is_array), .is_written = is_written, .is_r128 = bool(inst_info.is_r128),