mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
General: Convert PanicAlerts over to fmt equivalent
Converts lingering panic alert calls over to the fmt-capable ones.
This commit is contained in:
@@ -43,7 +43,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
if (!s_d3d11_library.Open("d3d11.dll") ||
|
||||
!s_d3d11_library.GetSymbol("D3D11CreateDevice", &d3d11_create_device))
|
||||
{
|
||||
PanicAlertT("Failed to load d3d11.dll");
|
||||
PanicAlertFmtT("Failed to load d3d11.dll");
|
||||
s_d3d11_library.Close();
|
||||
return false;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
dxgi_factory = D3DCommon::CreateDXGIFactory(enable_debug_layer);
|
||||
if (!dxgi_factory)
|
||||
{
|
||||
PanicAlertT("Failed to create DXGI factory");
|
||||
PanicAlertFmtT("Failed to create DXGI factory");
|
||||
D3DCommon::UnloadLibraries();
|
||||
s_d3d11_library.Close();
|
||||
return false;
|
||||
@@ -113,7 +113,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlertT(
|
||||
PanicAlertFmtT(
|
||||
"Failed to initialize Direct3D.\nMake sure your video card supports at least D3D 10.0");
|
||||
dxgi_factory.Reset();
|
||||
D3DCommon::UnloadLibraries();
|
||||
|
||||
@@ -45,8 +45,8 @@ std::unique_ptr<DXTexture> DXTexture::Create(const TextureConfig& config)
|
||||
HRESULT hr = D3D::device->CreateTexture2D(&desc, nullptr, d3d_texture.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("Failed to create %ux%ux%u D3D backing texture", config.width, config.height,
|
||||
config.layers);
|
||||
PanicAlertFmt("Failed to create {}x{}x{} D3D backing texture", config.width, config.height,
|
||||
config.layers);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ bool DXTexture::CreateSRV()
|
||||
HRESULT hr = D3D::device->CreateShaderResourceView(m_texture.Get(), &desc, m_srv.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("Failed to create %ux%ux%u D3D SRV", m_config.width, m_config.height,
|
||||
m_config.layers);
|
||||
PanicAlertFmt("Failed to create {}x{}x{} D3D SRV", m_config.width, m_config.height,
|
||||
m_config.layers);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -109,8 +109,8 @@ bool DXTexture::CreateUAV()
|
||||
HRESULT hr = D3D::device->CreateUnorderedAccessView(m_texture.Get(), &desc, m_uav.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("Failed to create %ux%ux%u D3D UAV", m_config.width, m_config.height,
|
||||
m_config.layers);
|
||||
PanicAlertFmt("Failed to create {}x{}x{} D3D UAV", m_config.width, m_config.height,
|
||||
m_config.layers);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ DXGI_FORMAT VarToD3D(VarType t, int size, bool integer)
|
||||
DXGI_FORMAT retval = d3d_format_lookup[(int)t + 5 * (size - 1) + 5 * 4 * (int)integer];
|
||||
if (retval == DXGI_FORMAT_UNKNOWN)
|
||||
{
|
||||
PanicAlert("VarToD3D: Invalid type/size combo %i , %i, %i", (int)t, size, (int)integer);
|
||||
PanicAlertFmt("VarToD3D: Invalid type/size combo {}, {}, {}", t, size, integer);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
std::unique_ptr<SwapChain> swap_chain;
|
||||
if (wsi.render_surface && !(swap_chain = SwapChain::Create(wsi)))
|
||||
{
|
||||
PanicAlertT("Failed to create D3D swap chain");
|
||||
PanicAlertFmtT("Failed to create D3D swap chain");
|
||||
ShutdownShared();
|
||||
D3D::Destroy();
|
||||
return false;
|
||||
|
||||
@@ -152,7 +152,7 @@ void BoundingBox::Flush()
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!m_upload_buffer.ReserveMemory(copy_size, sizeof(ValueType)))
|
||||
{
|
||||
PanicAlert("Failed to allocate bbox stream buffer space");
|
||||
PanicAlertFmt("Failed to allocate bbox stream buffer space");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ bool DXContext::Create(u32 adapter_index, bool enable_debug_layer)
|
||||
!s_d3d12_library.GetSymbol("D3D12GetDebugInterface", &s_d3d12_get_debug_interface) ||
|
||||
!s_d3d12_library.GetSymbol("D3D12SerializeRootSignature", &s_d3d12_serialize_root_signature))
|
||||
{
|
||||
PanicAlertT("d3d12.dll could not be loaded.");
|
||||
PanicAlertFmtT("d3d12.dll could not be loaded.");
|
||||
s_d3d12_library.Close();
|
||||
return false;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ bool DXContext::CreateDescriptorHeaps()
|
||||
|
||||
if (!m_descriptor_heap_manager.Allocate(&m_null_srv_descriptor))
|
||||
{
|
||||
PanicAlert("Failed to allocate null descriptor");
|
||||
PanicAlertFmt("Failed to allocate null descriptor");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -303,8 +303,8 @@ static bool BuildRootSignature(ID3D12Device* device, ID3D12RootSignature** sig_p
|
||||
&root_signature_blob, &root_signature_error_blob);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("Failed to serialize root signature: %s",
|
||||
static_cast<const char*>(root_signature_error_blob->GetBufferPointer()));
|
||||
PanicAlertFmt("Failed to serialize root signature: {}",
|
||||
static_cast<const char*>(root_signature_error_blob->GetBufferPointer()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ bool DXContext::CreateTextureUploadBuffer()
|
||||
{
|
||||
if (!m_texture_upload_buffer.AllocateBuffer(TEXTURE_UPLOAD_BUFFER_SIZE))
|
||||
{
|
||||
PanicAlert("Failed to create texture upload buffer");
|
||||
PanicAlertFmt("Failed to create texture upload buffer");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ bool DXContext::CreateCommandLists()
|
||||
nullptr, IID_PPV_ARGS(res.command_list.GetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("Failed to create command list.");
|
||||
PanicAlertFmt("Failed to create command list.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ void DXContext::RecreateGXRootSignature()
|
||||
{
|
||||
m_gx_root_signature.Reset();
|
||||
if (!CreateGXRootSignature())
|
||||
PanicAlert("Failed to re-create GX root signature.");
|
||||
PanicAlertFmt("Failed to re-create GX root signature.");
|
||||
}
|
||||
|
||||
void DXContext::DestroyPendingResources(CommandListResources& cmdlist)
|
||||
|
||||
@@ -171,7 +171,7 @@ std::unique_ptr<DXPipeline> DXPipeline::Create(const AbstractPipelineConfig& con
|
||||
desc.pRootSignature = g_dx_context->GetUtilityRootSignature();
|
||||
break;
|
||||
default:
|
||||
PanicAlert("Unknown pipeline layout.");
|
||||
PanicAlertFmt("Unknown pipeline layout.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ std::unique_ptr<DXTexture> DXTexture::CreateAdopted(ID3D12Resource* resource)
|
||||
if (desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D ||
|
||||
format == AbstractTextureFormat::Undefined)
|
||||
{
|
||||
PanicAlert("Unknown format for adopted texture");
|
||||
PanicAlertFmt("Unknown format for adopted texture");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ bool DXTexture::CreateSRVDescriptor()
|
||||
{
|
||||
if (!g_dx_context->GetDescriptorHeapManager().Allocate(&m_srv_descriptor))
|
||||
{
|
||||
PanicAlert("Failed to allocate SRV descriptor");
|
||||
PanicAlertFmt("Failed to allocate SRV descriptor");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ bool DXTexture::CreateUAVDescriptor()
|
||||
{
|
||||
if (!g_dx_context->GetDescriptorHeapManager().Allocate(&m_uav_descriptor))
|
||||
{
|
||||
PanicAlert("Failed to allocate UAV descriptor");
|
||||
PanicAlertFmt("Failed to allocate UAV descriptor");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ void DXTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8*
|
||||
staging_buffer = CreateTextureUploadBuffer(upload_size);
|
||||
if (!staging_buffer || FAILED(staging_buffer->Map(0, &read_range, &upload_buffer_ptr)))
|
||||
{
|
||||
PanicAlert("Failed to allocate/map temporary texture upload buffer");
|
||||
PanicAlertFmt("Failed to allocate/map temporary texture upload buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ void DXTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8*
|
||||
if (!g_dx_context->GetTextureUploadBuffer().ReserveMemory(
|
||||
upload_size, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT))
|
||||
{
|
||||
PanicAlert("Failed to allocate texture upload buffer");
|
||||
PanicAlertFmt("Failed to allocate texture upload buffer");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -436,7 +436,7 @@ bool DXFramebuffer::CreateRTVDescriptor()
|
||||
{
|
||||
if (!g_dx_context->GetRTVHeapManager().Allocate(&m_rtv_descriptor))
|
||||
{
|
||||
PanicAlert("Failed to allocate RTV descriptor");
|
||||
PanicAlertFmt("Failed to allocate RTV descriptor");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ bool DXFramebuffer::CreateDSVDescriptor()
|
||||
{
|
||||
if (!g_dx_context->GetDSVHeapManager().Allocate(&m_dsv_descriptor))
|
||||
{
|
||||
PanicAlert("Failed to allocate RTV descriptor");
|
||||
PanicAlertFmt("Failed to allocate RTV descriptor");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ bool DescriptorHeapManager::Allocate(DescriptorHandle* handle)
|
||||
return true;
|
||||
}
|
||||
|
||||
PanicAlert("Out of fixed descriptors");
|
||||
PanicAlertFmt("Out of fixed descriptors");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ bool StreamBuffer::ReserveMemory(u32 num_bytes, u32 alignment)
|
||||
// Check for sane allocations
|
||||
if (required_bytes > m_size)
|
||||
{
|
||||
PanicAlert("Attempting to allocate %u bytes from a %u byte stream buffer",
|
||||
static_cast<uint32_t>(num_bytes), static_cast<uint32_t>(m_size));
|
||||
PanicAlertFmt("Attempting to allocate {} bytes from a {} byte stream buffer", num_bytes,
|
||||
m_size);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ bool VertexManager::Initialize()
|
||||
!m_uniform_stream_buffer.AllocateBuffer(UNIFORM_STREAM_BUFFER_SIZE) ||
|
||||
!m_texel_stream_buffer.AllocateBuffer(TEXEL_STREAM_BUFFER_SIZE))
|
||||
{
|
||||
PanicAlert("Failed to allocate streaming buffers");
|
||||
PanicAlertFmt("Failed to allocate streaming buffers");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ bool VertexManager::Initialize()
|
||||
DescriptorHandle& dh = m_texel_buffer_views[it.first];
|
||||
if (!g_dx_context->GetDescriptorHeapManager().Allocate(&dh))
|
||||
{
|
||||
PanicAlert("Failed to allocate descriptor for texel buffer");
|
||||
PanicAlertFmt("Failed to allocate descriptor for texel buffer");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ void VertexManager::ResetBuffer(u32 vertex_stride)
|
||||
|
||||
// If we still failed, that means the allocation was too large and will never succeed, so panic
|
||||
if (!has_vbuffer_allocation || !has_ibuffer_allocation)
|
||||
PanicAlert("Failed to allocate space in streaming buffers for pending draw");
|
||||
PanicAlertFmt("Failed to allocate space in streaming buffers for pending draw");
|
||||
}
|
||||
|
||||
// Update pointers
|
||||
@@ -208,7 +208,7 @@ void VertexManager::UploadAllConstants()
|
||||
if (!m_uniform_stream_buffer.ReserveMemory(allocation_size,
|
||||
D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT))
|
||||
{
|
||||
PanicAlert("Failed to allocate space for constants in streaming buffer");
|
||||
PanicAlertFmt("Failed to allocate space for constants in streaming buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ bool VertexManager::UploadTexelBuffer(const void* data, u32 data_size, TexelBuff
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!m_texel_stream_buffer.ReserveMemory(data_size, elem_size))
|
||||
{
|
||||
PanicAlert("Failed to allocate %u bytes from texel buffer", data_size);
|
||||
PanicAlertFmt("Failed to allocate {} bytes from texel buffer", data_size);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -300,7 +300,7 @@ bool VertexManager::UploadTexelBuffer(const void* data, u32 data_size, TexelBuff
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!m_texel_stream_buffer.ReserveMemory(reserve_size, elem_size))
|
||||
{
|
||||
PanicAlert("Failed to allocate %u bytes from texel buffer", reserve_size);
|
||||
PanicAlertFmt("Failed to allocate {} bytes from texel buffer", reserve_size);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
{
|
||||
if (!DXContext::Create(g_Config.iAdapter, g_Config.bEnableValidationLayer))
|
||||
{
|
||||
PanicAlert("Failed to create D3D12 context");
|
||||
PanicAlertFmtT("Failed to create D3D12 context");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
|
||||
if (!g_dx_context->CreateGlobalResources())
|
||||
{
|
||||
PanicAlert("Failed to create D3D12 global resources");
|
||||
PanicAlertFmtT("Failed to create D3D12 global resources");
|
||||
DXContext::Destroy();
|
||||
ShutdownShared();
|
||||
return false;
|
||||
@@ -118,7 +118,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
std::unique_ptr<SwapChain> swap_chain;
|
||||
if (wsi.render_surface && !(swap_chain = SwapChain::Create(wsi)))
|
||||
{
|
||||
PanicAlertT("Failed to create D3D swap chain");
|
||||
PanicAlertFmtT("Failed to create D3D swap chain");
|
||||
DXContext::Destroy();
|
||||
ShutdownShared();
|
||||
return false;
|
||||
@@ -136,7 +136,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
!g_renderer->Initialize() || !g_framebuffer_manager->Initialize() ||
|
||||
!g_texture_cache->Initialize() || !PerfQuery::GetInstance()->Initialize())
|
||||
{
|
||||
PanicAlert("Failed to initialize renderer classes");
|
||||
PanicAlertFmtT("Failed to initialize renderer classes");
|
||||
Shutdown();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,15 +33,15 @@ bool LoadLibraries()
|
||||
|
||||
if (!s_dxgi_library.Open("dxgi.dll"))
|
||||
{
|
||||
PanicAlertT("Failed to load dxgi.dll");
|
||||
PanicAlertFmtT("Failed to load dxgi.dll");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!s_d3dcompiler_library.Open(D3DCOMPILER_DLL_A))
|
||||
{
|
||||
PanicAlertT("Failed to load %s. If you are using Windows 7, try installing the "
|
||||
"KB4019990 update package.",
|
||||
D3DCOMPILER_DLL_A);
|
||||
PanicAlertFmtT("Failed to load {0}. If you are using Windows 7, try installing the "
|
||||
"KB4019990 update package.",
|
||||
D3DCOMPILER_DLL_A);
|
||||
s_dxgi_library.Close();
|
||||
return false;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ bool LoadLibraries()
|
||||
if (!s_d3dcompiler_library.GetSymbol("D3DCompile", &d3d_compile) ||
|
||||
!s_dxgi_library.GetSymbol("CreateDXGIFactory", &create_dxgi_factory))
|
||||
{
|
||||
PanicAlertT("Failed to find one or more D3D symbols");
|
||||
PanicAlertFmtT("Failed to find one or more D3D symbols");
|
||||
s_d3dcompiler_library.Close();
|
||||
s_dxgi_library.Close();
|
||||
return false;
|
||||
@@ -88,7 +88,7 @@ Microsoft::WRL::ComPtr<IDXGIFactory> CreateDXGIFactory(bool debug_device)
|
||||
HRESULT hr = create_dxgi_factory(IID_PPV_ARGS(factory.ReleaseAndGetAddressOf()));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("CreateDXGIFactory() failed with HRESULT %08X", hr);
|
||||
PanicAlertFmt("CreateDXGIFactory() failed with HRESULT {:08X}", hr);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ DXGI_FORMAT GetDXGIFormatForAbstractFormat(AbstractTextureFormat format, bool ty
|
||||
case AbstractTextureFormat::D32F_S8:
|
||||
return DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS;
|
||||
default:
|
||||
PanicAlert("Unhandled texture format.");
|
||||
PanicAlertFmt("Unhandled texture format.");
|
||||
return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ DXGI_FORMAT GetSRVFormatForAbstractFormat(AbstractTextureFormat format)
|
||||
case AbstractTextureFormat::D32F_S8:
|
||||
return DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS;
|
||||
default:
|
||||
PanicAlert("Unhandled SRV format");
|
||||
PanicAlertFmt("Unhandled SRV format");
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ DXGI_FORMAT GetRTVFormatForAbstractFormat(AbstractTextureFormat format, bool int
|
||||
case AbstractTextureFormat::R32F:
|
||||
return DXGI_FORMAT_R32_FLOAT;
|
||||
default:
|
||||
PanicAlert("Unhandled RTV format");
|
||||
PanicAlertFmt("Unhandled RTV format");
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ DXGI_FORMAT GetDSVFormatForAbstractFormat(AbstractTextureFormat format)
|
||||
case AbstractTextureFormat::D32F_S8:
|
||||
return DXGI_FORMAT_D32_FLOAT_S8X24_UINT;
|
||||
default:
|
||||
PanicAlert("Unhandled DSV format");
|
||||
PanicAlertFmt("Unhandled DSV format");
|
||||
return DXGI_FORMAT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ std::optional<Shader::BinaryData> Shader::CompileShader(D3D_FEATURE_LEVEL featur
|
||||
file << "Video Backend: " + g_video_backend->GetDisplayName();
|
||||
file.close();
|
||||
|
||||
PanicAlert("Failed to compile %s:\nDebug info (%s):\n%s", filename.c_str(), target,
|
||||
static_cast<const char*>(errors->GetBufferPointer()));
|
||||
PanicAlertFmt("Failed to compile {}:\nDebug info ({}):\n{}", filename, target,
|
||||
static_cast<const char*>(errors->GetBufferPointer()));
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ bool SwapChain::CreateSwapChain(bool stereo)
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlert("Failed to create swap chain with HRESULT %08X", hr);
|
||||
PanicAlertFmt("Failed to create swap chain with HRESULT {:08X}", hr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ bool SwapChain::CreateSwapChain(bool stereo)
|
||||
m_stereo = stereo;
|
||||
if (!CreateSwapChainBuffers())
|
||||
{
|
||||
PanicAlert("Failed to create swap chain buffers");
|
||||
PanicAlertFmt("Failed to create swap chain buffers");
|
||||
DestroySwapChainBuffers();
|
||||
m_swap_chain.Reset();
|
||||
return false;
|
||||
@@ -187,7 +187,7 @@ void SwapChain::SetStereo(bool stereo)
|
||||
DestroySwapChain();
|
||||
if (!CreateSwapChain(stereo))
|
||||
{
|
||||
PanicAlert("Failed to switch swap chain stereo mode");
|
||||
PanicAlertFmt("Failed to switch swap chain stereo mode");
|
||||
CreateSwapChain(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
!g_renderer->Initialize() || !g_framebuffer_manager->Initialize() ||
|
||||
!g_texture_cache->Initialize())
|
||||
{
|
||||
PanicAlert("Failed to initialize renderer classes");
|
||||
PanicAlertFmt("Failed to initialize renderer classes");
|
||||
Shutdown();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,11 +48,11 @@ static void SetPointer(u32 attrib, u32 stride, const AttributeFormat& format)
|
||||
GLVertexFormat::GLVertexFormat(const PortableVertexDeclaration& vtx_decl)
|
||||
: NativeVertexFormat(vtx_decl)
|
||||
{
|
||||
u32 vertex_stride = vtx_decl.stride;
|
||||
const u32 vertex_stride = vtx_decl.stride;
|
||||
|
||||
// We will not allow vertex components causing uneven strides.
|
||||
if (vertex_stride & 3)
|
||||
PanicAlert("Uneven vertex stride: %i", vertex_stride);
|
||||
PanicAlertFmt("Uneven vertex stride: {}", vertex_stride);
|
||||
|
||||
VertexManager* const vm = static_cast<VertexManager*>(g_vertex_manager.get());
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ GLenum GetGLInternalFormatForTextureFormat(AbstractTextureFormat format, bool st
|
||||
case AbstractTextureFormat::D32F_S8:
|
||||
return GL_DEPTH32F_STENCIL8;
|
||||
default:
|
||||
PanicAlert("Unhandled texture format.");
|
||||
PanicAlertFmt("Unhandled texture format.");
|
||||
return storage ? GL_RGBA8 : GL_RGBA;
|
||||
}
|
||||
}
|
||||
@@ -216,12 +216,15 @@ void OGLTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8
|
||||
size_t buffer_size)
|
||||
{
|
||||
if (level >= m_config.levels)
|
||||
PanicAlert("Texture only has %d levels, can't update level %d", m_config.levels, level);
|
||||
if (width != std::max(1u, m_config.width >> level) ||
|
||||
height != std::max(1u, m_config.height >> level))
|
||||
PanicAlert("size of level %d must be %dx%d, but %dx%d requested", level,
|
||||
std::max(1u, m_config.width >> level), std::max(1u, m_config.height >> level), width,
|
||||
height);
|
||||
PanicAlertFmt("Texture only has {} levels, can't update level {}", m_config.levels, level);
|
||||
|
||||
const auto expected_width = std::max(1U, m_config.width >> level);
|
||||
const auto expected_height = std::max(1U, m_config.height >> level);
|
||||
if (width != expected_width || height != expected_height)
|
||||
{
|
||||
PanicAlertFmt("Size of level {} must be {}x{}, but {}x{} requested", level, expected_width,
|
||||
expected_height, width, height);
|
||||
}
|
||||
|
||||
const GLenum target = GetGLTarget();
|
||||
glActiveTexture(GL_MUTABLE_TEXTURE_INDEX);
|
||||
|
||||
@@ -368,10 +368,10 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, std::s
|
||||
file << "Video Backend: " + g_video_backend->GetDisplayName();
|
||||
file.close();
|
||||
|
||||
PanicAlert("Failed to compile %s shader: %s\n"
|
||||
"Debug info (%s, %s, %s):\n%s",
|
||||
prefix, filename.c_str(), g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
||||
g_ogl_config.gl_version, info_log.c_str());
|
||||
PanicAlertFmt("Failed to compile {} shader: {}\n"
|
||||
"Debug info ({}, {}, {}):\n{}",
|
||||
prefix, filename, g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
||||
g_ogl_config.gl_version, info_log);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -413,10 +413,10 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, std::string_view vcod
|
||||
file << "Video Backend: " + g_video_backend->GetDisplayName();
|
||||
file.close();
|
||||
|
||||
PanicAlert("Failed to link shaders: %s\n"
|
||||
"Debug info (%s, %s, %s):\n%s",
|
||||
filename.c_str(), g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
||||
g_ogl_config.gl_version, info_log.c_str());
|
||||
PanicAlertFmt("Failed to link shaders: {}\n"
|
||||
"Debug info ({}, {}, {}):\n{}",
|
||||
filename, g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
||||
g_ogl_config.gl_version, info_log);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -847,7 +847,7 @@ bool SharedContextAsyncShaderCompiler::WorkerThreadInitMainThread(void** param)
|
||||
static_cast<Renderer*>(g_renderer.get())->GetMainGLContext()->CreateSharedContext();
|
||||
if (!context)
|
||||
{
|
||||
PanicAlert("Failed to create shared context for shader compiling.");
|
||||
PanicAlertFmt("Failed to create shared context for shader compiling.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -357,8 +357,8 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
{
|
||||
// We want the ogl3 framebuffer instead of the ogl2 one for better blitting support.
|
||||
// It's also compatible with the gles3 one.
|
||||
PanicAlert("GPU: ERROR: Need GL_ARB_framebuffer_object for multiple render targets.\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?");
|
||||
PanicAlertFmtT("GPU: ERROR: Need GL_ARB_framebuffer_object for multiple render targets.\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
@@ -366,8 +366,8 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
{
|
||||
// This extension is used to replace lots of pointer setting function.
|
||||
// Also gles3 requires to use it.
|
||||
PanicAlert("GPU: OGL ERROR: Need GL_ARB_vertex_array_object.\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?");
|
||||
PanicAlertFmtT("GPU: OGL ERROR: Need GL_ARB_vertex_array_object.\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
@@ -375,8 +375,8 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
{
|
||||
// ogl3 buffer mapping for better streaming support.
|
||||
// The ogl2 one also isn't in gles3.
|
||||
PanicAlert("GPU: OGL ERROR: Need GL_ARB_map_buffer_range.\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?");
|
||||
PanicAlertFmtT("GPU: OGL ERROR: Need GL_ARB_map_buffer_range.\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
@@ -384,13 +384,13 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
{
|
||||
// ubo allow us to keep the current constants on shader switches
|
||||
// we also can stream them much nicer and pack into it whatever we want to
|
||||
PanicAlert("GPU: OGL ERROR: Need GL_ARB_uniform_buffer_object.\n"
|
||||
"GPU: Does your video card support OpenGL 3.1?");
|
||||
PanicAlertFmtT("GPU: OGL ERROR: Need GL_ARB_uniform_buffer_object.\n"
|
||||
"GPU: Does your video card support OpenGL 3.1?");
|
||||
bSuccess = false;
|
||||
}
|
||||
else if (DriverDetails::HasBug(DriverDetails::BUG_BROKEN_UBO))
|
||||
{
|
||||
PanicAlert(
|
||||
PanicAlertFmtT(
|
||||
"Buggy GPU driver detected.\n"
|
||||
"Please either install the closed-source GPU driver or update your Mesa 3D version.");
|
||||
bSuccess = false;
|
||||
@@ -400,8 +400,8 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
{
|
||||
// Our sampler cache uses this extension. It could easyly be workaround and it's by far the
|
||||
// highest requirement, but it seems that no driver lacks support for it.
|
||||
PanicAlert("GPU: OGL ERROR: Need GL_ARB_sampler_objects.\n"
|
||||
"GPU: Does your video card support OpenGL 3.3?");
|
||||
PanicAlertFmtT("GPU: OGL ERROR: Need GL_ARB_sampler_objects.\n"
|
||||
"GPU: Does your video card support OpenGL 3.3?");
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
@@ -588,10 +588,10 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
{
|
||||
if (GLExtensions::Version() < 300)
|
||||
{
|
||||
PanicAlert("GPU: OGL ERROR: Need at least GLSL 1.30\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?\n"
|
||||
"GPU: Your driver supports GLSL %s",
|
||||
(const char*)glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||
PanicAlertFmtT("GPU: OGL ERROR: Need at least GLSL 1.30\n"
|
||||
"GPU: Does your video card support OpenGL 3.0?\n"
|
||||
"GPU: Your driver supports GLSL {0}",
|
||||
reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
|
||||
bSuccess = false;
|
||||
}
|
||||
else if (GLExtensions::Version() == 300)
|
||||
@@ -718,10 +718,11 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
// MSAA on default framebuffer isn't working because of glBlitFramebuffer.
|
||||
// It also isn't useful as we don't render anything to the default framebuffer.
|
||||
// We also try to get a non-msaa fb, so this only happens when forced by the driver.
|
||||
PanicAlertT("The graphics driver is forcibly enabling anti-aliasing for Dolphin. You need to "
|
||||
"turn this off in the graphics driver's settings in order for Dolphin to work.\n\n"
|
||||
"(MSAA with %d samples found on default framebuffer)",
|
||||
samples);
|
||||
PanicAlertFmtT(
|
||||
"The graphics driver is forcibly enabling anti-aliasing for Dolphin. You need to "
|
||||
"turn this off in the graphics driver's settings in order for Dolphin to work.\n\n"
|
||||
"(MSAA with {0} samples found on default framebuffer)",
|
||||
samples);
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user