Overhaul logging.

This commit is contained in:
gibbed
2020-02-28 14:30:48 -06:00
committed by Rick Gibbed
parent de3c91ab2c
commit a48bb71c2f
107 changed files with 954 additions and 854 deletions

View File

@@ -284,13 +284,13 @@ void CommandProcessor::UpdateWritePointer(uint32_t value) {
void CommandProcessor::WriteRegister(uint32_t index, uint32_t value) {
RegisterFile* regs = register_file_;
if (index >= RegisterFile::kRegisterCount) {
XELOGW("CommandProcessor::WriteRegister index out of bounds: %d", index);
XELOGW("CommandProcessor::WriteRegister index out of bounds: {}", index);
return;
}
regs->values[index].u32 = value;
if (!regs->GetRegisterInfo(index)) {
XELOGW("GPU: Write to unknown register (%.4X = %.8X)", index, value);
XELOGW("GPU: Write to unknown register ({:04X} = {:08X})", index, value);
}
// If this is a COHER register, set the dirty flag.
@@ -376,7 +376,7 @@ void CommandProcessor::MakeCoherent() {
}
// TODO(benvanik): notify resource cache of base->size and type.
XELOGD("Make %.8X -> %.8X (%db) coherent, action = %s", base_host,
XELOGD("Make {:08X} -> {:08X} ({}b) coherent, action = {}", base_host,
base_host + size_host, size_host, action);
// Mark coherent.
@@ -541,8 +541,9 @@ bool CommandProcessor::ExecutePacketType0(RingBuffer* reader, uint32_t packet) {
uint32_t count = ((packet >> 16) & 0x3FFF) + 1;
if (reader->read_count() < count * sizeof(uint32_t)) {
XELOGE("ExecutePacketType0 overflow (read count %.8X, packet count %.8X)",
reader->read_count(), count * sizeof(uint32_t));
XELOGE(
"ExecutePacketType0 overflow (read count {:08X}, packet count {:08X})",
reader->read_count(), count * sizeof(uint32_t));
return false;
}
@@ -589,8 +590,9 @@ bool CommandProcessor::ExecutePacketType3(RingBuffer* reader, uint32_t packet) {
auto data_start_offset = reader->read_offset();
if (reader->read_count() < count * sizeof(uint32_t)) {
XELOGE("ExecutePacketType3 overflow (read count %.8X, packet count %.8X)",
reader->read_count(), count * sizeof(uint32_t));
XELOGE(
"ExecutePacketType3 overflow (read count {:08X}, packet count {:08X})",
reader->read_count(), count * sizeof(uint32_t));
return false;
}
@@ -728,14 +730,14 @@ bool CommandProcessor::ExecutePacketType3(RingBuffer* reader, uint32_t packet) {
case PM4_CONTEXT_UPDATE: {
assert_true(count == 1);
uint64_t value = reader->ReadAndSwap<uint32_t>();
XELOGGPU("GPU context update = %.8X", value);
XELOGGPU("GPU context update = {:08X}", value);
assert_true(value == 0);
result = true;
break;
}
default:
XELOGGPU("Unimplemented GPU OPCODE: 0x%.2X\t\tCOUNT: %d\n", opcode,
XELOGGPU("Unimplemented GPU OPCODE: {:#02X}\t\tCOUNT: {}\n", opcode,
count);
assert_always();
reader->AdvanceRead(count * sizeof(uint32_t));
@@ -1200,7 +1202,7 @@ bool CommandProcessor::ExecutePacketType3_DRAW_INDX(RingBuffer* reader,
xenos::IsMajorModeExplicit(vgt_draw_initiator.major_mode,
vgt_draw_initiator.prim_type));
if (!success) {
XELOGE("PM4_DRAW_INDX(%d, %d, %d): Failed in backend",
XELOGE("PM4_DRAW_INDX({}, {}, {}): Failed in backend",
vgt_draw_initiator.num_indices,
uint32_t(vgt_draw_initiator.prim_type),
uint32_t(vgt_draw_initiator.source_select));
@@ -1231,7 +1233,7 @@ bool CommandProcessor::ExecutePacketType3_DRAW_INDX_2(RingBuffer* reader,
xenos::IsMajorModeExplicit(vgt_draw_initiator.major_mode,
vgt_draw_initiator.prim_type));
if (!success) {
XELOGE("PM4_DRAW_INDX_IMM(%d, %d): Failed in backend",
XELOGE("PM4_DRAW_INDX_IMM({}, {}): Failed in backend",
vgt_draw_initiator.num_indices,
uint32_t(vgt_draw_initiator.prim_type));
}
@@ -1426,11 +1428,11 @@ bool CommandProcessor::ExecutePacketType3_VIZ_QUERY(RingBuffer* reader,
if (!end) {
// begin a new viz query @ id
WriteRegister(XE_GPU_REG_VGT_EVENT_INITIATOR, VIZQUERY_START);
XELOGGPU("Begin viz query ID %.2X", id);
XELOGGPU("Begin viz query ID {:02X}", id);
} else {
// end the viz query
WriteRegister(XE_GPU_REG_VGT_EVENT_INITIATOR, VIZQUERY_END);
XELOGGPU("End viz query ID %.2X", id);
XELOGGPU("End viz query ID {:02X}", id);
}
return true;

View File

@@ -419,8 +419,8 @@ ID3D12RootSignature* D3D12CommandProcessor::GetRootSignature(
GetD3D12Context()->GetD3D12Provider(), desc);
if (root_signature == nullptr) {
XELOGE(
"Failed to create a root signature with %u pixel textures, %u pixel "
"samplers, %u vertex textures and %u vertex samplers",
"Failed to create a root signature with {} pixel textures, {} pixel "
"samplers, {} vertex textures and {} vertex samplers",
texture_count_pixel, sampler_count_pixel, texture_count_vertex,
sampler_count_vertex);
return nullptr;
@@ -544,7 +544,7 @@ ID3D12Resource* D3D12CommandProcessor::RequestScratchGPUBuffer(
if (FAILED(device->CreateCommittedResource(
&ui::d3d12::util::kHeapPropertiesDefault, D3D12_HEAP_FLAG_NONE,
&buffer_desc, state, nullptr, IID_PPV_ARGS(&buffer)))) {
XELOGE("Failed to create a %u MB scratch GPU buffer", size >> 20);
XELOGE("Failed to create a {} MB scratch GPU buffer", size >> 20);
return nullptr;
}
if (scratch_buffer_ != nullptr) {
@@ -1492,20 +1492,22 @@ bool D3D12CommandProcessor::IssueDraw(PrimitiveType primitive_type,
break;
}
XELOGW(
"Vertex fetch constant %u (%.8X %.8X) has \"invalid\" type! This "
"Vertex fetch constant {} ({:08X} {:08X}) has \"invalid\" type! "
"This "
"is incorrect behavior, but you can try bypassing this by "
"launching Xenia with --gpu_allow_invalid_fetch_constants=true.",
vfetch_index, vfetch_constant.dword_0, vfetch_constant.dword_1);
return false;
default:
XELOGW("Vertex fetch constant %u (%.8X %.8X) is completely invalid!",
vfetch_index, vfetch_constant.dword_0, vfetch_constant.dword_1);
XELOGW(
"Vertex fetch constant {} ({:08X} {:08X}) is completely invalid!",
vfetch_index, vfetch_constant.dword_0, vfetch_constant.dword_1);
return false;
}
if (!shared_memory_->RequestRange(vfetch_constant.address << 2,
vfetch_constant.size << 2)) {
XELOGE(
"Failed to request vertex buffer at 0x%.8X (size %u) in the shared "
"Failed to request vertex buffer at {:#08X} (size {}) in the shared "
"memory",
vfetch_constant.address << 2, vfetch_constant.size << 2);
return false;
@@ -1534,7 +1536,7 @@ bool D3D12CommandProcessor::IssueDraw(PrimitiveType primitive_type,
uint32_t memexport_format_size =
GetSupportedMemExportFormatSize(memexport_stream.format);
if (memexport_format_size == 0) {
XELOGE("Unsupported memexport format %s",
XELOGE("Unsupported memexport format {}",
FormatInfo::Get(TextureFormat(uint32_t(memexport_stream.format)))
->name);
return false;
@@ -1576,7 +1578,7 @@ bool D3D12CommandProcessor::IssueDraw(PrimitiveType primitive_type,
uint32_t memexport_format_size =
GetSupportedMemExportFormatSize(memexport_stream.format);
if (memexport_format_size == 0) {
XELOGE("Unsupported memexport format %s",
XELOGE("Unsupported memexport format {}",
FormatInfo::Get(TextureFormat(uint32_t(memexport_stream.format)))
->name);
return false;
@@ -1607,7 +1609,7 @@ bool D3D12CommandProcessor::IssueDraw(PrimitiveType primitive_type,
if (!shared_memory_->RequestRange(memexport_range.base_address_dwords << 2,
memexport_range.size_dwords << 2)) {
XELOGE(
"Failed to request memexport stream at 0x%.8X (size %u) in the "
"Failed to request memexport stream at {:#08X} (size {}) in the "
"shared memory",
memexport_range.base_address_dwords << 2,
memexport_range.size_dwords << 2);
@@ -1653,7 +1655,7 @@ bool D3D12CommandProcessor::IssueDraw(PrimitiveType primitive_type,
uint32_t index_buffer_size = index_buffer_info->count * index_size;
if (!shared_memory_->RequestRange(index_base, index_buffer_size)) {
XELOGE(
"Failed to request index buffer at 0x%.8X (size %u) in the shared "
"Failed to request index buffer at {:#08X} (size {}) in the shared "
"memory",
index_base, index_buffer_size);
return false;
@@ -3477,7 +3479,7 @@ ID3D12Resource* D3D12CommandProcessor::RequestReadbackBuffer(uint32_t size) {
&ui::d3d12::util::kHeapPropertiesReadback, D3D12_HEAP_FLAG_NONE,
&buffer_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr,
IID_PPV_ARGS(&buffer)))) {
XELOGE("Failed to create a %u MB readback buffer", size >> 20);
XELOGE("Failed to create a {} MB readback buffer", size >> 20);
return nullptr;
}
if (readback_buffer_ != nullptr) {

View File

@@ -363,8 +363,7 @@ void PipelineCache::InitializeShaderStorage(
delete shader;
}
}
XELOGGPU("Translated %zu shaders from the storage in %" PRIu64
" milliseconds",
XELOGGPU("Translated {} shaders from the storage in {} milliseconds",
shaders_translated,
(xe::Clock::QueryHostTickCount() -
shader_storage_initialization_start) *
@@ -580,8 +579,8 @@ void PipelineCache::InitializeShaderStorage(
}
}
XELOGGPU(
"Created %zu graphics pipeline state objects from the storage in "
"%" PRIu64 " milliseconds",
"Created {} graphics pipeline state objects from the storage in {} "
"milliseconds",
pipeline_states_created,
(xe::Clock::QueryHostTickCount() -
pipeline_state_storage_initialization_start_) *
@@ -770,7 +769,7 @@ Shader::HostVertexShaderType PipelineCache::GetHostVertexShaderTypeIfValid()
// tessellation.
}
XELOGE(
"Unsupported tessellation mode %u for primitive type %u. Report the game "
"Unsupported tessellation mode {} for primitive type {}. Report the game "
"to Xenia developers!",
uint32_t(tessellation_mode), uint32_t(vgt_draw_initiator.prim_type));
return Shader::HostVertexShaderType(-1);
@@ -931,7 +930,7 @@ bool PipelineCache::TranslateShader(
// Perform translation.
// If this fails the shader will be marked as invalid and ignored later.
if (!translator.Translate(shader, cntl, host_vertex_shader_type)) {
XELOGE("Shader %.16" PRIX64 " translation failed; marking as ignored",
XELOGE("Shader {:016X} translation failed; marking as ignored",
shader->ucode_data_hash());
return false;
}
@@ -973,7 +972,7 @@ bool PipelineCache::TranslateShader(
} else {
host_shader_type = "pixel";
}
XELOGGPU("Generated %s shader (%db) - hash %.16" PRIX64 ":\n%s\n",
XELOGGPU("Generated {} shader ({}b) - hash {:016X}:\n{}\n",
host_shader_type, shader->ucode_dword_count() * 4,
shader->ucode_data_hash(), shader->ucode_disassembly().c_str());
}
@@ -992,7 +991,7 @@ bool PipelineCache::TranslateShader(
if (cvars::d3d12_dxbc_disasm) {
auto provider = command_processor_->GetD3D12Context()->GetD3D12Provider();
if (!shader->DisassembleDxbc(provider)) {
XELOGE("Failed to disassemble DXBC shader %.16" PRIX64,
XELOGE("Failed to disassemble DXBC shader {:016X}",
shader->ucode_data_hash());
}
}
@@ -1364,12 +1363,13 @@ ID3D12PipelineState* PipelineCache::CreateD3D12PipelineState(
const PipelineDescription& description = runtime_description.description;
if (runtime_description.pixel_shader != nullptr) {
XELOGGPU("Creating graphics pipeline state with VS %.16" PRIX64
", PS %.16" PRIX64,
runtime_description.vertex_shader->ucode_data_hash(),
runtime_description.pixel_shader->ucode_data_hash());
XELOGGPU(
"Creating graphics pipeline state with VS {:016X}"
", PS {:016X}",
runtime_description.vertex_shader->ucode_data_hash(),
runtime_description.pixel_shader->ucode_data_hash());
} else {
XELOGGPU("Creating graphics pipeline state with VS %.16" PRIX64,
XELOGGPU("Creating graphics pipeline state with VS {:016X}",
runtime_description.vertex_shader->ucode_data_hash());
}
@@ -1395,7 +1395,7 @@ ID3D12PipelineState* PipelineCache::CreateD3D12PipelineState(
// Primitive topology, vertex, hull, domain and geometry shaders.
if (!runtime_description.vertex_shader->is_translated()) {
XELOGE("Vertex shader %.16" PRIX64 " not translated",
XELOGE("Vertex shader {:016X} not translated",
runtime_description.vertex_shader->ucode_data_hash());
assert_always();
return nullptr;
@@ -1404,10 +1404,10 @@ ID3D12PipelineState* PipelineCache::CreateD3D12PipelineState(
description.host_vertex_shader_type;
if (runtime_description.vertex_shader->host_vertex_shader_type() !=
host_vertex_shader_type) {
XELOGE("Vertex shader %.16" PRIX64
" translated into the wrong host shader "
"type",
runtime_description.vertex_shader->ucode_data_hash());
XELOGE(
"Vertex shader {:016X} translated into the wrong host shader "
"type",
runtime_description.vertex_shader->ucode_data_hash());
assert_always();
return nullptr;
}
@@ -1511,7 +1511,7 @@ ID3D12PipelineState* PipelineCache::CreateD3D12PipelineState(
// Pixel shader.
if (runtime_description.pixel_shader != nullptr) {
if (!runtime_description.pixel_shader->is_translated()) {
XELOGE("Pixel shader %.16" PRIX64 " not translated",
XELOGE("Pixel shader {:016X} not translated",
runtime_description.pixel_shader->ucode_data_hash());
assert_always();
return nullptr;
@@ -1681,12 +1681,13 @@ ID3D12PipelineState* PipelineCache::CreateD3D12PipelineState(
if (FAILED(device->CreateGraphicsPipelineState(&state_desc,
IID_PPV_ARGS(&state)))) {
if (runtime_description.pixel_shader != nullptr) {
XELOGE("Failed to create graphics pipeline state with VS %.16" PRIX64
", PS %.16" PRIX64,
runtime_description.vertex_shader->ucode_data_hash(),
runtime_description.pixel_shader->ucode_data_hash());
XELOGE(
"Failed to create graphics pipeline state with VS {:016X}"
", PS {:016X}",
runtime_description.vertex_shader->ucode_data_hash(),
runtime_description.pixel_shader->ucode_data_hash());
} else {
XELOGE("Failed to create graphics pipeline state with VS %.16" PRIX64,
XELOGE("Failed to create graphics pipeline state with VS {:016X}",
runtime_description.vertex_shader->ucode_data_hash());
}
return nullptr;

View File

@@ -702,7 +702,7 @@ void* PrimitiveConverter::AllocateIndices(
buffer_pool_->Request(command_processor_->GetCurrentFrame(), size,
nullptr, nullptr, &gpu_address);
if (mapping == nullptr) {
XELOGE("Failed to allocate space for %u converted %u-bit vertex indices",
XELOGE("Failed to allocate space for {} converted {}-bit vertex indices",
count, format == IndexFormat::kInt32 ? 32 : 16);
return nullptr;
}

View File

@@ -266,7 +266,7 @@ bool RenderTargetCache::Initialize(const TextureCache* texture_cache) {
(!rov_used && edram_store_pipelines_[i] == nullptr) ||
(load_2x_resolve_pipeline_used &&
edram_load_2x_resolve_pipelines_[i] == nullptr)) {
XELOGE("Failed to create the EDRAM load/store pipelines for mode %u", i);
XELOGE("Failed to create the EDRAM load/store pipelines for mode {}", i);
Shutdown();
return false;
}
@@ -824,7 +824,7 @@ bool RenderTargetCache::UpdateRenderTargets(const D3D12Shader* pixel_shader) {
}
#endif
}
XELOGGPU("RT Cache: %s update - pitch %u, samples %u, RTs to attach %u",
XELOGGPU("RT Cache: {} update - pitch {}, samples {}, RTs to attach {}",
full_update ? "Full" : "Partial", surface_pitch,
rb_surface_info.msaa_samples, render_targets_to_attach);
@@ -954,7 +954,7 @@ bool RenderTargetCache::UpdateRenderTargets(const D3D12Shader* pixel_shader) {
if (render_target == nullptr) {
continue;
}
XELOGGPU("RT Color %u: base %u, format %u", i, edram_bases[i],
XELOGGPU("RT Color {}: base {}, format {}", i, edram_bases[i],
formats[i]);
command_processor_->PushTransitionBarrier(
render_target->resource, render_target->state,
@@ -973,7 +973,7 @@ bool RenderTargetCache::UpdateRenderTargets(const D3D12Shader* pixel_shader) {
RenderTarget* depth_render_target = depth_binding.render_target;
current_pipeline_render_targets_[4].guest_render_target = 4;
if (depth_binding.is_bound && depth_render_target != nullptr) {
XELOGGPU("RT Depth: base %u, format %u", edram_bases[4], formats[4]);
XELOGGPU("RT Depth: base {}, format {}", edram_bases[4], formats[4]);
command_processor_->PushTransitionBarrier(
depth_render_target->resource, depth_render_target->state,
D3D12_RESOURCE_STATE_DEPTH_WRITE);
@@ -1165,8 +1165,8 @@ bool RenderTargetCache::Resolve(SharedMemory* shared_memory,
rect.bottom = std::min(rect.bottom, scissor.bottom);
XELOGGPU(
"Resolve: (%d,%d)->(%d,%d) of RT %u (pitch %u, %u sample%s, format %u) "
"at %u",
"Resolve: ({},{})->({},{}) of RT {} (pitch {}, {} sample{}, format {}) "
"at {}",
rect.left, rect.top, rect.right, rect.bottom, surface_index,
surface_pitch, 1 << uint32_t(rb_surface_info.msaa_samples),
rb_surface_info.msaa_samples != MsaaSamples::k1X ? "s" : "",
@@ -1340,8 +1340,8 @@ bool RenderTargetCache::ResolveCopy(SharedMemory* shared_memory,
bool dest_swap = !is_depth && rb_copy_dest_info.copy_dest_swap;
XELOGGPU(
"Resolve: Copying samples %u to 0x%.8X (%ux%u, %cD), destination Z %u, "
"destination format %s, exponent bias %d, red and blue %sswapped",
"Resolve: Copying samples {} to {:#08X} ({}x{}, {}D), destination Z {}, "
"destination format {}, exponent bias {}, red and blue {}swapped",
uint32_t(sample_select), dest_address, dest_pitch, dest_height,
rb_copy_dest_info.copy_dest_array ? '3' : '2', dest_z,
dest_format_info->name, dest_exp_bias, dest_swap ? "" : "not ");
@@ -1532,7 +1532,7 @@ bool RenderTargetCache::ResolveCopy(SharedMemory* shared_memory,
texture_cache->GetResolveDXGIFormat(dest_format);
if (dest_dxgi_format == DXGI_FORMAT_UNKNOWN) {
XELOGE(
"No resolve pipeline for destination format %s - tell Xenia "
"No resolve pipeline for destination format {} - tell Xenia "
"developers!",
FormatInfo::Get(dest_format)->name);
return false;
@@ -1864,7 +1864,7 @@ bool RenderTargetCache::ResolveClear(uint32_t edram_base,
}
}
XELOGGPU("Resolve: Clearing the %s render target",
XELOGGPU("Resolve: Clearing the {} render target",
is_depth ? "depth" : "color");
// Calculate the layout.
@@ -1980,7 +1980,7 @@ ID3D12PipelineState* RenderTargetCache::GetResolvePipeline(
ID3D12PipelineState* pipeline;
if (FAILED(device->CreateGraphicsPipelineState(&pipeline_desc,
IID_PPV_ARGS(&pipeline)))) {
XELOGE("Failed to create the resolve pipeline for DXGI format %u",
XELOGE("Failed to create the resolve pipeline for DXGI format {}",
dest_format);
return nullptr;
}
@@ -2063,8 +2063,8 @@ RenderTargetCache::ResolveTarget* RenderTargetCache::FindOrCreateResolveTarget(
if (heap_page_count == 0 || heap_page_count > kHeap4MBPages) {
assert_always();
XELOGE(
"%ux%u resolve target with DXGI format %u can't fit in a heap, "
"needs %u bytes - tell Xenia developers to increase the heap size!",
"{}x{} resolve target with DXGI format {} can't fit in a heap, "
"needs {} bytes - tell Xenia developers to increase the heap size!",
uint32_t(resource_desc.Width), resource_desc.Height, format,
uint32_t(allocation_info.SizeInBytes));
return nullptr;
@@ -2090,8 +2090,8 @@ RenderTargetCache::ResolveTarget* RenderTargetCache::FindOrCreateResolveTarget(
heaps_[heap_index], (min_heap_page_first % kHeap4MBPages) << 22,
&resource_desc, state, nullptr, IID_PPV_ARGS(&resource)))) {
XELOGE(
"Failed to create a placed resource for %ux%u resolve target with DXGI "
"format %u at heap 4 MB pages %u:%u",
"Failed to create a placed resource for {}x{} resolve target with DXGI "
"format {} at heap 4 MB pages {}:{}",
uint32_t(resource_desc.Width), resource_desc.Height, format,
min_heap_page_first, min_heap_page_first + heap_page_count - 1);
return nullptr;
@@ -2101,8 +2101,8 @@ RenderTargetCache::ResolveTarget* RenderTargetCache::FindOrCreateResolveTarget(
&ui::d3d12::util::kHeapPropertiesDefault, D3D12_HEAP_FLAG_NONE,
&resource_desc, state, nullptr, IID_PPV_ARGS(&resource)))) {
XELOGE(
"Failed to create a committed resource for %ux%u resolve target with "
"DXGI format %u",
"Failed to create a committed resource for {}x{} resolve target with "
"DXGI format {}",
uint32_t(resource_desc.Width), resource_desc.Height, format);
return nullptr;
}
@@ -2397,7 +2397,7 @@ bool RenderTargetCache::MakeHeapResident(uint32_t heap_index) {
heap_desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES;
if (FAILED(
device->CreateHeap(&heap_desc, IID_PPV_ARGS(&heaps_[heap_index])))) {
XELOGE("Failed to create a %u MB heap for render targets",
XELOGE("Failed to create a {} MB heap for render targets",
kHeap4MBPages * 4);
return false;
}
@@ -2422,7 +2422,7 @@ bool RenderTargetCache::EnsureRTVHeapAvailable(bool is_depth) {
ID3D12DescriptorHeap* new_d3d_heap;
if (FAILED(device->CreateDescriptorHeap(&heap_desc,
IID_PPV_ARGS(&new_d3d_heap)))) {
XELOGE("Failed to create a heap for %u %s buffer descriptors",
XELOGE("Failed to create a heap for {} {} buffer descriptors",
kRenderTargetDescriptorHeapSize, is_depth ? "depth" : "color");
return false;
}
@@ -2530,8 +2530,8 @@ RenderTargetCache::RenderTarget* RenderTargetCache::FindOrCreateRenderTarget(
heaps_[heap_index], (heap_page_first % kHeap4MBPages) << 22,
&resource_desc, state, nullptr, IID_PPV_ARGS(&resource)))) {
XELOGE(
"Failed to create a placed resource for %ux%u %s render target with "
"format %u at heap 4 MB pages %u:%u",
"Failed to create a placed resource for {}x{} {} render target with "
"format {} at heap 4 MB pages {}:{}",
uint32_t(resource_desc.Width), resource_desc.Height,
key.is_depth ? "depth" : "color", key.format, heap_page_first,
heap_page_first + heap_page_count - 1);
@@ -2542,8 +2542,8 @@ RenderTargetCache::RenderTarget* RenderTargetCache::FindOrCreateRenderTarget(
&ui::d3d12::util::kHeapPropertiesDefault, D3D12_HEAP_FLAG_NONE,
&resource_desc, state, nullptr, IID_PPV_ARGS(&resource)))) {
XELOGE(
"Failed to create a committed resource for %ux%u %s render target with "
"format %u",
"Failed to create a committed resource for {}x{} {} render target with "
"format {}",
uint32_t(resource_desc.Width), resource_desc.Height,
key.is_depth ? "depth" : "color", key.format);
return nullptr;
@@ -2598,12 +2598,12 @@ RenderTargetCache::RenderTarget* RenderTargetCache::FindOrCreateRenderTarget(
render_targets_.size());
#if 0
XELOGGPU(
"Created %ux%u %s render target with format %u at heap 4 MB pages %u:%u",
"Created {}x{} {} render target with format {} at heap 4 MB pages {}:{}",
uint32_t(resource_desc.Width), resource_desc.Height,
key.is_depth ? "depth" : "color", key.format, heap_page_first,
heap_page_first + heap_page_count - 1);
#else
XELOGGPU("Created %ux%u %s render target with format %u",
XELOGGPU("Created {}x{} {} render target with format {}",
uint32_t(resource_desc.Width), resource_desc.Height,
key.is_depth ? "depth" : "color", key.format);
#endif

View File

@@ -805,7 +805,7 @@ bool SharedMemory::InitializeTraceSubmitDownloads() {
&gpu_written_buffer_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr,
IID_PPV_ARGS(&trace_gpu_written_buffer_)))) {
XELOGE(
"Shared memory: Failed to create a %u KB GPU-written memory download "
"Shared memory: Failed to create a {} KB GPU-written memory download "
"buffer for frame tracing",
gpu_written_page_count << page_size_log2_ >> 10);
ResetTraceGPUWrittenBuffer();

View File

@@ -1004,7 +1004,7 @@ bool TextureCache::Initialize() {
load_pipelines_[i] = ui::d3d12::util::CreateComputePipeline(
device, mode_info.shader, mode_info.shader_size, load_root_signature_);
if (load_pipelines_[i] == nullptr) {
XELOGE("Failed to create the texture loading pipeline for mode %u", i);
XELOGE("Failed to create the texture loading pipeline for mode {}", i);
Shutdown();
return false;
}
@@ -1015,7 +1015,7 @@ bool TextureCache::Initialize() {
if (load_pipelines_2x_[i] == nullptr) {
XELOGE(
"Failed to create the 2x-scaled texture loading pipeline for mode "
"%u",
"{}",
i);
Shutdown();
return false;
@@ -1028,7 +1028,7 @@ bool TextureCache::Initialize() {
device, mode_info.shader, mode_info.shader_size,
resolve_tile_root_signature_);
if (resolve_tile_pipelines_[i] == nullptr) {
XELOGE("Failed to create the texture tiling pipeline for mode %u", i);
XELOGE("Failed to create the texture tiling pipeline for mode {}", i);
Shutdown();
return false;
}
@@ -1243,7 +1243,7 @@ void TextureCache::EndFrame() {
XELOGE("Unsupported texture formats used in the frame:");
unsupported_header_written = true;
}
XELOGE("* %s%s%s%s", FormatInfo::Get(TextureFormat(i))->name,
XELOGE("* {}{}{}{}", FormatInfo::Get(TextureFormat(i))->name,
unsupported_features & kUnsupportedResourceBit ? " resource" : "",
unsupported_features & kUnsupportedUnormBit ? " unorm" : "",
unsupported_features & kUnsupportedSnormBit ? " snorm" : "");
@@ -2094,7 +2094,8 @@ void TextureCache::BindingInfoFromFetchConstant(
break;
}
XELOGW(
"Texture fetch constant (%.8X %.8X %.8X %.8X %.8X %.8X) has "
"Texture fetch constant ({:08X} {:08X} {:08X} {:08X} {:08X} {:08X}) "
"has "
"\"invalid\" type! This is incorrect behavior, but you can try "
"bypassing this by launching Xenia with "
"--gpu_allow_invalid_fetch_constants=true.",
@@ -2103,7 +2104,8 @@ void TextureCache::BindingInfoFromFetchConstant(
return;
default:
XELOGW(
"Texture fetch constant (%.8X %.8X %.8X %.8X %.8X %.8X) is "
"Texture fetch constant ({:08X} {:08X} {:08X} {:08X} {:08X} {:08X}) "
"is "
"completely invalid!",
fetch.dword_0, fetch.dword_1, fetch.dword_2, fetch.dword_3,
fetch.dword_4, fetch.dword_5);
@@ -2121,7 +2123,7 @@ void TextureCache::BindingInfoFromFetchConstant(
}
if (fetch.dimension == Dimension::k1D && width > 8192) {
XELOGE(
"1D texture is too wide (%u) - ignoring! "
"1D texture is too wide ({}) - ignoring! "
"Report the game to Xenia developers",
width);
return;
@@ -2175,8 +2177,8 @@ void TextureCache::BindingInfoFromFetchConstant(
void TextureCache::LogTextureKeyAction(TextureKey key, const char* action) {
XELOGGPU(
"%s %s %s%ux%ux%u %s %s texture with %u %spacked mip level%s, "
"base at 0x%.8X, mips at 0x%.8X",
"{} {} {}{}x{}x{} {} {} texture with {} {}packed mip level{}, "
"base at {:#08X}, mips at {:#08X}",
action, key.tiled ? "tiled" : "linear",
key.scaled_resolve ? "2x-scaled " : "", key.width, key.height, key.depth,
dimension_names_[uint32_t(key.dimension)],
@@ -2188,8 +2190,8 @@ void TextureCache::LogTextureKeyAction(TextureKey key, const char* action) {
void TextureCache::LogTextureAction(const Texture* texture,
const char* action) {
XELOGGPU(
"%s %s %s%ux%ux%u %s %s texture with %u %spacked mip level%s, "
"base at 0x%.8X (size %u), mips at 0x%.8X (size %u)",
"{} {} {}{}x{}x{} {} {} texture with {} {}packed mip level{}, "
"base at {:#08X} (size {}), mips at {:#08X} (size {})",
action, texture->key.tiled ? "tiled" : "linear",
texture->key.scaled_resolve ? "2x-scaled " : "", texture->key.width,
texture->key.height, texture->key.depth,

View File

@@ -194,7 +194,7 @@ uint32_t GraphicsSystem::ReadRegister(uint32_t addr) {
return 0x050002D0;
default:
if (!register_file_.GetRegisterInfo(r)) {
XELOGE("GPU: Read from unknown register (%.4X)", r);
XELOGE("GPU: Read from unknown register ({:04X})", r);
}
}
@@ -212,7 +212,7 @@ void GraphicsSystem::WriteRegister(uint32_t addr, uint32_t value) {
case 0x1844: // AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS
break;
default:
XELOGW("Unknown GPU register %.4X write: %.8X", r, value);
XELOGW("Unknown GPU register {:04X} write: {:08X}", r, value);
break;
}
@@ -233,7 +233,7 @@ void GraphicsSystem::SetInterruptCallback(uint32_t callback,
uint32_t user_data) {
interrupt_callback_ = callback;
interrupt_callback_data_ = user_data;
XELOGGPU("SetInterruptCallback(%.4X, %.4X)", callback, user_data);
XELOGGPU("SetInterruptCallback({:08X}, {:08X})", callback, user_data);
}
void GraphicsSystem::DispatchInterruptCallback(uint32_t source, uint32_t cpu) {
@@ -250,7 +250,7 @@ void GraphicsSystem::DispatchInterruptCallback(uint32_t source, uint32_t cpu) {
}
thread->SetActiveCpu(cpu);
// XELOGGPU("Dispatching GPU interrupt at %.8X w/ mode %d on cpu %d",
// XELOGGPU("Dispatching GPU interrupt at {:08X} w/ mode {} on cpu {}",
// interrupt_callback_, source, cpu);
uint64_t args[] = {source, interrupt_callback_data_};

View File

@@ -81,8 +81,8 @@ int shader_compiler_main(const std::vector<std::string>& args) {
auto input_file = filesystem::OpenFile(cvars::shader_input, "rb");
if (!input_file) {
XELOGE("Unable to open input file: %s",
xe::path_to_utf8(cvars::shader_input).c_str());
XELOGE("Unable to open input file: {}",
xe::path_to_utf8(cvars::shader_input));
return 1;
}
fseek(input_file, 0, SEEK_END);
@@ -92,8 +92,8 @@ int shader_compiler_main(const std::vector<std::string>& args) {
fread(ucode_dwords.data(), 4, ucode_dwords.size(), input_file);
fclose(input_file);
XELOGI("Opened %s as a %s shader, %" PRId64 " words (%" PRId64 " bytes).",
xe::path_to_utf8(cvars::shader_input).c_str(),
XELOGI("Opened {} as a {} shader, {} words ({} bytes).",
xe::path_to_utf8(cvars::shader_input),
shader_type == ShaderType::kVertex ? "vertex" : "pixel",
ucode_dwords.size(), ucode_dwords.size() * 4);

View File

@@ -1299,7 +1299,7 @@ void ShaderTranslator::ParseAluVectorOperation(const AluInstruction& op,
// assert_always();
XELOGE(
"ShaderTranslator::ParseAluVectorOperation: Unsupported write to "
"export %d",
"export {}",
dest_num);
i.vector_result.storage_target = InstructionStorageTarget::kNone;
i.vector_result.storage_index = 0;
@@ -1343,7 +1343,7 @@ void ShaderTranslator::ParseAluVectorOperation(const AluInstruction& op,
default:
XELOGE(
"ShaderTranslator::ParseAluVectorOperation: Unsupported write to "
"export %d",
"export {}",
dest_num);
i.vector_result.storage_target = InstructionStorageTarget::kNone;
i.vector_result.storage_index = 0;
@@ -1468,7 +1468,7 @@ void ShaderTranslator::ParseAluScalarOperation(const AluInstruction& op,
// assert_always();
XELOGE(
"ShaderTranslator::ParseAluScalarOperation: Unsupported write to "
"export %d",
"export {}",
dest_num);
i.scalar_result.storage_target = InstructionStorageTarget::kNone;
i.scalar_result.storage_index = 0;

View File

@@ -674,7 +674,7 @@ void SpirvShaderTranslator::PostTranslation(Shader* shader) {
reinterpret_cast<const uint32_t*>(shader->translated_binary().data()),
shader->translated_binary().size() / sizeof(uint32_t));
if (validation->has_error()) {
XELOGE("SPIR-V Shader Validation failed! Error: %s",
XELOGE("SPIR-V Shader Validation failed! Error: {}",
validation->error_string());
}
}

View File

@@ -85,7 +85,7 @@ void TextureDump(const TextureInfo& src, void* buffer, size_t length) {
assert_unhandled_case(src.format);
std::memset(&dds_header.pixel_format, 0xCD,
sizeof(dds_header.pixel_format));
XELOGW("Skipping %s for texture dump.", src.format_info()->name);
XELOGW("Skipping {} for texture dump.", src.format_info()->name);
return;
}
}
@@ -93,12 +93,12 @@ void TextureDump(const TextureInfo& src, void* buffer, size_t length) {
dds_header.caps[0] = 8u | 0x1000u;
static int dump_counter = 0;
char path[256];
sprintf(path, "texture_dumps\\%05d_%.8X_%.8X_%s.dds", dump_counter++,
src.memory.base_address, src.memory.mip_address,
src.format_info()->name);
std::filesystem::path path = "texture_dumps";
path /= fmt::format("{:05d}_{:08X}_{:08X}_{:08X}.dds", dump_counter++,
src.memory.base_address, src.memory.mip_address,
src.format_info()->name);
FILE* handle = fopen(path, "wb");
FILE* handle = filesystem::OpenFile(path, "wb");
if (handle) {
const uint32_t signature = ' SDD';
fwrite(&signature, sizeof(signature), 1, handle);

View File

@@ -79,7 +79,7 @@ bool TextureInfo::Prepare(const xe_gpu_texture_fetch_t& fetch,
info.has_packed_mips = fetch.packed_mips;
if (info.format_info()->format == TextureFormat::kUnknown) {
XELOGE("Attempting to fetch from unsupported texture format %d",
XELOGE("Attempting to fetch from unsupported texture format {}",
info.format);
info.memory.base_address = fetch.base_address << 12;
info.memory.mip_address = fetch.mip_address << 12;

View File

@@ -63,7 +63,7 @@ int TraceDump::Main(const std::vector<std::string>& args) {
// Normalize the path and make absolute.
auto abs_path = std::filesystem::absolute(path);
XELOGI("Loading trace file %s...", xe::path_to_utf8(abs_path).c_str());
XELOGI("Loading trace file {}...", xe::path_to_utf8(abs_path));
if (!Setup()) {
XELOGE("Unable to setup trace dump tool");
@@ -96,7 +96,7 @@ bool TraceDump::Setup() {
X_STATUS result = emulator_->Setup(
nullptr, nullptr, [this]() { return CreateGraphicsSystem(); }, nullptr);
if (XFAILED(result)) {
XELOGE("Failed to setup emulator: %.8X", result);
XELOGE("Failed to setup emulator: {:08X}", result);
return false;
}
graphics_system_ = emulator_->graphics_system();

View File

@@ -37,7 +37,7 @@ bool TraceReader::Open(const std::filesystem::path& path) {
// Verify version.
auto header = reinterpret_cast<const TraceHeader*>(trace_data_);
if (header->version != kTraceFormatVersion) {
XELOGE("Trace format version mismatch, code has %u, file has %u",
XELOGE("Trace format version mismatch, code has {}, file has {}",
kTraceFormatVersion, header->version);
if (header->version < kTraceFormatVersion) {
XELOGE("You need to regenerate your trace for the latest version");
@@ -45,13 +45,12 @@ bool TraceReader::Open(const std::filesystem::path& path) {
return false;
}
auto path_str = xe::path_to_utf8(path);
XELOGI("Mapped %" PRId64 "b trace from %s", trace_size_, path_str.c_str());
XELOGI(" Version: %u", header->version);
XELOGI("Mapped {}b trace from {}", trace_size_, xe::path_to_utf8(path));
XELOGI(" Version: {}", header->version);
auto commit_str = std::string(header->build_commit_sha,
xe::countof(header->build_commit_sha));
XELOGI(" Commit: %s", commit_str.c_str());
XELOGI(" Title ID: %u", header->title_id);
XELOGI(" Commit: {}", commit_str);
XELOGI(" Title ID: {}", header->title_id);
ParseTrace();

View File

@@ -126,7 +126,7 @@ bool TraceViewer::Setup() {
window_.get(), nullptr, [this]() { return CreateGraphicsSystem(); },
nullptr);
if (XFAILED(result)) {
XELOGE("Failed to setup emulator: %.8X", result);
XELOGE("Failed to setup emulator: {:08X}", result);
return false;
}
memory_ = emulator_->memory();

View File

@@ -509,7 +509,7 @@ std::pair<VkBuffer, VkDeviceSize> BufferCache::UploadVertexBuffer(
// OOM.
XELOGW(
"Failed to allocate transient data for vertex buffer! Wanted to "
"allocate %u bytes.",
"allocate {} bytes.",
upload_size);
return {nullptr, VK_WHOLE_SIZE};
}
@@ -648,14 +648,16 @@ VkDescriptorSet BufferCache::PrepareVertexSet(
break;
}
XELOGW(
"Vertex fetch constant %u (%.8X %.8X) has \"invalid\" type! This "
"Vertex fetch constant {} ({:08X} {:08X}) has \"invalid\" type! "
"This "
"is incorrect behavior, but you can try bypassing this by "
"launching Xenia with --gpu_allow_invalid_fetch_constants=true.",
vertex_binding.fetch_constant, fetch->dword_0, fetch->dword_1);
return nullptr;
default:
XELOGW("Vertex fetch constant %u (%.8X %.8X) is completely invalid!",
vertex_binding.fetch_constant, fetch->dword_0, fetch->dword_1);
XELOGW(
"Vertex fetch constant {} ({:08X} {:08X}) is completely invalid!",
vertex_binding.fetch_constant, fetch->dword_0, fetch->dword_1);
return nullptr;
}

View File

@@ -340,7 +340,7 @@ VkPipeline PipelineCache::GetPipeline(const RenderState* render_state,
auto result = vkCreateGraphicsPipelines(*device_, pipeline_cache_, 1,
&pipeline_info, nullptr, &pipeline);
if (result != VK_SUCCESS) {
XELOGE("vkCreateGraphicsPipelines failed with code %d", result);
XELOGE("vkCreateGraphicsPipelines failed with code {}", result);
assert_always();
return nullptr;
}
@@ -379,10 +379,10 @@ bool PipelineCache::TranslateShader(VulkanShader* shader,
}
if (shader->is_valid()) {
XELOGGPU("Generated %s shader (%db) - hash %.16" PRIX64 ":\n%s\n",
XELOGGPU("Generated {} shader ({}b) - hash {:016X}:\n{}\n",
shader->type() == ShaderType::kVertex ? "vertex" : "pixel",
shader->ucode_dword_count() * 4, shader->ucode_data_hash(),
shader->ucode_disassembly().c_str());
shader->ucode_disassembly());
}
// Dump shader files if desired.
@@ -395,18 +395,18 @@ bool PipelineCache::TranslateShader(VulkanShader* shader,
static void DumpShaderStatisticsAMD(const VkShaderStatisticsInfoAMD& stats) {
XELOGI(" - resource usage:");
XELOGI(" numUsedVgprs: %d", stats.resourceUsage.numUsedVgprs);
XELOGI(" numUsedSgprs: %d", stats.resourceUsage.numUsedSgprs);
XELOGI(" ldsSizePerLocalWorkGroup: %d",
XELOGI(" numUsedVgprs: {}", stats.resourceUsage.numUsedVgprs);
XELOGI(" numUsedSgprs: {}", stats.resourceUsage.numUsedSgprs);
XELOGI(" ldsSizePerLocalWorkGroup: {}",
stats.resourceUsage.ldsSizePerLocalWorkGroup);
XELOGI(" ldsUsageSizeInBytes : %d",
XELOGI(" ldsUsageSizeInBytes : {}",
stats.resourceUsage.ldsUsageSizeInBytes);
XELOGI(" scratchMemUsageInBytes : %d",
XELOGI(" scratchMemUsageInBytes : {}",
stats.resourceUsage.scratchMemUsageInBytes);
XELOGI("numPhysicalVgprs : %d", stats.numPhysicalVgprs);
XELOGI("numPhysicalSgprs : %d", stats.numPhysicalSgprs);
XELOGI("numAvailableVgprs: %d", stats.numAvailableVgprs);
XELOGI("numAvailableSgprs: %d", stats.numAvailableSgprs);
XELOGI("numPhysicalVgprs : {}", stats.numPhysicalVgprs);
XELOGI("numPhysicalSgprs : {}", stats.numPhysicalSgprs);
XELOGI("numAvailableVgprs: {}", stats.numAvailableVgprs);
XELOGI("numAvailableSgprs: {}", stats.numAvailableSgprs);
}
void PipelineCache::DumpShaderDisasmAMD(VkPipeline pipeline) {
@@ -521,8 +521,8 @@ void PipelineCache::DumpShaderDisasmNV(
disasm_fp = std::string("Shader disassembly not available.");
}
XELOGI("%s\n=====================================\n%s\n", disasm_vp.c_str(),
disasm_fp.c_str());
XELOGI("{}\n=====================================\n{}\n", disasm_vp,
disasm_fp);
}
vkDestroyPipeline(*device_, dummy_pipeline, nullptr);
@@ -1201,7 +1201,7 @@ PipelineCache::UpdateStatus PipelineCache::UpdateInputAssemblyState(
break;
default:
case PrimitiveType::kTriangleWithWFlags:
XELOGE("unsupported primitive type %d", primitive_type);
XELOGE("unsupported primitive type {}", primitive_type);
assert_unhandled_case(primitive_type);
return UpdateStatus::kError;
}

View File

@@ -864,7 +864,7 @@ bool RenderCache::ConfigureRenderPass(VkCommandBuffer command_buffer,
render_pass = new CachedRenderPass(*device_, *config);
VkResult status = render_pass->Initialize();
if (status != VK_SUCCESS) {
XELOGE("%s: Failed to create render pass, status %s", __func__,
XELOGE("{}: Failed to create render pass, status {}", __func__,
ui::vulkan::to_string(status));
delete render_pass;
return false;
@@ -943,7 +943,7 @@ bool RenderCache::ConfigureRenderPass(VkCommandBuffer command_buffer,
target_color_attachments, target_depth_stencil_attachment);
VkResult status = framebuffer->Initialize();
if (status != VK_SUCCESS) {
XELOGE("%s: Failed to create framebuffer, status %s", __func__,
XELOGE("{}: Failed to create framebuffer, status {}", __func__,
ui::vulkan::to_string(status));
delete framebuffer;
return false;
@@ -996,7 +996,7 @@ CachedTileView* RenderCache::FindOrCreateTileView(
tile_view = new CachedTileView(device_, edram_memory_, view_key);
VkResult status = tile_view->Initialize(command_buffer);
if (status != VK_SUCCESS) {
XELOGE("%s: Failed to create tile view, status %s", __func__,
XELOGE("{}: Failed to create tile view, status {}", __func__,
ui::vulkan::to_string(status));
delete tile_view;

View File

@@ -88,8 +88,8 @@ VkResult TextureCache::Initialize() {
limits.maxPerStageDescriptorSampledImages < kMaxTextureSamplers) {
XELOGE(
"Physical device is unable to support required number of sampled "
"images! Expect instability! (maxPerStageDescriptorSamplers=%d, "
"maxPerStageDescriptorSampledImages=%d)",
"images! Expect instability! (maxPerStageDescriptorSamplers={}, "
"maxPerStageDescriptorSampledImages={})",
limits.maxPerStageDescriptorSamplers,
limits.maxPerStageDescriptorSampledImages);
// assert_always();
@@ -190,7 +190,7 @@ TextureCache::Texture* TextureCache::AllocateTexture(
VkFormat format = config.host_format;
if (format == VK_FORMAT_UNDEFINED) {
XELOGE(
"Texture Cache: Attempted to allocate texture format %s, which is "
"Texture Cache: Attempted to allocate texture format {}, which is "
"defined as VK_FORMAT_UNDEFINED!",
texture_info.format_info()->name);
return nullptr;
@@ -235,13 +235,11 @@ TextureCache::Texture* TextureCache::AllocateTexture(
if ((props.optimalTilingFeatures & required_flags) != required_flags) {
// Texture needs conversion on upload to a native format.
XELOGE(
"Texture Cache: Invalid usage flag specified on format %s (%s)\n\t"
"(requested: %s)",
"Texture Cache: Invalid usage flag specified on format {} ({})\n\t"
"(requested: {})",
texture_info.format_info()->name, ui::vulkan::to_string(format),
ui::vulkan::to_flags_string(
static_cast<VkFormatFeatureFlagBits>(required_flags &
~props.optimalTilingFeatures))
.c_str());
ui::vulkan::to_flags_string(static_cast<VkFormatFeatureFlagBits>(
required_flags & ~props.optimalTilingFeatures)));
}
if (texture_info.dimension != Dimension::kCube &&
@@ -1070,9 +1068,9 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer,
size_t unpack_length = ComputeTextureStorage(src);
XELOGGPU(
"Uploading texture @ 0x%.8X/0x%.8X (%ux%ux%u, format: %s, dim: %s, "
"levels: %u (%u-%u), stacked: %s, pitch: %u, tiled: %s, packed mips: %s, "
"unpack length: 0x%.8X)",
"Uploading texture @ {:#08X}/{:#08X} ({}x{}x{}, format: {}, dim: {}, "
"levels: {} ({}-{}), stacked: {}, pitch: {}, tiled: {}, packed mips: {}, "
"unpack length: {:#X})",
src.memory.base_address, src.memory.mip_address, src.width + 1,
src.height + 1, src.depth + 1, src.format_info()->name,
get_dimension_name(src.dimension), src.mip_levels(), src.mip_min_level,
@@ -1080,7 +1078,7 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer,
src.is_tiled ? "yes" : "no", src.has_packed_mips ? "yes" : "no",
unpack_length);
XELOGGPU("Extent: %ux%ux%u %u,%u,%u", src.extent.pitch, src.extent.height,
XELOGGPU("Extent: {}x{}x{} {},{},{}", src.extent.pitch, src.extent.height,
src.extent.depth, src.extent.block_pitch_h, src.extent.block_height,
src.extent.block_pitch_v);
@@ -1099,7 +1097,7 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer,
if (!staging_buffer_.CanAcquire(unpack_length)) {
// The staging buffer isn't big enough to hold this texture.
XELOGE(
"TextureCache staging buffer is too small! (uploading 0x%.8X bytes)",
"TextureCache staging buffer is too small! (uploading {:#X} bytes)",
unpack_length);
assert_always();
return false;
@@ -1110,7 +1108,7 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer,
auto alloc = staging_buffer_.Acquire(unpack_length, completion_fence);
assert_not_null(alloc);
if (!alloc) {
XELOGE("%s: Failed to acquire staging memory!", __func__);
XELOGE("{}: Failed to acquire staging memory!", __func__);
return false;
}
@@ -1125,7 +1123,7 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer,
}
if (!valid) {
XELOGW("Warning: Texture @ 0x%.8X is blank!", src.memory.base_address);
XELOGW("Warning: Texture @ {:#08X} is blank!", src.memory.base_address);
}
// Upload texture into GPU memory.
@@ -1142,14 +1140,14 @@ bool TextureCache::UploadTexture(VkCommandBuffer command_buffer,
mip++, region++) {
if (!ConvertTexture(&unpack_buffer[unpack_offset], &copy_regions[region],
mip, src)) {
XELOGW("Failed to convert texture mip %u!", mip);
XELOGW("Failed to convert texture mip {}!", mip);
return false;
}
copy_regions[region].bufferOffset = alloc->offset + unpack_offset;
copy_regions[region].imageOffset = {0, 0, 0};
/*
XELOGGPU("Mip %u %ux%ux%u @ 0x%X", mip,
XELOGGPU("Mip {} {}x{}x{} @ {:#X}", mip,
copy_regions[region].imageExtent.width,
copy_regions[region].imageExtent.height,
copy_regions[region].imageExtent.depth, unpack_offset);
@@ -1510,7 +1508,8 @@ bool TextureCache::SetupTextureBinding(VkCommandBuffer command_buffer,
break;
}
XELOGW(
"Texture fetch constant %u (%.8X %.8X %.8X %.8X %.8X %.8X) has "
"Texture fetch constant {} ({:08X} {:08X} {:08X} {:08X} {:08X} "
"{:08X}) has "
"\"invalid\" type! This is incorrect behavior, but you can try "
"bypassing this by launching Xenia with "
"--gpu_allow_invalid_fetch_constants=true.",
@@ -1519,7 +1518,8 @@ bool TextureCache::SetupTextureBinding(VkCommandBuffer command_buffer,
return false;
default:
XELOGW(
"Texture fetch constant %u (%.8X %.8X %.8X %.8X %.8X %.8X) is "
"Texture fetch constant {} ({:08X} {:08X} {:08X} {:08X} {:08X} "
"{:08X}) is "
"completely invalid!",
binding.fetch_constant, fetch.dword_0, fetch.dword_1, fetch.dword_2,
fetch.dword_3, fetch.dword_4, fetch.dword_5);

View File

@@ -1121,9 +1121,9 @@ bool VulkanCommandProcessor::IssueCopy() {
: static_cast<uint32_t>(depth_format);
VkFilter filter = is_color_source ? VK_FILTER_LINEAR : VK_FILTER_NEAREST;
XELOGGPU("Resolve RT %.8X %.8X(%d) -> 0x%.8X (%dx%d, format: %s)", edram_base,
surface_pitch, surface_pitch, copy_dest_base, copy_dest_pitch,
copy_dest_height, texture_info.format_info()->name);
XELOGGPU("Resolve RT {:08X} {:08X}({}) -> {:#08X} ({}x{}, format: {})",
edram_base, surface_pitch, surface_pitch, copy_dest_base,
copy_dest_pitch, copy_dest_height, texture_info.format_info()->name);
switch (copy_command) {
case CopyCommand::kRaw:
/*