Skip to content

Commit a5efe3e

Browse files
authored
Another Baldness Workaround shadps4-emu#2025
1 parent 4c84de4 commit a5efe3e

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/shader_recompiler/ir/passes/resource_tracking_pass.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -545,18 +545,9 @@ void PatchTextureBufferArgs(IR::Block& block, IR::Inst& inst, Info& info) {
545545
ASSERT(!buffer.swizzle_enable && !buffer.add_tid_enable);
546546
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};
547547

548-
if (inst.GetOpcode() == IR::Opcode::StoreBufferFormatF32) {
549-
const auto swizzled = ApplySwizzle(ir, inst.Arg(2), buffer.DstSelect());
550-
const auto converted =
551-
ApplyWriteNumberConversionVec4(ir, swizzled, buffer.GetNumberConversion());
552-
inst.SetArg(2, converted);
553-
} else if (inst.GetOpcode() == IR::Opcode::LoadBufferFormatF32) {
548+
if (inst.GetOpcode() == IR::Opcode::LoadBufferFormatF32) {
554549
const auto inst_info = inst.Flags<IR::BufferInstInfo>();
555550
const auto texel = ir.LoadBufferFormat(inst.Arg(0), inst.Arg(1), inst_info);
556-
const auto swizzled = ApplySwizzle(ir, texel, buffer.DstSelect());
557-
const auto converted =
558-
ApplyReadNumberConversionVec4(ir, swizzled, buffer.GetNumberConversion());
559-
inst.ReplaceUsesWith(converted);
560551
}
561552
}
562553

@@ -825,7 +816,6 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
825816
auto texel = ir.ImageRead(handle, coords, lod, ms, inst_info);
826817
if (is_storage) {
827818
// Storage image requires shader swizzle.
828-
texel = ApplySwizzle(ir, texel, image.DstSelect());
829819
}
830820
const auto converted =
831821
ApplyReadNumberConversionVec4(ir, texel, image.GetNumberConversion());
@@ -839,7 +829,6 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
839829
auto texel = inst.Arg(4);
840830
if (is_storage) {
841831
// Storage image requires shader swizzle.
842-
texel = ApplySwizzle(ir, texel, image.DstSelect());
843832
}
844833
const auto converted =
845834
ApplyWriteNumberConversionVec4(ir, texel, image.GetNumberConversion());
@@ -882,4 +871,4 @@ void ResourceTrackingPass(IR::Program& program) {
882871
}
883872
}
884873

885-
} // namespace Shader::Optimization
874+
} // namespace Shader::Optimization

0 commit comments

Comments
 (0)