[fmt] use {:#X} for format instead of 0x{:X} (#309)

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/309
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie 2025-08-27 22:39:11 +02:00 committed by crueter
parent 7950c5cca0
commit 9d53933a95
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
36 changed files with 170 additions and 86 deletions

View file

@ -90,7 +90,7 @@ void CDmaPusher::ProcessEntries(std::stop_token stop_token) {
break;
}
default:
LOG_ERROR(HW_GPU, "Bad command at index {} (bytes 0x{:X}), buffer size {}", i - 1,
LOG_ERROR(HW_GPU, "Bad command at index {} (bytes {:#X}), buffer size {}", i - 1,
(i - 1) * sizeof(u32), command_list.size());
UNIMPLEMENTED_MSG("ChSubmission mode {} is not implemented!",
static_cast<u32>(mode));
@ -103,7 +103,7 @@ void CDmaPusher::ProcessEntries(std::stop_token stop_token) {
void CDmaPusher::ExecuteCommand(u32 method, u32 arg) {
switch (current_class) {
case ChClassId::Control:
LOG_TRACE(Service_NVDRV, "Class {} method 0x{:X} arg 0x{:X}",
LOG_TRACE(Service_NVDRV, "Class {} method {:#X} arg 0x{:X}",
static_cast<u32>(current_class), method, arg);
host_processor->ProcessMethod(static_cast<Host1x::Control::Method>(method), arg);
break;
@ -121,7 +121,7 @@ void CDmaPusher::ExecuteCommand(u32 method, u32 arg) {
break;
}
case ThiMethod::SetMethod1:
LOG_TRACE(Service_NVDRV, "Class {} method 0x{:X} arg 0x{:X}",
LOG_TRACE(Service_NVDRV, "Class {} method {:#X} arg 0x{:X}",
static_cast<u32>(current_class), static_cast<u32>(thi_regs.method_0), arg);
ProcessMethod(thi_regs.method_0, arg);
break;

View file

@ -44,7 +44,7 @@ void Decoder::Decode() {
if (!frame.get()) {
LOG_ERROR(HW_GPU,
"Nvdec {} failed to decode interlaced frame for top 0x{:X} bottom 0x{:X}", id,
"Nvdec {} failed to decode interlaced frame for top {:#X} bottom 0x{:X}", id,
luma_top, luma_bottom);
}
@ -59,7 +59,7 @@ void Decoder::Decode() {
auto [luma_offset, chroma_offset] = GetProgressiveOffsets();
if (!frame.get()) {
LOG_ERROR(HW_GPU, "Nvdec {} failed to decode progressive frame for luma 0x{:X}", id,
LOG_ERROR(HW_GPU, "Nvdec {} failed to decode progressive frame for luma {:#X}", id,
luma_offset);
}

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
@ -21,7 +24,7 @@ void Control::ProcessMethod(Method method, u32 argument) {
Execute(argument);
break;
default:
UNIMPLEMENTED_MSG("Control method 0x{:X}", static_cast<u32>(method));
UNIMPLEMENTED_MSG("Control method {:#X}", static_cast<u32>(method));
break;
}
}

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -105,7 +108,7 @@ Vic::~Vic() {
}
void Vic::ProcessMethod(u32 method, u32 arg) {
LOG_TRACE(HW_GPU, "Vic {} method 0x{:X}", id, static_cast<u32>(method));
LOG_TRACE(HW_GPU, "Vic {} method {:#X}", id, static_cast<u32>(method));
regs.reg_array[method] = arg;
switch (static_cast<Method>(method * sizeof(u32))) {
@ -142,7 +145,7 @@ void Vic::Execute() {
auto frame = frame_queue.GetFrame(nvdec_id, luma_offset);
if (!frame.get()) {
LOG_ERROR(HW_GPU, "Vic {} failed to get frame with offset 0x{:X}", id, luma_offset);
LOG_ERROR(HW_GPU, "Vic {} failed to get frame with offset {:#X}", id, luma_offset);
continue;
}
@ -999,9 +1002,9 @@ void Vic::WriteY8__V8U8_N420(const OutputSurfaceConfig& output_surface_config) {
LOG_TRACE(
HW_GPU,
"Writing Y8__V8U8_N420 swizzled frame\n"
"\tinput surface {}x{} stride {} size 0x{:X}\n"
"\toutput luma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}\n",
"\toutput chroma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}",
"\tinput surface {}x{} stride {} size {:#X}\n"
"\toutput luma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}\n",
"\toutput chroma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}",
surface_width, surface_height, surface_stride * BytesPerPixel,
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
out_luma_stride, out_luma_size, block_height, out_luma_swizzle_size, out_chroma_width,
@ -1041,9 +1044,9 @@ void Vic::WriteY8__V8U8_N420(const OutputSurfaceConfig& output_surface_config) {
LOG_TRACE(
HW_GPU,
"Writing Y8__V8U8_N420 swizzled frame\n"
"\tinput surface {}x{} stride {} size 0x{:X}\n"
"\toutput luma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}\n",
"\toutput chroma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}",
"\tinput surface {}x{} stride {} size {:#X}\n"
"\toutput luma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}\n",
"\toutput chroma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}",
surface_width, surface_height, surface_stride * BytesPerPixel,
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
out_luma_stride, out_luma_size, out_chroma_width, out_chroma_height, out_chroma_stride,
@ -1212,8 +1215,8 @@ void Vic::WriteABGR(const OutputSurfaceConfig& output_surface_config) {
LOG_TRACE(
HW_GPU,
"Writing ABGR swizzled frame\n"
"\tinput surface {}x{} stride {} size 0x{:X}\n"
"\toutput surface {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}",
"\tinput surface {}x{} stride {} size {:#X}\n"
"\toutput surface {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}",
surface_width, surface_height, surface_stride * BytesPerPixel,
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
out_luma_stride, out_luma_size, block_height, out_swizzle_size);
@ -1237,8 +1240,8 @@ void Vic::WriteABGR(const OutputSurfaceConfig& output_surface_config) {
case BLK_KIND::PITCH: {
LOG_TRACE(HW_GPU,
"Writing ABGR pitch frame\n"
"\tinput surface {}x{} stride {} size 0x{:X}"
"\toutput surface {}x{} stride {} size 0x{:X}",
"\tinput surface {}x{} stride {} size {:#X}"
"\toutput surface {}x{} stride {} size {:#X}",
surface_width, surface_height, surface_stride,
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
out_luma_stride, out_luma_size);

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -60,25 +63,25 @@ std::string Name(const ImageViewBase& image_view, GPUVAddr addr) {
const std::string level = num_levels > 1 ? fmt::format(":{}", num_levels) : "";
switch (image_view.type) {
case ImageViewType::e1D:
return fmt::format("ImageView 1D 0x{:X} {}{}", addr, width, level);
return fmt::format("ImageView 1D {:#X} {}{}", addr, width, level);
case ImageViewType::e2D:
return fmt::format("ImageView 2D 0x{:X} {}x{}{}", addr, width, height, level);
return fmt::format("ImageView 2D {:#X} {}x{}{}", addr, width, height, level);
case ImageViewType::Cube:
return fmt::format("ImageView Cube 0x{:X} {}x{}{}", addr, width, height, level);
return fmt::format("ImageView Cube {:#X} {}x{}{}", addr, width, height, level);
case ImageViewType::e3D:
return fmt::format("ImageView 3D 0x{:X} {}x{}x{}{}", addr, width, height, depth, level);
return fmt::format("ImageView 3D {:#X} {}x{}x{}{}", addr, width, height, depth, level);
case ImageViewType::e1DArray:
return fmt::format("ImageView 1DArray 0x{:X} {}{}|{}", addr, width, level, num_layers);
return fmt::format("ImageView 1DArray {:#X} {}{}|{}", addr, width, level, num_layers);
case ImageViewType::e2DArray:
return fmt::format("ImageView 2DArray 0x{:X} {}x{}{}|{}", addr, width, height, level,
return fmt::format("ImageView 2DArray {:#X} {}x{}{}|{}", addr, width, height, level,
num_layers);
case ImageViewType::CubeArray:
return fmt::format("ImageView CubeArray 0x{:X} {}x{}{}|{}", addr, width, height, level,
return fmt::format("ImageView CubeArray {:#X} {}x{}{}|{}", addr, width, height, level,
num_layers);
case ImageViewType::Rect:
return fmt::format("ImageView Rect 0x{:X} {}x{}{}", addr, width, height, level);
return fmt::format("ImageView Rect {:#X} {}x{}{}", addr, width, height, level);
case ImageViewType::Buffer:
return fmt::format("BufferView 0x{:X} {}", addr, width);
return fmt::format("BufferView {:#X} {}", addr, width);
}
return "Invalid";
}