mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Merge pull request #9236 from lioncash/log-backend
VideoBackends: Migrate logging over to fmt
This commit is contained in:
@@ -67,7 +67,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
HRESULT hr = dxgi_factory->EnumAdapters(adapter_index, adapter.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN_LOG(VIDEO, "Adapter %u not found, using default", adapter_index);
|
||||
WARN_LOG_FMT(VIDEO, "Adapter {} not found, using default", adapter_index);
|
||||
adapter = nullptr;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
}
|
||||
else
|
||||
{
|
||||
WARN_LOG(VIDEO, "Debug layer requested but not available.");
|
||||
WARN_LOG_FMT(VIDEO, "Debug layer requested but not available.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
hr = device.As(&device1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN_LOG(VIDEO, "Missing Direct3D 11.1 support. Logical operations will not be supported.");
|
||||
WARN_LOG_FMT(VIDEO, "Missing Direct3D 11.1 support. Logical operations will not be supported.");
|
||||
}
|
||||
|
||||
stateman = std::make_unique<StateManager>();
|
||||
@@ -156,9 +156,9 @@ void Destroy()
|
||||
}
|
||||
|
||||
if (remaining_references)
|
||||
ERROR_LOG(VIDEO, "Unreleased references: %i.", remaining_references);
|
||||
ERROR_LOG_FMT(VIDEO, "Unreleased references: {}.", remaining_references);
|
||||
else
|
||||
NOTICE_LOG(VIDEO, "Successfully released all device references!");
|
||||
NOTICE_LOG_FMT(VIDEO, "Successfully released all device references!");
|
||||
|
||||
dxgi_factory.Reset();
|
||||
D3DCommon::UnloadLibraries();
|
||||
|
||||
@@ -386,7 +386,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state)
|
||||
{
|
||||
return m_blend.emplace(state.hex, std::move(res)).first->second.Get();
|
||||
}
|
||||
WARN_LOG(VIDEO, "Creating D3D blend state failed with an error: %x", hr);
|
||||
WARN_LOG_FMT(VIDEO, "Creating D3D blend state failed with an error: {:08X}", hr);
|
||||
}
|
||||
|
||||
D3D11_BLEND_DESC desc = {};
|
||||
|
||||
@@ -35,7 +35,7 @@ void PerfQuery::EnableQuery(PerfQueryGroup type)
|
||||
{
|
||||
// TODO
|
||||
FlushOne();
|
||||
ERROR_LOG(VIDEO, "Flushed query buffer early!");
|
||||
ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
||||
}
|
||||
|
||||
// start query
|
||||
|
||||
@@ -148,7 +148,7 @@ void BoundingBox::Flush()
|
||||
const u32 copy_size = (end - start) * sizeof(ValueType);
|
||||
if (!m_upload_buffer.ReserveMemory(copy_size, sizeof(ValueType)))
|
||||
{
|
||||
WARN_LOG(VIDEO, "Executing command list while waiting for space in bbox stream buffer");
|
||||
WARN_LOG_FMT(VIDEO, "Executing command list while waiting for space in bbox stream buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!m_upload_buffer.ReserveMemory(copy_size, sizeof(ValueType)))
|
||||
{
|
||||
|
||||
@@ -152,7 +152,7 @@ bool DXContext::CreateDevice(u32 adapter_index, bool enable_debug_layer)
|
||||
HRESULT hr = m_dxgi_factory->EnumAdapters(adapter_index, &adapter);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Adapter %u not found, using default", adapter_index);
|
||||
ERROR_LOG_FMT(VIDEO, "Adapter {} not found, using default", adapter_index);
|
||||
adapter = nullptr;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ bool DXContext::CreateDevice(u32 adapter_index, bool enable_debug_layer)
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Debug layer requested but not available.");
|
||||
ERROR_LOG_FMT(VIDEO, "Debug layer requested but not available.");
|
||||
enable_debug_layer = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,8 +210,8 @@ std::unique_ptr<DXPipeline> DXPipeline::Create(const AbstractPipelineConfig& con
|
||||
HRESULT hr = g_dx_context->GetDevice()->CreateGraphicsPipelineState(&desc, IID_PPV_ARGS(&pso));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN_LOG(VIDEO, "CreateGraphicsPipelineState() %sfailed with HRESULT %08X",
|
||||
cache_data ? "with cache data " : "", hr);
|
||||
WARN_LOG_FMT(VIDEO, "CreateGraphicsPipelineState() {}failed with HRESULT {:08X}",
|
||||
cache_data ? "with cache data " : "", hr);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ AbstractPipeline::CacheData DXPipeline::GetCacheData() const
|
||||
HRESULT hr = m_pipeline->GetCachedBlob(&blob);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN_LOG(VIDEO, "ID3D12Pipeline::GetCachedBlob() failed with HRESULT %08X", hr);
|
||||
WARN_LOG_FMT(VIDEO, "ID3D12Pipeline::GetCachedBlob() failed with HRESULT {:08X}", hr);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,8 @@ 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))
|
||||
{
|
||||
WARN_LOG(VIDEO, "Executing command list while waiting for space in texture upload buffer");
|
||||
WARN_LOG_FMT(VIDEO,
|
||||
"Executing command list while waiting for space in texture upload buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!g_dx_context->GetTextureUploadBuffer().ReserveMemory(
|
||||
upload_size, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT))
|
||||
|
||||
@@ -148,7 +148,7 @@ bool SamplerHeapManager::Lookup(const SamplerState& ss, D3D12_CPU_DESCRIPTOR_HAN
|
||||
{
|
||||
// We can clear at any time because the descriptors are copied prior to execution.
|
||||
// It's still not free, since we have to recreate all our samplers again.
|
||||
WARN_LOG(VIDEO, "Out of samplers, resetting CPU heap");
|
||||
WARN_LOG_FMT(VIDEO, "Out of samplers, resetting CPU heap");
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -653,8 +653,8 @@ void Renderer::UpdateDescriptorTables()
|
||||
const bool uav_update_failed = (m_dirty_bits & DirtyState_PS_UAV) && !UpdateUAVDescriptorTable();
|
||||
if (texture_update_failed || sampler_update_failed || uav_update_failed)
|
||||
{
|
||||
WARN_LOG(VIDEO, "Executing command list while waiting for temporary %s",
|
||||
texture_update_failed ? "descriptors" : "samplers");
|
||||
WARN_LOG_FMT(VIDEO, "Executing command list while waiting for temporary {}",
|
||||
texture_update_failed ? "descriptors" : "samplers");
|
||||
ExecuteCommandList(false);
|
||||
SetRootSignatures();
|
||||
SetDescriptorHeaps();
|
||||
|
||||
@@ -80,7 +80,7 @@ void VertexManager::ResetBuffer(u32 vertex_stride)
|
||||
if (!has_vbuffer_allocation || !has_ibuffer_allocation)
|
||||
{
|
||||
// Flush any pending commands first, so that we can wait on the fences
|
||||
WARN_LOG(VIDEO, "Executing command list while waiting for space in vertex/index buffer");
|
||||
WARN_LOG_FMT(VIDEO, "Executing command list while waiting for space in vertex/index buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
|
||||
// Attempt to allocate again, this may cause a fence wait
|
||||
@@ -182,7 +182,7 @@ bool VertexManager::ReserveConstantStorage()
|
||||
}
|
||||
|
||||
// The only places that call constant updates are safe to have state restored.
|
||||
WARN_LOG(VIDEO, "Executing command list while waiting for space in uniform buffer");
|
||||
WARN_LOG_FMT(VIDEO, "Executing command list while waiting for space in uniform buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
|
||||
// Since we are on a new command buffer, all constants have been invalidated, and we need
|
||||
@@ -244,7 +244,7 @@ void VertexManager::UploadUtilityUniforms(const void* data, u32 data_size)
|
||||
if (!m_uniform_stream_buffer.ReserveMemory(data_size,
|
||||
D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT))
|
||||
{
|
||||
WARN_LOG(VIDEO, "Executing command buffer while waiting for ext space in uniform buffer");
|
||||
WARN_LOG_FMT(VIDEO, "Executing command buffer while waiting for ext space in uniform buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ bool VertexManager::UploadTexelBuffer(const void* data, u32 data_size, TexelBuff
|
||||
if (!m_texel_stream_buffer.ReserveMemory(data_size, elem_size))
|
||||
{
|
||||
// Try submitting cmdbuffer.
|
||||
WARN_LOG(VIDEO, "Submitting command buffer while waiting for space in texel buffer");
|
||||
WARN_LOG_FMT(VIDEO, "Submitting command buffer while waiting for space in texel buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!m_texel_stream_buffer.ReserveMemory(data_size, elem_size))
|
||||
{
|
||||
@@ -296,7 +296,7 @@ bool VertexManager::UploadTexelBuffer(const void* data, u32 data_size, TexelBuff
|
||||
if (!m_texel_stream_buffer.ReserveMemory(reserve_size, elem_size))
|
||||
{
|
||||
// Try submitting cmdbuffer.
|
||||
WARN_LOG(VIDEO, "Submitting command buffer while waiting for space in texel buffer");
|
||||
WARN_LOG_FMT(VIDEO, "Submitting command buffer while waiting for space in texel buffer");
|
||||
Renderer::GetInstance()->ExecuteCommandList(false);
|
||||
if (!m_texel_stream_buffer.ReserveMemory(reserve_size, elem_size))
|
||||
{
|
||||
|
||||
@@ -126,8 +126,8 @@ std::optional<Shader::BinaryData> Shader::CompileShader(D3D_FEATURE_LEVEL featur
|
||||
|
||||
if (errors && errors->GetBufferSize() > 0)
|
||||
{
|
||||
WARN_LOG(VIDEO, "%s compilation succeeded with warnings:\n%s", target,
|
||||
static_cast<const char*>(errors->GetBufferPointer()));
|
||||
WARN_LOG_FMT(VIDEO, "{} compilation succeeded with warnings:\n{}", target,
|
||||
static_cast<const char*>(errors->GetBufferPointer()));
|
||||
}
|
||||
|
||||
return CreateByteCode(code->GetBufferPointer(), code->GetBufferSize());
|
||||
|
||||
@@ -134,7 +134,7 @@ bool SwapChain::CreateSwapChain(bool stereo)
|
||||
hr = m_dxgi_factory->MakeWindowAssociation(static_cast<HWND>(m_wsi.render_surface),
|
||||
DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER);
|
||||
if (FAILED(hr))
|
||||
WARN_LOG(VIDEO, "MakeWindowAssociation() failed with HRESULT %08X", hr);
|
||||
WARN_LOG_FMT(VIDEO, "MakeWindowAssociation() failed with HRESULT {:08X}", hr);
|
||||
|
||||
m_stereo = stereo;
|
||||
if (!CreateSwapChainBuffers())
|
||||
@@ -167,7 +167,7 @@ bool SwapChain::ResizeSwapChain()
|
||||
GetDXGIFormatForAbstractFormat(m_texture_format, false),
|
||||
GetSwapChainFlags());
|
||||
if (FAILED(hr))
|
||||
WARN_LOG(VIDEO, "ResizeBuffers() failed with HRESULT %08X", hr);
|
||||
WARN_LOG_FMT(VIDEO, "ResizeBuffers() failed with HRESULT {:08X}", hr);
|
||||
|
||||
DXGI_SWAP_CHAIN_DESC desc;
|
||||
if (SUCCEEDED(m_swap_chain->GetDesc(&desc)))
|
||||
@@ -237,7 +237,7 @@ bool SwapChain::Present()
|
||||
HRESULT hr = m_swap_chain->Present(static_cast<UINT>(g_ActiveConfig.bVSyncActive), present_flags);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN_LOG(VIDEO, "Swap chain present failed with HRESULT %08X", hr);
|
||||
WARN_LOG_FMT(VIDEO, "Swap chain present failed with HRESULT {:08X}", hr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ void PerfQueryGL::EnableQuery(PerfQueryGroup type)
|
||||
if (m_query_buffer.size() == m_query_count)
|
||||
{
|
||||
FlushOne();
|
||||
// ERROR_LOG(VIDEO, "Flushed query buffer early!");
|
||||
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
||||
}
|
||||
|
||||
// start query
|
||||
@@ -198,7 +198,7 @@ void PerfQueryGLESNV::EnableQuery(PerfQueryGroup type)
|
||||
if (m_query_buffer.size() == m_query_count)
|
||||
{
|
||||
FlushOne();
|
||||
// ERROR_LOG(VIDEO, "Flushed query buffer early!");
|
||||
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
||||
}
|
||||
|
||||
// start query
|
||||
|
||||
@@ -357,7 +357,7 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, std::s
|
||||
|
||||
if (compileStatus != GL_TRUE)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "%s failed compilation:\n%s", prefix, info_log.c_str());
|
||||
ERROR_LOG_FMT(VIDEO, "{} failed compilation:\n{}", prefix, info_log);
|
||||
|
||||
std::string filename = VideoBackendBase::BadShaderFilename(prefix, num_failures++);
|
||||
std::ofstream file;
|
||||
@@ -376,7 +376,7 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, std::s
|
||||
return false;
|
||||
}
|
||||
|
||||
WARN_LOG(VIDEO, "%s compiled with warnings:\n%s", prefix, info_log.c_str());
|
||||
WARN_LOG_FMT(VIDEO, "{} compiled with warnings:\n{}", prefix, info_log);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -396,7 +396,7 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, std::string_view vcod
|
||||
glGetProgramInfoLog(id, length, &length, &info_log[0]);
|
||||
if (linkStatus != GL_TRUE)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Program failed linking:\n%s", info_log.c_str());
|
||||
ERROR_LOG_FMT(VIDEO, "Program failed linking:\n{}", info_log);
|
||||
std::string filename = VideoBackendBase::BadShaderFilename("p", num_failures++);
|
||||
std::ofstream file;
|
||||
File::OpenFStream(file, filename, std::ios_base::out);
|
||||
@@ -421,7 +421,7 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, std::string_view vcod
|
||||
return false;
|
||||
}
|
||||
|
||||
WARN_LOG(VIDEO, "Program linked with warnings:\n%s", info_log.c_str());
|
||||
WARN_LOG_FMT(VIDEO, "Program linked with warnings:\n{}", info_log);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -554,7 +554,7 @@ PipelineProgram* ProgramShaderCache::GetPipelineProgram(const GLVertexFormat* ve
|
||||
glGetProgramiv(prog->shader.glprogid, GL_LINK_STATUS, &link_status);
|
||||
if (link_status != GL_TRUE)
|
||||
{
|
||||
WARN_LOG(VIDEO, "Failed to create GL program from program binary.");
|
||||
WARN_LOG_FMT(VIDEO, "Failed to create GL program from program binary.");
|
||||
prog->shader.Destroy();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -105,19 +105,19 @@ static void APIENTRY ErrorCallback(GLenum source, GLenum type, GLuint id, GLenum
|
||||
switch (severity)
|
||||
{
|
||||
case GL_DEBUG_SEVERITY_HIGH_ARB:
|
||||
ERROR_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message);
|
||||
ERROR_LOG_FMT(HOST_GPU, "id: {:x}, source: {}, type: {} - {}", id, s_source, s_type, message);
|
||||
break;
|
||||
case GL_DEBUG_SEVERITY_MEDIUM_ARB:
|
||||
WARN_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message);
|
||||
WARN_LOG_FMT(HOST_GPU, "id: {:x}, source: {}, type: {} - {}", id, s_source, s_type, message);
|
||||
break;
|
||||
case GL_DEBUG_SEVERITY_LOW_ARB:
|
||||
DEBUG_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message);
|
||||
DEBUG_LOG_FMT(HOST_GPU, "id: {:x}, source: {}, type: {} - {}", id, s_source, s_type, message);
|
||||
break;
|
||||
case GL_DEBUG_SEVERITY_NOTIFICATION:
|
||||
DEBUG_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message);
|
||||
DEBUG_LOG_FMT(HOST_GPU, "id: {:x}, source: {}, type: {} - {}", id, s_source, s_type, message);
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(HOST_GPU, "id: %x, source: %s, type: %s - %s", id, s_source, s_type, message);
|
||||
ERROR_LOG_FMT(HOST_GPU, "id: {:x}, source: {}, type: {} - {}", id, s_source, s_type, message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -307,7 +307,7 @@ static void InitDriverInfo()
|
||||
version = 100 * major + minor;
|
||||
if (change >= change_scale)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Version changeID overflow - change:%d scale:%f", change, change_scale);
|
||||
ERROR_LOG_FMT(VIDEO, "Version changeID overflow - change:{} scale:{}", change, change_scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -734,33 +734,34 @@ Renderer::Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_
|
||||
g_Config.VerifyValidity();
|
||||
UpdateActiveConfig();
|
||||
|
||||
OSD::AddMessage(StringFromFormat("Video Info: %s, %s, %s", g_ogl_config.gl_vendor,
|
||||
g_ogl_config.gl_renderer, g_ogl_config.gl_version),
|
||||
OSD::AddMessage(fmt::format("Video Info: {}, {}, {}", g_ogl_config.gl_vendor,
|
||||
g_ogl_config.gl_renderer, g_ogl_config.gl_version),
|
||||
5000);
|
||||
|
||||
if (!g_ogl_config.bSupportsGLBufferStorage && !g_ogl_config.bSupportsGLPinnedMemory)
|
||||
{
|
||||
OSD::AddMessage(StringFromFormat("Your OpenGL driver does not support %s_buffer_storage.",
|
||||
m_main_gl_context->IsGLES() ? "EXT" : "ARB"),
|
||||
OSD::AddMessage(fmt::format("Your OpenGL driver does not support {}_buffer_storage.",
|
||||
m_main_gl_context->IsGLES() ? "EXT" : "ARB"),
|
||||
60000);
|
||||
OSD::AddMessage("This device's performance will be terrible.", 60000);
|
||||
OSD::AddMessage("Please ask your device vendor for an updated OpenGL driver.", 60000);
|
||||
}
|
||||
|
||||
WARN_LOG(VIDEO, "Missing OGL Extensions: %s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||
g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
|
||||
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
||||
g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
||||
g_ogl_config.bSupportsGLPinnedMemory ? "" : "PinnedMemory ",
|
||||
supports_glsl_cache ? "" : "ShaderCache ",
|
||||
g_ogl_config.bSupportsGLBaseVertex ? "" : "BaseVertex ",
|
||||
g_ogl_config.bSupportsGLBufferStorage ? "" : "BufferStorage ",
|
||||
g_ogl_config.bSupportsGLSync ? "" : "Sync ", g_ogl_config.bSupportsMSAA ? "" : "MSAA ",
|
||||
g_ActiveConfig.backend_info.bSupportsSSAA ? "" : "SSAA ",
|
||||
g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing ",
|
||||
g_ActiveConfig.backend_info.bSupportsClipControl ? "" : "ClipControl ",
|
||||
g_ogl_config.bSupportsCopySubImage ? "" : "CopyImageSubData ",
|
||||
g_ActiveConfig.backend_info.bSupportsDepthClamp ? "" : "DepthClamp ");
|
||||
WARN_LOG_FMT(VIDEO, "Missing OGL Extensions: {}{}{}{}{}{}{}{}{}{}{}{}{}{}",
|
||||
g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ",
|
||||
g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ",
|
||||
g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ",
|
||||
g_ogl_config.bSupportsGLPinnedMemory ? "" : "PinnedMemory ",
|
||||
supports_glsl_cache ? "" : "ShaderCache ",
|
||||
g_ogl_config.bSupportsGLBaseVertex ? "" : "BaseVertex ",
|
||||
g_ogl_config.bSupportsGLBufferStorage ? "" : "BufferStorage ",
|
||||
g_ogl_config.bSupportsGLSync ? "" : "Sync ",
|
||||
g_ogl_config.bSupportsMSAA ? "" : "MSAA ",
|
||||
g_ActiveConfig.backend_info.bSupportsSSAA ? "" : "SSAA ",
|
||||
g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing ",
|
||||
g_ActiveConfig.backend_info.bSupportsClipControl ? "" : "ClipControl ",
|
||||
g_ogl_config.bSupportsCopySubImage ? "" : "CopyImageSubData ",
|
||||
g_ActiveConfig.backend_info.bSupportsDepthClamp ? "" : "DepthClamp ");
|
||||
|
||||
// Handle VSync on/off
|
||||
if (!DriverDetails::HasBug(DriverDetails::BUG_BROKEN_VSYNC))
|
||||
|
||||
@@ -56,7 +56,9 @@ static void SetPixelAlphaOnly(u32 offset, u8 a)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Unsupported pixel format: %i", static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
ERROR_LOG_FMT(VIDEO, "Unsupported pixel format: {}",
|
||||
static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +89,7 @@ static void SetPixelColorOnly(u32 offset, u8* rgb)
|
||||
break;
|
||||
case PEControl::RGB565_Z16:
|
||||
{
|
||||
INFO_LOG(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
u32 src = *(u32*)rgb;
|
||||
u32* dst = (u32*)&efb[offset];
|
||||
u32 val = *dst & 0xff000000;
|
||||
@@ -96,7 +98,9 @@ static void SetPixelColorOnly(u32 offset, u8* rgb)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Unsupported pixel format: %i", static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
ERROR_LOG_FMT(VIDEO, "Unsupported pixel format: {}",
|
||||
static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +132,7 @@ static void SetPixelAlphaColor(u32 offset, u8* color)
|
||||
break;
|
||||
case PEControl::RGB565_Z16:
|
||||
{
|
||||
INFO_LOG(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
u32 src = *(u32*)color;
|
||||
u32* dst = (u32*)&efb[offset];
|
||||
u32 val = *dst & 0xff000000;
|
||||
@@ -137,7 +141,9 @@ static void SetPixelAlphaColor(u32 offset, u8* color)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Unsupported pixel format: %i", static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
ERROR_LOG_FMT(VIDEO, "Unsupported pixel format: {}",
|
||||
static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,11 +165,12 @@ static u32 GetPixelColor(u32 offset)
|
||||
Convert6To8((src >> 18) & 0x3f) << 24; // Red
|
||||
|
||||
case PEControl::RGB565_Z16:
|
||||
INFO_LOG(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
return 0xff | ((src & 0x00ffffff) << 8);
|
||||
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Unsupported pixel format: %i", static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
ERROR_LOG_FMT(VIDEO, "Unsupported pixel format: {}",
|
||||
static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -184,7 +191,7 @@ static void SetPixelDepth(u32 offset, u32 depth)
|
||||
break;
|
||||
case PEControl::RGB565_Z16:
|
||||
{
|
||||
INFO_LOG(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
u32* dst = (u32*)&efb[offset];
|
||||
u32 val = *dst & 0xff000000;
|
||||
val |= depth & 0x00ffffff;
|
||||
@@ -192,7 +199,9 @@ static void SetPixelDepth(u32 offset, u32 depth)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Unsupported pixel format: %i", static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
ERROR_LOG_FMT(VIDEO, "Unsupported pixel format: {}",
|
||||
static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,12 +220,14 @@ static u32 GetPixelDepth(u32 offset)
|
||||
break;
|
||||
case PEControl::RGB565_Z16:
|
||||
{
|
||||
INFO_LOG(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
INFO_LOG_FMT(VIDEO, "RGB565_Z16 is not supported correctly yet");
|
||||
depth = (*(u32*)&efb[offset]) & 0x00ffffff;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Unsupported pixel format: %i", static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
ERROR_LOG_FMT(VIDEO, "Unsupported pixel format: {}",
|
||||
static_cast<int>(bpmem.zcontrol.pixel_format));
|
||||
break;
|
||||
}
|
||||
|
||||
return depth;
|
||||
@@ -554,7 +565,7 @@ void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>
|
||||
{
|
||||
if (!xfb_in_ram)
|
||||
{
|
||||
WARN_LOG(VIDEO, "Tried to copy to invalid XFB address");
|
||||
WARN_LOG_FMT(VIDEO, "Tried to copy to invalid XFB address");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -569,7 +580,7 @@ void EncodeXFB(u8* xfb_in_ram, u32 memory_stride, const MathUtil::Rectangle<int>
|
||||
// copy always has an even width, which might not be true.
|
||||
if (left & 1 || right & 1)
|
||||
{
|
||||
WARN_LOG(VIDEO, "Trying to copy XFB to from unaligned EFB source");
|
||||
WARN_LOG_FMT(VIDEO, "Trying to copy XFB to from unaligned EFB source");
|
||||
// this will show up as wrongly encoded
|
||||
}
|
||||
|
||||
@@ -677,7 +688,8 @@ bool ZCompare(u16 x, u16 y, u32 z)
|
||||
break;
|
||||
default:
|
||||
pass = false;
|
||||
ERROR_LOG(VIDEO, "Bad Z compare mode %i", (int)bpmem.zmode.func);
|
||||
ERROR_LOG_FMT(VIDEO, "Bad Z compare mode {}", static_cast<int>(bpmem.zmode.func));
|
||||
break;
|
||||
}
|
||||
|
||||
if (pass && bpmem.zmode.updateenable)
|
||||
|
||||
@@ -41,13 +41,13 @@ bool SWOGLWindow::Initialize(const WindowSystemInfo& wsi)
|
||||
// Init extension support.
|
||||
if (!GLExtensions::Init(m_gl_context.get()))
|
||||
{
|
||||
ERROR_LOG(VIDEO, "GLExtensions::Init failed!Does your video card support OpenGL 2.0?");
|
||||
ERROR_LOG_FMT(VIDEO, "GLExtensions::Init failed!Does your video card support OpenGL 2.0?");
|
||||
return false;
|
||||
}
|
||||
else if (GLExtensions::Version() < 310)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "OpenGL Version %d detected, but at least 3.1 is required.",
|
||||
GLExtensions::Version());
|
||||
ERROR_LOG_FMT(VIDEO, "OpenGL Version {} detected, but at least 3.1 is required.",
|
||||
GLExtensions::Version());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
|
||||
xfmem.MatrixIndexB.Tex6MtxIdx != g_main_cp_state.matrix_index_b.Tex6MtxIdx ||
|
||||
xfmem.MatrixIndexB.Tex7MtxIdx != g_main_cp_state.matrix_index_b.Tex7MtxIdx)
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Matrix indices don't match");
|
||||
ERROR_LOG_FMT(VIDEO, "Matrix indices don't match");
|
||||
}
|
||||
|
||||
m_vertex.posMtx = xfmem.MatrixIndexA.PosNormalMtxIdx;
|
||||
|
||||
@@ -37,7 +37,7 @@ void SetupUnit::SetupVertex()
|
||||
SetupQuad();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_QUADS_2:
|
||||
WARN_LOG(VIDEO, "Non-standard primitive drawing command GL_DRAW_QUADS_2");
|
||||
WARN_LOG_FMT(VIDEO, "Non-standard primitive drawing command GL_DRAW_QUADS_2");
|
||||
SetupQuad();
|
||||
break;
|
||||
case OpcodeDecoder::GX_DRAW_TRIANGLES:
|
||||
|
||||
@@ -445,7 +445,8 @@ void TransformTexCoord(const InputVertexData* src, OutputVertexData* dst, bool s
|
||||
dst->texCoords[coordNum].z = 1.0f;
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG(VIDEO, "Bad tex gen type %i", texinfo.texgentype.Value());
|
||||
ERROR_LOG_FMT(VIDEO, "Bad tex gen type {}", texinfo.texgentype.Value());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user