From d52f29dcd76a33766aff743ac29a95f3df581c40 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Mon, 30 Dec 2024 00:44:03 +0100 Subject: [PATCH] GS/D3D12: Properly name logs with D3D12 prefix. --- pcsx2/GS/Renderers/DX12/GSDevice12.cpp | 86 +++++++++++++------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp index 7f5803e018..b271714409 100644 --- a/pcsx2/GS/Renderers/DX12/GSDevice12.cpp +++ b/pcsx2/GS/Renderers/DX12/GSDevice12.cpp @@ -121,7 +121,7 @@ GSDevice12::ComPtr GSDevice12::CreateRootSignature(const D3 m_device->CreateRootSignature(0, blob->GetBufferPointer(), blob->GetBufferSize(), IID_PPV_ARGS(rs.put())); if (FAILED(hr)) { - Console.Error("CreateRootSignature() failed: %08X", hr); + Console.Error("D3D12: CreateRootSignature() failed: %08X", hr); return {}; } @@ -173,7 +173,7 @@ bool GSDevice12::CreateDevice(u32& vendor_id) } else { - Console.Error("Debug layer requested but not available."); + Console.Error("D3D12: Debug layer requested but not available."); enable_debug_layer = false; } } @@ -185,7 +185,7 @@ bool GSDevice12::CreateDevice(u32& vendor_id) hr = D3D12CreateDevice(m_adapter.get(), isIntel ? D3D_FEATURE_LEVEL_12_0 : D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device)); if (FAILED(hr)) { - Console.Error("Failed to create D3D12 device: %08X", hr); + Console.Error("D3D12: Failed to create device: %08X", hr); return false; } @@ -193,7 +193,7 @@ bool GSDevice12::CreateDevice(u32& vendor_id) { const LUID luid(m_device->GetAdapterLuid()); if (FAILED(m_dxgi_factory->EnumAdapterByLuid(luid, IID_PPV_ARGS(m_adapter.put())))) - Console.Error("Failed to get lookup adapter by device LUID"); + Console.Error("D3D12: Failed to get lookup adapter by device LUID"); } if (enable_debug_layer) @@ -226,7 +226,7 @@ bool GSDevice12::CreateDevice(u32& vendor_id) hr = m_device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&m_command_queue)); if (FAILED(hr)) { - Console.Error("Failed to create command queue: %08X", hr); + Console.Error("D3D12: Failed to create command queue: %08X", hr); return false; } @@ -240,21 +240,21 @@ bool GSDevice12::CreateDevice(u32& vendor_id) hr = D3D12MA::CreateAllocator(&allocatorDesc, m_allocator.put()); if (FAILED(hr)) { - Console.Error("D3D12MA::CreateAllocator() failed with HRESULT %08X", hr); + Console.Error("D3D12: CreateAllocator() failed with HRESULT %08X", hr); return false; } hr = m_device->CreateFence(m_completed_fence_value, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&m_fence)); if (FAILED(hr)) { - Console.Error("Failed to create fence: %08X", hr); + Console.Error("D3D12: Failed to create fence: %08X", hr); return false; } m_fence_event = CreateEvent(nullptr, FALSE, FALSE, nullptr); if (m_fence_event == NULL) { - Console.Error("Failed to create fence event: %08X", GetLastError()); + Console.Error("D3D12: Failed to create fence event: %08X", GetLastError()); return false; } @@ -312,7 +312,7 @@ bool GSDevice12::CreateCommandLists() nullptr, IID_PPV_ARGS(res.command_lists[i].put())); if (FAILED(hr)) { - Console.Error("Failed to create command list: %08X", hr); + Console.Error("D3D12: Failed to create command list: %08X", hr); return false; } @@ -325,13 +325,13 @@ bool GSDevice12::CreateCommandLists() if (!res.descriptor_allocator.Create(m_device.get(), D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, MAX_GPU_SRVS)) { - Console.Error("Failed to create per frame descriptor allocator"); + Console.Error("D3D12: Failed to create per frame descriptor allocator"); return false; } if (!res.sampler_allocator.Create(m_device.get(), MAX_GPU_SAMPLERS)) { - Console.Error("Failed to create per frame sampler allocator"); + Console.Error("D3D12: Failed to create per frame sampler allocator"); return false; } } @@ -378,7 +378,7 @@ void GSDevice12::MoveToNextCommandList() } else { - Console.Warning("Map() for timestamp query failed: %08X", hr); + Console.Warning("D3D12: Map() for timestamp query failed: %08X", hr); } } @@ -432,7 +432,7 @@ bool GSDevice12::ExecuteCommandList(WaitType wait_for_completion) hr = res.command_lists[0]->Close(); if (FAILED(hr)) { - Console.Error("Closing init command list failed with HRESULT %08X", hr); + Console.Error("D3D12: Closing init command list failed with HRESULT %08X", hr); return false; } } @@ -441,7 +441,7 @@ bool GSDevice12::ExecuteCommandList(WaitType wait_for_completion) hr = res.command_lists[1]->Close(); if (FAILED(hr)) { - Console.Error("Closing main command list failed with HRESULT %08X", hr); + Console.Error("D3D12: Closing main command list failed with HRESULT %08X", hr); return false; } @@ -581,7 +581,7 @@ bool GSDevice12::CreateTimestampQuery() HRESULT hr = m_device->CreateQueryHeap(&desc, IID_PPV_ARGS(m_timestamp_query_heap.put())); if (FAILED(hr)) { - Console.Error("CreateQueryHeap() for timestamp failed with %08X", hr); + Console.Error("D3D12: CreateQueryHeap() for timestamp failed with %08X", hr); return false; } @@ -592,7 +592,7 @@ bool GSDevice12::CreateTimestampQuery() m_timestamp_query_allocation.put(), IID_PPV_ARGS(m_timestamp_query_buffer.put())); if (FAILED(hr)) { - Console.Error("CreateResource() for timestamp failed with %08X", hr); + Console.Error("D3D12: CreateResource() for timestamp failed with %08X", hr); return false; } @@ -600,7 +600,7 @@ bool GSDevice12::CreateTimestampQuery() hr = m_command_queue->GetTimestampFrequency(&frequency); if (FAILED(hr)) { - Console.Error("GetTimestampFrequency() failed: %08X", hr); + Console.Error("D3D12: GetTimestampFrequency() failed: %08X", hr); return false; } @@ -691,7 +691,7 @@ bool GSDevice12::Create(GSVSyncMode vsync_mode, bool allow_present_throttle) if (!CheckFeatures(vendor_id)) { - Console.Error("Your GPU does not support the required D3D12 features."); + Console.Error("D3D12: Your GPU does not support the required D3D12 features."); return false; } @@ -715,7 +715,7 @@ bool GSDevice12::Create(GSVSyncMode vsync_mode, bool allow_present_throttle) } if (!m_shader_cache.Open(m_feature_level, GSConfig.UseDebugDevice)) - Console.Warning("Shader cache failed to open."); + Console.Warning("D3D12: Shader cache failed to open."); if (!CreateNullTexture()) { @@ -769,7 +769,7 @@ void GSDevice12::SetVSyncMode(GSVSyncMode mode, bool allow_present_throttle) // Using mailbox-style no-allow-tearing causes tearing in exclusive fullscreen. if (mode == GSVSyncMode::Mailbox && m_is_exclusive_fullscreen) { - WARNING_LOG("Using FIFO instead of Mailbox vsync due to exclusive fullscreen."); + WARNING_LOG("D3D12: Using FIFO instead of Mailbox vsync due to exclusive fullscreen."); mode = GSVSyncMode::FIFO; } @@ -822,7 +822,7 @@ bool GSDevice12::CreateSwapChain() // Using mailbox-style no-allow-tearing causes tearing in exclusive fullscreen. if (m_vsync_mode == GSVSyncMode::Mailbox && m_is_exclusive_fullscreen) { - WARNING_LOG("Using FIFO instead of Mailbox vsync due to exclusive fullscreen."); + WARNING_LOG("D3D12: Using FIFO instead of Mailbox vsync due to exclusive fullscreen."); m_vsync_mode = GSVSyncMode::FIFO; } } @@ -859,12 +859,12 @@ bool GSDevice12::CreateSwapChain() fs_desc.Scaling = fullscreen_mode.Scaling; fs_desc.Windowed = FALSE; - Console.WriteLn("Creating a %dx%d exclusive fullscreen swap chain", fs_sd_desc.Width, fs_sd_desc.Height); + Console.WriteLn("D3D12: Creating a %dx%d exclusive fullscreen swap chain", fs_sd_desc.Width, fs_sd_desc.Height); hr = m_dxgi_factory->CreateSwapChainForHwnd(m_command_queue.get(), window_hwnd, &fs_sd_desc, &fs_desc, fullscreen_output.get(), m_swap_chain.put()); if (FAILED(hr)) { - Console.Warning("Failed to create fullscreen swap chain, trying windowed."); + Console.Warning("D3D12: Failed to create fullscreen swap chain, trying windowed."); m_is_exclusive_fullscreen = false; m_using_allow_tearing = m_allow_tearing_supported; } @@ -872,12 +872,12 @@ bool GSDevice12::CreateSwapChain() if (!m_is_exclusive_fullscreen) { - Console.WriteLn("Creating a %dx%d windowed swap chain", swap_chain_desc.Width, swap_chain_desc.Height); + Console.WriteLn("D3D12: Creating a %dx%d windowed swap chain", swap_chain_desc.Width, swap_chain_desc.Height); hr = m_dxgi_factory->CreateSwapChainForHwnd( m_command_queue.get(), window_hwnd, &swap_chain_desc, nullptr, nullptr, m_swap_chain.put()); if (FAILED(hr)) - Console.Warning("Failed to create windowed swap chain."); + Console.Warning("D3D12: Failed to create windowed swap chain."); } // MWA needs to be called on the correct factory. @@ -887,11 +887,11 @@ bool GSDevice12::CreateSwapChain() { hr = swap_chain_factory->MakeWindowAssociation(window_hwnd, DXGI_MWA_NO_WINDOW_CHANGES); if (FAILED(hr)) - Console.ErrorFmt("MakeWindowAssociation() to disable ALT+ENTER failed: {}", Error::CreateHResult(hr).GetDescription()); + Console.ErrorFmt("D3D12: MakeWindowAssociation() to disable ALT+ENTER failed: {}", Error::CreateHResult(hr).GetDescription()); } else { - Console.ErrorFmt("GetParent() on swap chain to get factory failed: {}", Error::CreateHResult(hr).GetDescription()); + Console.ErrorFmt("D3D12: GetParent() on swap chain to get factory failed: {}", Error::CreateHResult(hr).GetDescription()); } if (!CreateSwapChainRTV()) @@ -926,7 +926,7 @@ bool GSDevice12::CreateSwapChainRTV() hr = m_swap_chain->GetBuffer(i, IID_PPV_ARGS(backbuffer.put())); if (FAILED(hr)) { - Console.Error("GetBuffer for RTV failed: 0x%08X", hr); + Console.Error("D3D12: GetBuffer for RTV failed: 0x%08X", hr); m_swap_chain_buffers.clear(); return false; } @@ -946,7 +946,7 @@ bool GSDevice12::CreateSwapChainRTV() m_window_info.surface_width = swap_chain_desc.BufferDesc.Width; m_window_info.surface_height = swap_chain_desc.BufferDesc.Height; - DevCon.WriteLn("Swap chain buffer size: %ux%u", m_window_info.surface_width, m_window_info.surface_height); + DevCon.WriteLn("D3D12: Swap chain buffer size: %ux%u", m_window_info.surface_width, m_window_info.surface_height); if (m_window_info.type == WindowInfo::Type::Win32) { @@ -998,7 +998,7 @@ bool GSDevice12::UpdateWindow() if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain()) { - Console.WriteLn("Failed to create swap chain on updated window"); + Console.WriteLn("D3D12: Failed to create swap chain on updated window"); return false; } @@ -1066,7 +1066,7 @@ void GSDevice12::ResizeWindow(s32 new_window_width, s32 new_window_height, float HRESULT hr = m_swap_chain->ResizeBuffers( 0, 0, 0, DXGI_FORMAT_UNKNOWN, m_using_allow_tearing ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0); if (FAILED(hr)) - Console.Error("ResizeBuffers() failed: 0x%08X", hr); + Console.Error("D3D12: ResizeBuffers() failed: 0x%08X", hr); if (!CreateSwapChainRTV()) pxFailRel("Failed to recreate swap chain RTV after resize"); @@ -1931,7 +1931,7 @@ bool GSDevice12::CompileCASPipelines() m_cas_sharpen_pipeline = cpb.Create(m_device.get(), m_shader_cache, false); if (!m_cas_upscale_pipeline || !m_cas_sharpen_pipeline) { - Console.Error("Failed to create CAS pipelines"); + Console.Error("D3D12: Failed to create CAS pipelines"); return false; } @@ -1943,7 +1943,7 @@ bool GSDevice12::CompileImGuiPipeline() const std::optional hlsl = ReadShaderSource("shaders/dx11/imgui.fx"); if (!hlsl.has_value()) { - Console.Error("Failed to read imgui.fx"); + Console.Error("D3D12: Failed to read imgui.fx"); return false; } @@ -1951,7 +1951,7 @@ bool GSDevice12::CompileImGuiPipeline() const ComPtr ps = m_shader_cache.GetPixelShader(hlsl.value(), nullptr, "ps_main"); if (!vs || !ps) { - Console.Error("Failed to compile ImGui shaders"); + Console.Error("D3D12: Failed to compile ImGui shaders"); return false; } @@ -1972,7 +1972,7 @@ bool GSDevice12::CompileImGuiPipeline() m_imgui_pipeline = gpb.Create(m_device.get(), m_shader_cache, false); if (!m_imgui_pipeline) { - Console.Error("Failed to compile ImGui pipeline"); + Console.Error("D3D12: Failed to compile ImGui pipeline"); return false; } @@ -2015,7 +2015,7 @@ void GSDevice12::RenderImGui() // just skip if we run out.. we can't resume the present render pass :/ if (!GetSamplerAllocator().LookupSingle(&m_utility_sampler_gpu, m_linear_sampler_cpu)) { - Console.Warning("Skipping ImGui draw because of no descriptors"); + Console.Warning("D3D12: Skipping ImGui draw because of no descriptors"); return; } } @@ -2032,7 +2032,7 @@ void GSDevice12::RenderImGui() const u32 size = sizeof(ImDrawVert) * static_cast(cmd_list->VtxBuffer.Size); if (!m_vertex_stream_buffer.ReserveMemory(size, sizeof(ImDrawVert))) { - Console.Warning("Skipping ImGui draw because of no vertex buffer space"); + Console.Warning("D3D12: Skipping ImGui draw because of no vertex buffer space"); return; } @@ -2072,7 +2072,7 @@ void GSDevice12::RenderImGui() if (!GetTextureGroupDescriptors(&m_utility_texture_gpu, &handle, 1)) { - Console.Warning("Skipping ImGui draw because of no descriptors"); + Console.Warning("D3D12: Skipping ImGui draw because of no descriptors"); return; } } @@ -2103,7 +2103,7 @@ bool GSDevice12::DoCAS( if (!GetTextureGroupDescriptors(&sTexDH, &sTex12->GetSRVDescriptor(), 1) || !GetTextureGroupDescriptors(&dTexDH, &dTex12->GetUAVDescriptor(), 1)) { - Console.Error("Failed to allocate CAS descriptors."); + Console.Error("D3D12: Failed to allocate CAS descriptors."); return false; } } @@ -3567,7 +3567,7 @@ bool GSDevice12::ApplyTFXState(bool already_execed) { if (already_execed) { - Console.Error("Failed to reserve vertex uniform space"); + Console.Error("D3D12: Failed to reserve vertex uniform space"); return false; } @@ -3588,7 +3588,7 @@ bool GSDevice12::ApplyTFXState(bool already_execed) { if (already_execed) { - Console.Error("Failed to reserve pixel uniform space"); + Console.Error("D3D12: Failed to reserve pixel uniform space"); return false; } @@ -3846,7 +3846,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config) date_image = SetupPrimitiveTrackingDATE(config, pipe); if (!date_image) { - Console.WriteLn("Failed to allocate DATE image, aborting draw."); + Console.WriteLn("D3D12: Failed to allocate DATE image, aborting draw."); return; } } @@ -3874,7 +3874,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config) hdr_rt = static_cast(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor, false)); if (!hdr_rt) { - Console.WriteLn("Failed to allocate HDR render target, aborting draw."); + Console.WriteLn("D3D12: Failed to allocate HDR render target, aborting draw."); if (date_image) Recycle(date_image); return;