diff --git a/src/shader_recompiler/info.h b/src/shader_recompiler/info.h index 91256085..f9cbacaf 100644 --- a/src/shader_recompiler/info.h +++ b/src/shader_recompiler/info.h @@ -87,8 +87,7 @@ struct SamplerResource { using SamplerResourceList = boost::container::small_vector; struct FMaskResource { - u32 sgpr_base; - u32 dword_offset; + u32 sharp_idx; constexpr AmdGpu::Image GetSharp(const Info& info) const noexcept; }; @@ -292,7 +291,7 @@ constexpr AmdGpu::Sampler SamplerResource::GetSharp(const Info& info) const noex } constexpr AmdGpu::Image FMaskResource::GetSharp(const Info& info) const noexcept { - return info.ReadUd(sgpr_base, dword_offset); + return info.ReadUdSharp(sharp_idx); } } // namespace Shader diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index 9468f80a..586785e6 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -185,8 +185,7 @@ public: u32 Add(const FMaskResource& desc) { u32 index = Add(fmask_resources, desc, [&desc](const auto& existing) { - return desc.sgpr_base == existing.sgpr_base && - desc.dword_offset == existing.dword_offset; + return desc.sharp_idx == existing.sharp_idx; }); return index; } @@ -652,8 +651,7 @@ void PatchImageInstruction(IR::Block& block, IR::Inst& inst, Info& info, Descrip // Track FMask resource to do specialization. descriptors.Add(FMaskResource{ - .sgpr_base = tsharp.sgpr_base, - .dword_offset = tsharp.dword_offset, + .sharp_idx = tsharp, }); return; }