mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 20:36:16 +00:00
shader_recompiler: Remove AMD native CubeFaceCoord. (#2129)
This commit is contained in:
parent
5810c88c00
commit
82cb298c5c
6 changed files with 10 additions and 37 deletions
|
@ -1083,19 +1083,13 @@ void Translator::V_CUBESC_F32(const GcnInst& inst) {
|
|||
const auto y = GetSrc<IR::F32>(inst.src[1]);
|
||||
const auto z = GetSrc<IR::F32>(inst.src[2]);
|
||||
|
||||
IR::F32 result;
|
||||
if (profile.supports_native_cube_calc) {
|
||||
const auto coords{ir.CubeFaceCoord(ir.CompositeConstruct(x, y, z))};
|
||||
result = IR::F32{ir.CompositeExtract(coords, 0)};
|
||||
} else {
|
||||
const auto x_neg_cond{ir.FPLessThan(x, ir.Imm32(0.f))};
|
||||
const auto z_neg_cond{ir.FPLessThan(z, ir.Imm32(0.f))};
|
||||
const IR::F32 x_sc{ir.Select(x_neg_cond, z, ir.FPNeg(z))};
|
||||
const IR::F32 y_sc{x};
|
||||
const IR::F32 z_sc{ir.Select(z_neg_cond, ir.FPNeg(x), x)};
|
||||
const auto x_neg_cond{ir.FPLessThan(x, ir.Imm32(0.f))};
|
||||
const auto z_neg_cond{ir.FPLessThan(z, ir.Imm32(0.f))};
|
||||
const IR::F32 x_sc{ir.Select(x_neg_cond, z, ir.FPNeg(z))};
|
||||
const IR::F32 y_sc{x};
|
||||
const IR::F32 z_sc{ir.Select(z_neg_cond, ir.FPNeg(x), x)};
|
||||
|
||||
result = SelectCubeResult(x, y, z, x_sc, y_sc, z_sc);
|
||||
}
|
||||
const auto result{SelectCubeResult(x, y, z, x_sc, y_sc, z_sc)};
|
||||
SetDst(inst.dst[0], result);
|
||||
}
|
||||
|
||||
|
@ -1104,17 +1098,11 @@ void Translator::V_CUBETC_F32(const GcnInst& inst) {
|
|||
const auto y = GetSrc<IR::F32>(inst.src[1]);
|
||||
const auto z = GetSrc<IR::F32>(inst.src[2]);
|
||||
|
||||
IR::F32 result;
|
||||
if (profile.supports_native_cube_calc) {
|
||||
const auto coords{ir.CubeFaceCoord(ir.CompositeConstruct(x, y, z))};
|
||||
result = IR::F32{ir.CompositeExtract(coords, 1)};
|
||||
} else {
|
||||
const auto y_neg_cond{ir.FPLessThan(y, ir.Imm32(0.f))};
|
||||
const IR::F32 x_z_tc{ir.FPNeg(y)};
|
||||
const IR::F32 y_tc{ir.Select(y_neg_cond, ir.FPNeg(z), z)};
|
||||
const auto y_neg_cond{ir.FPLessThan(y, ir.Imm32(0.f))};
|
||||
const IR::F32 x_z_tc{ir.FPNeg(y)};
|
||||
const IR::F32 y_tc{ir.Select(y_neg_cond, ir.FPNeg(z), z)};
|
||||
|
||||
result = SelectCubeResult(x, y, z, x_z_tc, y_tc, x_z_tc);
|
||||
}
|
||||
const auto result{SelectCubeResult(x, y, z, x_z_tc, y_tc, x_z_tc)};
|
||||
SetDst(inst.dst[0], result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue