Fix ambiguous uses of format_to

At least in MSVC (which is not restricted from targetting C++20), these can be resolved to either std::format_to or fmt::format_to (though I'm not sure why the std one is available).  We want the latter.
This commit is contained in:
Pokechu22 2022-01-12 22:52:21 -08:00
parent ac46b91673
commit 5465775d11
6 changed files with 377 additions and 368 deletions

View File

@ -369,7 +369,7 @@ struct fmt::formatter<IND_MTXA>
template <typename FormatContext>
auto format(const IND_MTXA& col, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Row 0 (ma): {} ({})\n"
"Row 1 (mb): {} ({})\n"
"Scale bits: {} (shifted: {})",
@ -391,7 +391,7 @@ struct fmt::formatter<IND_MTXB>
template <typename FormatContext>
auto format(const IND_MTXB& col, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Row 0 (mc): {} ({})\n"
"Row 1 (md): {} ({})\n"
"Scale bits: {} (shifted: {})",
@ -416,7 +416,7 @@ struct fmt::formatter<IND_MTXC>
template <typename FormatContext>
auto format(const IND_MTXC& col, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Row 0 (me): {} ({})\n"
"Row 1 (mf): {} ({})\n"
"Scale bits: {} (shifted: {}), given to SDK as {} ({})",
@ -517,69 +517,69 @@ struct fmt::formatter<TevStageCombiner::ColorCombiner>
const char op = (cc.op == TevOp::Sub ? '-' : '+');
if (cc.dest == TevOutput::Prev)
out = format_to(out, "dest.rgb = ");
out = fmt::format_to(out, "dest.rgb = ");
else
out = format_to(out, "{:n}.rgb = ", cc.dest);
out = fmt::format_to(out, "{:n}.rgb = ", cc.dest);
if (has_scale)
out = format_to(out, "(");
out = fmt::format_to(out, "(");
if (has_d)
out = format_to(out, "{}", alt_names[cc.d]);
out = fmt::format_to(out, "{}", alt_names[cc.d]);
if (has_ac || has_bc)
{
if (has_d)
out = format_to(out, " {} ", op);
out = fmt::format_to(out, " {} ", op);
else if (cc.op == TevOp::Sub)
out = format_to(out, "{}", op);
out = fmt::format_to(out, "{}", op);
if (has_ac && has_bc)
{
if (cc.c == TevColorArg::Half)
{
// has_a and has_b imply that c is not Zero or One, and Half is the only remaining
// numeric constant. This results in an average.
out = format_to(out, "({} + {})/2", alt_names[cc.a], alt_names[cc.b]);
out = fmt::format_to(out, "({} + {})/2", alt_names[cc.a], alt_names[cc.b]);
}
else
{
out = format_to(out, "lerp({}, {}, {})", alt_names[cc.a], alt_names[cc.b],
out = fmt::format_to(out, "lerp({}, {}, {})", alt_names[cc.a], alt_names[cc.b],
alt_names[cc.c]);
}
}
else if (has_ac)
{
if (cc.c == TevColorArg::Zero)
out = format_to(out, "{}", alt_names[cc.a]);
out = fmt::format_to(out, "{}", alt_names[cc.a]);
else if (cc.c == TevColorArg::Half) // 1 - .5 is .5
out = format_to(out, ".5*{}", alt_names[cc.a]);
out = fmt::format_to(out, ".5*{}", alt_names[cc.a]);
else
out = format_to(out, "(1 - {})*{}", alt_names[cc.c], alt_names[cc.a]);
out = fmt::format_to(out, "(1 - {})*{}", alt_names[cc.c], alt_names[cc.a]);
}
else // has_bc
{
if (cc.c == TevColorArg::One)
out = format_to(out, "{}", alt_names[cc.b]);
out = fmt::format_to(out, "{}", alt_names[cc.b]);
else
out = format_to(out, "{}*{}", alt_names[cc.c], alt_names[cc.b]);
out = fmt::format_to(out, "{}*{}", alt_names[cc.c], alt_names[cc.b]);
}
}
if (has_bias)
{
if (has_ac || has_bc || has_d)
out = format_to(out, cc.bias == TevBias::AddHalf ? " + .5" : " - .5");
out = fmt::format_to(out, cc.bias == TevBias::AddHalf ? " + .5" : " - .5");
else
out = format_to(out, cc.bias == TevBias::AddHalf ? ".5" : "-.5");
out = fmt::format_to(out, cc.bias == TevBias::AddHalf ? ".5" : "-.5");
}
else
{
// If nothing has been written so far, add a zero
if (!(has_ac || has_bc || has_d))
out = format_to(out, "0");
out = fmt::format_to(out, "0");
}
if (has_scale)
out = format_to(out, ") * {:n}", cc.scale);
out = format_to(out, "\n\n");
out = fmt::format_to(out, ") * {:n}", cc.scale);
out = fmt::format_to(out, "\n\n");
}
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"a: {}\n"
"b: {}\n"
"c: {}\n"
@ -589,8 +589,8 @@ struct fmt::formatter<TevStageCombiner::ColorCombiner>
"Clamp: {}\n"
"Scale factor: {} / Compare mode: {}\n"
"Dest: {}",
cc.a, cc.b, cc.c, cc.d, cc.bias, cc.op, cc.comparison, cc.clamp ? "Yes" : "No",
cc.scale, cc.compare_mode, cc.dest);
cc.a, cc.b, cc.c, cc.d, cc.bias, cc.op, cc.comparison,
cc.clamp ? "Yes" : "No", cc.scale, cc.compare_mode, cc.dest);
}
};
template <>
@ -626,54 +626,54 @@ struct fmt::formatter<TevStageCombiner::AlphaCombiner>
const char op = (ac.op == TevOp::Sub ? '-' : '+');
if (ac.dest == TevOutput::Prev)
out = format_to(out, "dest.a = ");
out = fmt::format_to(out, "dest.a = ");
else
out = format_to(out, "{:n}.a = ", ac.dest);
out = fmt::format_to(out, "{:n}.a = ", ac.dest);
if (has_scale)
out = format_to(out, "(");
out = fmt::format_to(out, "(");
if (has_d)
out = format_to(out, "{:n}.a", ac.d);
out = fmt::format_to(out, "{:n}.a", ac.d);
if (has_ac || has_bc)
{
if (has_d)
out = format_to(out, " {} ", op);
out = fmt::format_to(out, " {} ", op);
else if (ac.op == TevOp::Sub)
out = format_to(out, "{}", op);
out = fmt::format_to(out, "{}", op);
if (has_ac && has_bc)
{
out = format_to(out, "lerp({:n}.a, {:n}.a, {:n}.a)", ac.a, ac.b, ac.c);
out = fmt::format_to(out, "lerp({:n}.a, {:n}.a, {:n}.a)", ac.a, ac.b, ac.c);
}
else if (has_ac)
{
if (ac.c == TevAlphaArg::Zero)
out = format_to(out, "{:n}.a", ac.a);
out = fmt::format_to(out, "{:n}.a", ac.a);
else
out = format_to(out, "(1 - {:n}.a)*{:n}.a", ac.c, ac.a);
out = fmt::format_to(out, "(1 - {:n}.a)*{:n}.a", ac.c, ac.a);
}
else // has_bc
{
out = format_to(out, "{:n}.a*{:n}.a", ac.c, ac.b);
out = fmt::format_to(out, "{:n}.a*{:n}.a", ac.c, ac.b);
}
}
if (has_bias)
{
if (has_ac || has_bc || has_d)
out = format_to(out, ac.bias == TevBias::AddHalf ? " + .5" : " - .5");
out = fmt::format_to(out, ac.bias == TevBias::AddHalf ? " + .5" : " - .5");
else
out = format_to(out, ac.bias == TevBias::AddHalf ? ".5" : "-.5");
out = fmt::format_to(out, ac.bias == TevBias::AddHalf ? ".5" : "-.5");
}
else
{
// If nothing has been written so far, add a zero
if (!(has_ac || has_bc || has_d))
out = format_to(out, "0");
out = fmt::format_to(out, "0");
}
if (has_scale)
out = format_to(out, ") * {:n}", ac.scale);
out = format_to(out, "\n\n");
out = fmt::format_to(out, ") * {:n}", ac.scale);
out = fmt::format_to(out, "\n\n");
}
return format_to(out,
return fmt::format_to(out,
"a: {}\n"
"b: {}\n"
"c: {}\n"
@ -685,8 +685,9 @@ struct fmt::formatter<TevStageCombiner::AlphaCombiner>
"Dest: {}\n"
"Ras sel: {}\n"
"Tex sel: {}",
ac.a, ac.b, ac.c, ac.d, ac.bias, ac.op, ac.comparison, ac.clamp ? "Yes" : "No",
ac.scale, ac.compare_mode, ac.dest, ac.rswap, ac.tswap);
ac.a, ac.b, ac.c, ac.d, ac.bias, ac.op, ac.comparison,
ac.clamp ? "Yes" : "No", ac.scale, ac.compare_mode, ac.dest, ac.rswap,
ac.tswap);
}
};
@ -739,7 +740,7 @@ struct fmt::formatter<TevStageIndirect>
template <typename FormatContext>
auto format(const TevStageIndirect& tevind, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Indirect tex stage ID: {}\n"
"Format: {}\n"
"Bias: {}\n"
@ -799,7 +800,7 @@ struct fmt::formatter<TwoTevStageOrders>
template <typename FormatContext>
auto format(const TwoTevStageOrders& stages, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Stage 0 texmap: {}\nStage 0 tex coord: {}\n"
"Stage 0 enable texmap: {}\nStage 0 color channel: {}\n"
"Stage 1 texmap: {}\nStage 1 tex coord: {}\n"
@ -825,7 +826,7 @@ struct fmt::formatter<TEXSCALE>
template <typename FormatContext>
auto format(const TEXSCALE& scale, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Even stage S scale: {} ({})\n"
"Even stage T scale: {} ({})\n"
"Odd stage S scale: {} ({})\n"
@ -858,7 +859,7 @@ struct fmt::formatter<RAS1_IREF>
auto format(const RAS1_IREF& indref, FormatContext& ctx) const
{
// The field names here are suspicious, since there is no bi3 or bc2
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Stage 0 ntexmap: {}\nStage 0 ntexcoord: {}\n"
"Stage 1 ntexmap: {}\nStage 1 ntexcoord: {}\n"
"Stage 2 ntexmap: {}\nStage 2 ntexcoord: {}\n"
@ -949,7 +950,7 @@ struct fmt::formatter<TexMode0>
template <typename FormatContext>
auto format(const TexMode0& mode, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Wrap S: {}\n"
"Wrap T: {}\n"
"Mag filter: {}\n"
@ -959,9 +960,9 @@ struct fmt::formatter<TexMode0>
"LOD bias: {} ({})\n"
"Max anisotropic filtering: {}\n"
"LOD/bias clamp: {}",
mode.wrap_s, mode.wrap_t, mode.mag_filter, mode.mipmap_filter, mode.min_filter,
mode.diag_lod, mode.lod_bias, mode.lod_bias / 32.f, mode.max_aniso,
mode.lod_clamp ? "Yes" : "No");
mode.wrap_s, mode.wrap_t, mode.mag_filter, mode.mipmap_filter,
mode.min_filter, mode.diag_lod, mode.lod_bias, mode.lod_bias / 32.f,
mode.max_aniso, mode.lod_clamp ? "Yes" : "No");
}
};
@ -978,7 +979,7 @@ struct fmt::formatter<TexMode1>
template <typename FormatContext>
auto format(const TexMode1& mode, FormatContext& ctx) const
{
return format_to(ctx.out(), "Min LOD: {} ({})\nMax LOD: {} ({})", mode.min_lod,
return fmt::format_to(ctx.out(), "Min LOD: {} ({})\nMax LOD: {} ({})", mode.min_lod,
mode.min_lod / 16.f, mode.max_lod, mode.max_lod / 16.f);
}
};
@ -997,7 +998,7 @@ struct fmt::formatter<TexImage0>
template <typename FormatContext>
auto format(const TexImage0& teximg, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Width: {}\n"
"Height: {}\n"
"Format: {}",
@ -1022,7 +1023,7 @@ struct fmt::formatter<TexImage1>
template <typename FormatContext>
auto format(const TexImage1& teximg, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Even TMEM Offset: {:x}\n"
"Even TMEM Width: {}\n"
"Even TMEM Height: {}\n"
@ -1046,7 +1047,7 @@ struct fmt::formatter<TexImage2>
template <typename FormatContext>
auto format(const TexImage2& teximg, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Odd TMEM Offset: {:x}\n"
"Odd TMEM Width: {}\n"
"Odd TMEM Height: {}",
@ -1066,7 +1067,7 @@ struct fmt::formatter<TexImage3>
template <typename FormatContext>
auto format(const TexImage3& teximg, FormatContext& ctx) const
{
return format_to(ctx.out(), "Source address (32 byte aligned): 0x{:06X}",
return fmt::format_to(ctx.out(), "Source address (32 byte aligned): 0x{:06X}",
teximg.image_base << 5);
}
};
@ -1084,7 +1085,7 @@ struct fmt::formatter<TexTLUT>
template <typename FormatContext>
auto format(const TexTLUT& tlut, FormatContext& ctx) const
{
return format_to(ctx.out(), "Address: {:08x}\nFormat: {}", tlut.tmem_offset << 9,
return fmt::format_to(ctx.out(), "Address: {:08x}\nFormat: {}", tlut.tmem_offset << 9,
tlut.tlut_format);
}
};
@ -1108,7 +1109,7 @@ struct fmt::formatter<ZTex2>
template <typename FormatContext>
auto format(const ZTex2& ztex2, FormatContext& ctx) const
{
return format_to(ctx.out(), "Type: {}\nOperation: {}", ztex2.type, ztex2.op);
return fmt::format_to(ctx.out(), "Type: {}\nOperation: {}", ztex2.type, ztex2.op);
}
};
@ -1155,7 +1156,7 @@ struct fmt::formatter<GenMode>
template <typename FormatContext>
auto format(const GenMode& mode, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Num tex gens: {}\n"
"Num color channels: {}\n"
"Unused bit: {}\n"
@ -1200,14 +1201,14 @@ struct fmt::formatter<LPSize>
template <typename FormatContext>
auto format(const LPSize& lp, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Line size: {} ({:.3} pixels)\n"
"Point size: {} ({:.3} pixels)\n"
"Line offset: {}\n"
"Point offset: {}\n"
"Adjust line aspect ratio: {}",
lp.linesize, lp.linesize / 6.f, lp.pointsize, lp.pointsize / 6.f, lp.lineoff,
lp.pointoff, lp.adjust_for_aspect_ratio);
lp.linesize, lp.linesize / 6.f, lp.pointsize, lp.pointsize / 6.f,
lp.lineoff, lp.pointoff, lp.adjust_for_aspect_ratio);
}
};
@ -1336,7 +1337,7 @@ struct fmt::formatter<BlendMode>
auto format(const BlendMode& mode, FormatContext& ctx) const
{
static constexpr std::array<const char*, 2> no_yes = {"No", "Yes"};
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Enable: {}\n"
"Logic ops: {}\n"
"Dither: {}\n"
@ -1368,7 +1369,7 @@ struct fmt::formatter<FogParam0>
template <typename FormatContext>
auto format(const FogParam0& param, FormatContext& ctx) const
{
return format_to(ctx.out(), "A value: {}\nMantissa: {}\nExponent: {}\nSign: {}",
return fmt::format_to(ctx.out(), "A value: {}\nMantissa: {}\nExponent: {}\nSign: {}",
param.FloatValue(), param.mant, param.exp, param.sign ? '-' : '+');
}
};
@ -1427,10 +1428,10 @@ struct fmt::formatter<FogParam3>
template <typename FormatContext>
auto format(const FogParam3& param, FormatContext& ctx) const
{
return format_to(ctx.out(),
"C value: {}\nMantissa: {}\nExponent: {}\nSign: {}\nProjection: {}\nFsel: {}",
param.FloatValue(), param.c_mant, param.c_exp, param.c_sign ? '-' : '+',
param.proj, param.fsel);
return fmt::format_to(
ctx.out(), "C value: {}\nMantissa: {}\nExponent: {}\nSign: {}\nProjection: {}\nFsel: {}",
param.FloatValue(), param.c_mant, param.c_exp, param.c_sign ? '-' : '+', param.proj,
param.fsel);
}
};
@ -1462,7 +1463,7 @@ struct fmt::formatter<FogRangeParams::RangeBase>
template <typename FormatContext>
auto format(const FogRangeParams::RangeBase& range, FormatContext& ctx) const
{
return format_to(ctx.out(), "Center: {}\nEnabled: {}", range.Center,
return fmt::format_to(ctx.out(), "Center: {}\nEnabled: {}", range.Center,
range.Enabled ? "Yes" : "No");
}
};
@ -1473,7 +1474,7 @@ struct fmt::formatter<FogRangeKElement>
template <typename FormatContext>
auto format(const FogRangeKElement& range, FormatContext& ctx) const
{
return format_to(ctx.out(), "High: {}\nLow: {}", range.HI, range.LO);
return fmt::format_to(ctx.out(), "High: {}\nLow: {}", range.HI, range.LO);
}
};
@ -1509,7 +1510,7 @@ struct fmt::formatter<FogParams::FogColor>
template <typename FormatContext>
auto format(const FogParams::FogColor& color, FormatContext& ctx) const
{
return format_to(ctx.out(), "Red: {}\nGreen: {}\nBlue: {}", color.r, color.g, color.b);
return fmt::format_to(ctx.out(), "Red: {}\nGreen: {}\nBlue: {}", color.r, color.g, color.b);
}
};
@ -1547,11 +1548,12 @@ struct fmt::formatter<ZMode>
template <typename FormatContext>
auto format(const ZMode& mode, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Enable test: {}\n"
"Compare function: {}\n"
"Enable updates: {}",
mode.testenable ? "Yes" : "No", mode.func, mode.updateenable ? "Yes" : "No");
mode.testenable ? "Yes" : "No", mode.func,
mode.updateenable ? "Yes" : "No");
}
};
@ -1568,7 +1570,7 @@ struct fmt::formatter<ConstantAlpha>
template <typename FormatContext>
auto format(const ConstantAlpha& c, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Enable: {}\n"
"Alpha value: {:02x}",
c.enable ? "Yes" : "No", c.alpha);
@ -1588,8 +1590,8 @@ struct fmt::formatter<FieldMode>
template <typename FormatContext>
auto format(const FieldMode& mode, FormatContext& ctx) const
{
return format_to(ctx.out(), "Adjust vertex tex LOD computation to account for interlacing: {}",
mode.texLOD);
return fmt::format_to(
ctx.out(), "Adjust vertex tex LOD computation to account for interlacing: {}", mode.texLOD);
}
};
@ -1618,7 +1620,7 @@ struct fmt::formatter<FieldMask>
template <typename FormatContext>
auto format(const FieldMask& mask, FormatContext& ctx) const
{
return format_to(ctx.out(), "Odd field: {}\nEven field: {}", mask.odd, mask.even);
return fmt::format_to(ctx.out(), "Odd field: {}\nEven field: {}", mask.odd, mask.even);
}
};
@ -1680,7 +1682,7 @@ struct fmt::formatter<PEControl>
template <typename FormatContext>
auto format(const PEControl& config, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"EFB pixel format: {}\n"
"Depth format: {}\n"
"Early depth test: {}",
@ -1707,7 +1709,7 @@ struct fmt::formatter<TCInfo>
template <typename FormatContext>
auto format(const TCInfo& info, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Scale: {}\n"
"Range bias: {}\n"
"Cylindric wrap: {}\n"
@ -1766,7 +1768,8 @@ struct fmt::formatter<TevReg::RA>
template <typename FormatContext>
auto format(const TevReg::RA& ra, FormatContext& ctx) const
{
return format_to(ctx.out(), "Type: {}\nAlpha: {:03x}\nRed: {:03x}", ra.type, ra.alpha, ra.red);
return fmt::format_to(ctx.out(), "Type: {}\nAlpha: {:03x}\nRed: {:03x}", ra.type, ra.alpha,
ra.red);
}
};
template <>
@ -1776,7 +1779,7 @@ struct fmt::formatter<TevReg::BG>
template <typename FormatContext>
auto format(const TevReg::BG& bg, FormatContext& ctx) const
{
return format_to(ctx.out(), "Type: {}\nGreen: {:03x}\nBlue: {:03x}", bg.type, bg.green,
return fmt::format_to(ctx.out(), "Type: {}\nGreen: {:03x}\nBlue: {:03x}", bg.type, bg.green,
bg.blue);
}
};
@ -1787,7 +1790,7 @@ struct fmt::formatter<TevReg>
template <typename FormatContext>
auto format(const TevReg& reg, FormatContext& ctx) const
{
return format_to(ctx.out(), "{}\n{}", reg.ra, reg.bg);
return fmt::format_to(ctx.out(), "{}\n{}", reg.ra, reg.bg);
}
};
@ -1883,10 +1886,11 @@ struct fmt::formatter<TevKSel>
template <typename FormatContext>
auto format(const TevKSel& ksel, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Swap 1: {}\nSwap 2: {}\nColor sel 0: {}\nAlpha sel 0: {}\n"
"Color sel 1: {}\nAlpha sel 1: {}",
ksel.swap1, ksel.swap2, ksel.kcsel0, ksel.kasel0, ksel.kcsel1, ksel.kasel1);
ksel.swap1, ksel.swap2, ksel.kcsel0, ksel.kasel0, ksel.kcsel1,
ksel.kasel1);
}
};
@ -1969,7 +1973,7 @@ struct fmt::formatter<AlphaTest>
template <typename FormatContext>
auto format(const AlphaTest& test, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Test 1: {} (ref: 0x{:02x})\n"
"Test 2: {} (ref: 0x{:02x})\n"
"Logic: {}\n",
@ -2054,7 +2058,7 @@ struct fmt::formatter<UPE_Copy>
break;
}
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Clamping: {}\n"
"Converting from RGB to YUV: {}\n"
"Target pixel format: {}\n"
@ -2066,9 +2070,10 @@ struct fmt::formatter<UPE_Copy>
"Copy to XFB: {}\n"
"Intensity format: {}\n"
"Automatic color conversion: {}",
clamp, no_yes[copy.yuv], copy.tp_realFormat(), gamma, no_yes[copy.half_scale],
no_yes[copy.scale_invert], no_yes[copy.clear], copy.frame_to_field,
no_yes[copy.copy_to_xfb], no_yes[copy.intensity_fmt], no_yes[copy.auto_conv]);
clamp, no_yes[copy.yuv], copy.tp_realFormat(), gamma,
no_yes[copy.half_scale], no_yes[copy.scale_invert], no_yes[copy.clear],
copy.frame_to_field, no_yes[copy.copy_to_xfb], no_yes[copy.intensity_fmt],
no_yes[copy.auto_conv]);
}
};
@ -2113,7 +2118,7 @@ struct fmt::formatter<BPU_PreloadTileInfo>
template <typename FormatContext>
auto format(const BPU_PreloadTileInfo& info, FormatContext& ctx) const
{
return format_to(ctx.out(), "Type: {}\nCount: {}", info.type, info.count);
return fmt::format_to(ctx.out(), "Type: {}\nCount: {}", info.type, info.count);
}
};

View File

@ -263,7 +263,8 @@ struct fmt::formatter<TVtxDesc::Low>
{
static constexpr std::array<const char*, 2> present = {"Not present", "Present"};
return format_to(ctx.out(),
return fmt::format_to(
ctx.out(),
"Position and normal matrix index: {}\n"
"Texture Coord 0 matrix index: {}\n"
"Texture Coord 1 matrix index: {}\n"
@ -279,8 +280,8 @@ struct fmt::formatter<TVtxDesc::Low>
"Color 1: {}",
present[desc.PosMatIdx], present[desc.Tex0MatIdx], present[desc.Tex1MatIdx],
present[desc.Tex2MatIdx], present[desc.Tex3MatIdx], present[desc.Tex4MatIdx],
present[desc.Tex5MatIdx], present[desc.Tex6MatIdx], present[desc.Tex7MatIdx],
desc.Position, desc.Normal, desc.Color0, desc.Color1);
present[desc.Tex5MatIdx], present[desc.Tex6MatIdx], present[desc.Tex7MatIdx], desc.Position,
desc.Normal, desc.Color0, desc.Color1);
}
};
template <>
@ -290,7 +291,7 @@ struct fmt::formatter<TVtxDesc::High>
template <typename FormatContext>
auto format(const TVtxDesc::High& desc, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Texture Coord 0: {}\n"
"Texture Coord 1: {}\n"
"Texture Coord 2: {}\n"
@ -299,8 +300,8 @@ struct fmt::formatter<TVtxDesc::High>
"Texture Coord 5: {}\n"
"Texture Coord 6: {}\n"
"Texture Coord 7: {}",
desc.Tex0Coord, desc.Tex1Coord, desc.Tex2Coord, desc.Tex3Coord, desc.Tex4Coord,
desc.Tex5Coord, desc.Tex6Coord, desc.Tex7Coord);
desc.Tex0Coord, desc.Tex1Coord, desc.Tex2Coord, desc.Tex3Coord,
desc.Tex4Coord, desc.Tex5Coord, desc.Tex6Coord, desc.Tex7Coord);
}
};
template <>
@ -310,7 +311,7 @@ struct fmt::formatter<TVtxDesc>
template <typename FormatContext>
auto format(const TVtxDesc& desc, FormatContext& ctx) const
{
return format_to(ctx.out(), "{}\n{}", desc.low, desc.high);
return fmt::format_to(ctx.out(), "{}\n{}", desc.low, desc.high);
}
};
@ -350,7 +351,7 @@ struct fmt::formatter<UVAT_group0>
static constexpr std::array<const char*, 2> normalindex3 = {"single index per normal",
"triple-index per nine-normal"};
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Position elements: {}\n"
"Position format: {}\n"
"Position shift: {} ({})\n"
@ -367,9 +368,9 @@ struct fmt::formatter<UVAT_group0>
"Normal index 3: {}",
g0.PosElements, g0.PosFormat, g0.PosFrac, 1.f / (1 << g0.PosFrac),
g0.NormalElements, g0.NormalFormat, g0.Color0Elements, g0.Color0Comp,
g0.Color1Elements, g0.Color1Comp, g0.Tex0CoordElements, g0.Tex0CoordFormat,
g0.Tex0Frac, 1.f / (1 << g0.Tex0Frac), byte_dequant[g0.ByteDequant],
normalindex3[g0.NormalIndex3]);
g0.Color1Elements, g0.Color1Comp, g0.Tex0CoordElements,
g0.Tex0CoordFormat, g0.Tex0Frac, 1.f / (1 << g0.Tex0Frac),
byte_dequant[g0.ByteDequant], normalindex3[g0.NormalIndex3]);
}
};
@ -401,7 +402,8 @@ struct fmt::formatter<UVAT_group1>
template <typename FormatContext>
auto format(const UVAT_group1& g1, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(
ctx.out(),
"Texture coord 1 elements: {}\n"
"Texture coord 1 format: {}\n"
"Texture coord 1 shift: {} ({})\n"
@ -414,10 +416,9 @@ struct fmt::formatter<UVAT_group1>
"Texture coord 4 elements: {}\n"
"Texture coord 4 format: {}\n"
"Enhance VCache (must always be on): {}",
g1.Tex1CoordElements, g1.Tex1CoordFormat, g1.Tex1Frac,
1.f / (1 << g1.Tex1Frac), g1.Tex2CoordElements, g1.Tex2CoordFormat,
g1.Tex2Frac, 1.f / (1 << g1.Tex2Frac), g1.Tex3CoordElements,
g1.Tex3CoordFormat, g1.Tex3Frac, 1.f / (1 << g1.Tex3Frac),
g1.Tex1CoordElements, g1.Tex1CoordFormat, g1.Tex1Frac, 1.f / (1 << g1.Tex1Frac),
g1.Tex2CoordElements, g1.Tex2CoordFormat, g1.Tex2Frac, 1.f / (1 << g1.Tex2Frac),
g1.Tex3CoordElements, g1.Tex3CoordFormat, g1.Tex3Frac, 1.f / (1 << g1.Tex3Frac),
g1.Tex4CoordElements, g1.Tex4CoordFormat, g1.VCacheEnhance ? "Yes" : "No");
}
};
@ -447,7 +448,7 @@ struct fmt::formatter<UVAT_group2>
template <typename FormatContext>
auto format(const UVAT_group2& g2, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Texture coord 4 shift: {} ({})\n"
"Texture coord 5 elements: {}\n"
"Texture coord 5 format: {}\n"
@ -581,7 +582,7 @@ struct fmt::formatter<VAT>
template <typename FormatContext>
auto format(const VAT& vat, FormatContext& ctx) const
{
return format_to(ctx.out(), "{}\n{}\n{}", vat.g0, vat.g1, vat.g2);
return fmt::format_to(ctx.out(), "{}\n{}\n{}", vat.g0, vat.g1, vat.g2);
}
};
@ -602,8 +603,9 @@ struct fmt::formatter<TMatrixIndexA>
template <typename FormatContext>
auto format(const TMatrixIndexA& m, FormatContext& ctx) const
{
return format_to(ctx.out(), "PosNormal: {}\nTex0: {}\nTex1: {}\nTex2: {}\nTex3: {}",
m.PosNormalMtxIdx, m.Tex0MtxIdx, m.Tex1MtxIdx, m.Tex2MtxIdx, m.Tex3MtxIdx);
return fmt::format_to(ctx.out(), "PosNormal: {}\nTex0: {}\nTex1: {}\nTex2: {}\nTex3: {}",
m.PosNormalMtxIdx, m.Tex0MtxIdx, m.Tex1MtxIdx, m.Tex2MtxIdx,
m.Tex3MtxIdx);
}
};
@ -622,7 +624,7 @@ struct fmt::formatter<TMatrixIndexB>
template <typename FormatContext>
auto format(const TMatrixIndexB& m, FormatContext& ctx) const
{
return format_to(ctx.out(), "Tex4: {}\nTex5: {}\nTex6: {}\nTex7: {}", m.Tex4MtxIdx,
return fmt::format_to(ctx.out(), "Tex4: {}\nTex5: {}\nTex6: {}\nTex7: {}", m.Tex4MtxIdx,
m.Tex5MtxIdx, m.Tex6MtxIdx, m.Tex7MtxIdx);
}
};

View File

@ -38,7 +38,7 @@ struct fmt::formatter<geometry_shader_uid_data>
template <typename FormatContext>
auto format(const geometry_shader_uid_data& uid, FormatContext& ctx) const
{
return format_to(ctx.out(), "passthrough: {}, {} tex gens, primitive type {}",
return fmt::format_to(ctx.out(), "passthrough: {}, {} tex gens, primitive type {}",
uid.IsPassthrough(), uid.numTexGens, uid.primitive_type);
}
};

View File

@ -84,7 +84,8 @@ struct fmt::formatter<EFBCopyParams>
copy_format = "XFB";
else
copy_format = fmt::to_string(uid.copy_format);
return format_to(ctx.out(), "format: {}, copy format: {}, depth: {}, yuv: {}, copy filter: {}",
return fmt::format_to(ctx.out(),
"format: {}, copy format: {}, depth: {}, yuv: {}, copy filter: {}",
uid.efb_format, copy_format, uid.depth, uid.yuv, uid.copy_filter);
}
};

View File

@ -51,7 +51,7 @@ struct fmt::formatter<TextureConversionShaderGen::UidData>
dst_format = "XFB";
else
dst_format = fmt::to_string(uid.dst_format);
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"dst_format: {}, efb_has_alpha: {}, is_depth_copy: {}, is_intensity: {}, "
"scale_by_half: {}, copy_filter: {}",
dst_format, uid.efb_has_alpha, uid.is_depth_copy, uid.is_intensity,

View File

@ -256,11 +256,12 @@ struct fmt::formatter<LitChannel>
template <typename FormatContext>
auto format(const LitChannel& chan, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(
ctx.out(),
"Material source: {0}\nEnable lighting: {1}\nLight mask: {2:x} ({2:08b})\n"
"Ambient source: {3}\nDiffuse function: {4}\nAttenuation function: {5}",
chan.matsource, chan.enablelighting ? "Yes" : "No", chan.GetFullLightMask(),
chan.ambsource, chan.diffusefunc, chan.attnfunc);
chan.matsource, chan.enablelighting ? "Yes" : "No", chan.GetFullLightMask(), chan.ambsource,
chan.diffusefunc, chan.attnfunc);
}
};
@ -278,7 +279,7 @@ struct fmt::formatter<ClipDisable>
template <typename FormatContext>
auto format(const ClipDisable& cd, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Disable clipping detection: {}\n"
"Disable trivial rejection: {}\n"
"Disable cpoly clipping acceleration: {}",
@ -302,8 +303,8 @@ struct fmt::formatter<INVTXSPEC>
template <typename FormatContext>
auto format(const INVTXSPEC& spec, FormatContext& ctx) const
{
return format_to(ctx.out(), "Num colors: {}\nNum normals: {}\nNum textures: {}", spec.numcolors,
spec.numnormals, spec.numtextures);
return fmt::format_to(ctx.out(), "Num colors: {}\nNum normals: {}\nNum textures: {}",
spec.numcolors, spec.numnormals, spec.numtextures);
}
};
@ -326,7 +327,7 @@ struct fmt::formatter<TexMtxInfo>
template <typename FormatContext>
auto format(const TexMtxInfo& i, FormatContext& ctx) const
{
return format_to(ctx.out(),
return fmt::format_to(ctx.out(),
"Projection: {}\nInput form: {}\nTex gen type: {}\n"
"Source row: {}\nEmboss source shift: {}\nEmboss light shift: {}",
i.projection, i.inputform, i.texgentype, i.sourcerow, i.embosssourceshift,
@ -349,7 +350,7 @@ struct fmt::formatter<PostMtxInfo>
template <typename FormatContext>
auto format(const PostMtxInfo& i, FormatContext& ctx) const
{
return format_to(ctx.out(), "Index: {}\nNormalize before send operation: {}", i.index,
return fmt::format_to(ctx.out(), "Index: {}\nNormalize before send operation: {}", i.index,
i.normalize ? "Yes" : "No");
}
};