@@ -545,18 +545,9 @@ void PatchTextureBufferArgs(IR::Block& block, IR::Inst& inst, Info& info) {
545
545
ASSERT (!buffer.swizzle_enable && !buffer.add_tid_enable );
546
546
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to (inst)};
547
547
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) {
554
549
const auto inst_info = inst.Flags <IR::BufferInstInfo>();
555
550
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);
560
551
}
561
552
}
562
553
@@ -825,7 +816,6 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
825
816
auto texel = ir.ImageRead (handle, coords, lod, ms, inst_info);
826
817
if (is_storage) {
827
818
// Storage image requires shader swizzle.
828
- texel = ApplySwizzle (ir, texel, image.DstSelect ());
829
819
}
830
820
const auto converted =
831
821
ApplyReadNumberConversionVec4 (ir, texel, image.GetNumberConversion ());
@@ -839,7 +829,6 @@ void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) {
839
829
auto texel = inst.Arg (4 );
840
830
if (is_storage) {
841
831
// Storage image requires shader swizzle.
842
- texel = ApplySwizzle (ir, texel, image.DstSelect ());
843
832
}
844
833
const auto converted =
845
834
ApplyWriteNumberConversionVec4 (ir, texel, image.GetNumberConversion ());
@@ -882,4 +871,4 @@ void ResourceTrackingPass(IR::Program& program) {
882
871
}
883
872
}
884
873
885
- } // namespace Shader::Optimization
874
+ } // namespace Shader::Optimization
0 commit comments