|
|
@ -428,19 +428,15 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { |
|
|
if (!swizzle.IsImmediate()) { |
|
|
if (!swizzle.IsImmediate()) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const IR::Value value_1{GetThroughCast(inst.Arg(0).Resolve(), IR::Opcode::BitCastF32U32)}; |
|
|
const IR::Value value_1{GetThroughCast(inst.Arg(0).Resolve(), IR::Opcode::BitCastF32U32)}; |
|
|
const IR::Value value_2{GetThroughCast(inst.Arg(1).Resolve(), IR::Opcode::BitCastF32U32)}; |
|
|
const IR::Value value_2{GetThroughCast(inst.Arg(1).Resolve(), IR::Opcode::BitCastF32U32)}; |
|
|
|
|
|
|
|
|
if (value_1.IsImmediate()) { |
|
|
if (value_1.IsImmediate()) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const u32 swizzle_value{swizzle.U32()}; |
|
|
const u32 swizzle_value{swizzle.U32()}; |
|
|
if (swizzle_value != 0x99 && swizzle_value != 0xA5) { |
|
|
if (swizzle_value != 0x99 && swizzle_value != 0xA5) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
IR::Inst* const inst2{value_1.InstRecursive()}; |
|
|
IR::Inst* const inst2{value_1.InstRecursive()}; |
|
|
if (inst2->GetOpcode() != IR::Opcode::ShuffleButterfly) { |
|
|
if (inst2->GetOpcode() != IR::Opcode::ShuffleButterfly) { |
|
|
return; |
|
|
return; |
|
|
@ -449,19 +445,15 @@ void FoldFSwizzleAdd(IR::Block& block, IR::Inst& inst) { |
|
|
if (value_2 != value_3) { |
|
|
if (value_2 != value_3) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const IR::Value index{inst2->Arg(1)}; |
|
|
const IR::Value index{inst2->Arg(1)}; |
|
|
const IR::Value clamp{inst2->Arg(2)}; |
|
|
const IR::Value clamp{inst2->Arg(2)}; |
|
|
const IR::Value segmentation_mask{inst2->Arg(3)}; |
|
|
const IR::Value segmentation_mask{inst2->Arg(3)}; |
|
|
|
|
|
|
|
|
if (!index.IsImmediate() || !clamp.IsImmediate() || !segmentation_mask.IsImmediate()) { |
|
|
if (!index.IsImmediate() || !clamp.IsImmediate() || !segmentation_mask.IsImmediate()) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (clamp.U32() != 3 || segmentation_mask.U32() != 28) { |
|
|
if (clamp.U32() != 3 || segmentation_mask.U32() != 28) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (swizzle_value == 0x99) { |
|
|
if (swizzle_value == 0x99) { |
|
|
// DPdxFine
|
|
|
// DPdxFine
|
|
|
if (index.U32() == 1) { |
|
|
if (index.U32() == 1) { |
|
|
|