Implement AbstractGfx for OpenGL

Mostly involves moving contents of OGLRender
to OGLGfx and OGLConfig
This commit is contained in:
Scott Mansell
2023-01-31 18:46:04 +13:00
parent 8a23629345
commit f0336a3129
20 changed files with 905 additions and 872 deletions
+4 -2
View File
@@ -569,9 +569,10 @@
<ClInclude Include="VideoBackends\Null\VideoBackend.h" />
<ClInclude Include="VideoBackends\OGL\GPUTimer.h" />
<ClInclude Include="VideoBackends\OGL\OGLBoundingBox.h" />
<ClInclude Include="VideoBackends\OGL\OGLConfig.h" />
<ClInclude Include="VideoBackends\OGL\OGLGfx.h" />
<ClInclude Include="VideoBackends\OGL\OGLPerfQuery.h" />
<ClInclude Include="VideoBackends\OGL\OGLPipeline.h" />
<ClInclude Include="VideoBackends\OGL\OGLRender.h" />
<ClInclude Include="VideoBackends\OGL\OGLShader.h" />
<ClInclude Include="VideoBackends\OGL\OGLStreamBuffer.h" />
<ClInclude Include="VideoBackends\OGL\OGLTexture.h" />
@@ -1175,11 +1176,12 @@
<ClCompile Include="VideoBackends\Null\NullTexture.cpp" />
<ClCompile Include="VideoBackends\Null\NullVertexManager.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLBoundingBox.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLConfig.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLGfx.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLMain.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLNativeVertexFormat.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLPerfQuery.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLPipeline.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLRender.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLShader.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLStreamBuffer.cpp" />
<ClCompile Include="VideoBackends\OGL\OGLTexture.cpp" />
+4 -2
View File
@@ -2,14 +2,16 @@ add_library(videoogl
GPUTimer.h
OGLBoundingBox.cpp
OGLBoundingBox.h
OGLConfig.cpp
OGLConfig.h
OGLGfx.cpp
OGLGfx.h
OGLMain.cpp
OGLNativeVertexFormat.cpp
OGLPerfQuery.cpp
OGLPerfQuery.h
OGLPipeline.cpp
OGLPipeline.h
OGLRender.cpp
OGLRender.h
OGLShader.cpp
OGLShader.h
OGLStreamBuffer.cpp
@@ -3,7 +3,7 @@
#include "VideoBackends/OGL/OGLBoundingBox.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoCommon/DriverDetails.h"
namespace OGL
@@ -35,7 +35,7 @@ std::vector<BBoxType> OGLBoundingBox::Read(u32 index, u32 length)
// on nVidia drivers. This is more noticeable at higher internal resolutions.
// Using glGetBufferSubData instead does not seem to exhibit this slowdown.
if (!DriverDetails::HasBug(DriverDetails::BUG_SLOW_GETBUFFERSUBDATA) &&
!static_cast<Renderer*>(g_renderer.get())->IsGLES())
!static_cast<OGLGfx*>(g_gfx.get())->IsGLES())
{
// We also need to ensure the the CPU does not receive stale values which have been updated by
// the GPU. Apparently the buffer here is not coherent on NVIDIA drivers. Not sure if this is a
+78
View File
@@ -0,0 +1,78 @@
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "Common/CommonTypes.h"
class GLContext;
namespace OGL
{
enum GlslVersion
{
Glsl130,
Glsl140,
Glsl150,
Glsl330,
Glsl400, // and above
Glsl430,
GlslEs300, // GLES 3.0
GlslEs310, // GLES 3.1
GlslEs320, // GLES 3.2
};
enum class EsTexbufType
{
TexbufNone,
TexbufCore,
TexbufOes,
TexbufExt
};
enum class EsFbFetchType
{
FbFetchNone,
FbFetchExt,
FbFetchArm,
};
// ogl-only config, so not in VideoConfig.h
struct VideoConfig
{
bool bIsES;
bool bSupportsGLPinnedMemory;
bool bSupportsGLSync;
bool bSupportsGLBaseVertex;
bool bSupportsGLBufferStorage;
bool bSupportsMSAA;
GlslVersion eSupportedGLSLVersion;
bool bSupportViewportFloat;
bool bSupportsAEP;
bool bSupportsDebug;
bool bSupportsCopySubImage;
u8 SupportedESPointSize;
EsTexbufType SupportedESTextureBuffer;
bool bSupportsTextureStorage;
bool bSupports2DTextureStorageMultisample;
bool bSupports3DTextureStorageMultisample;
bool bSupportsConservativeDepth;
bool bSupportsImageLoadStore;
bool bSupportsAniso;
bool bSupportsBitfield;
bool bSupportsTextureSubImage;
EsFbFetchType SupportedFramebufferFetch;
bool bSupportsShaderThreadShuffleNV;
const char* gl_vendor;
const char* gl_renderer;
const char* gl_version;
s32 max_samples;
};
void InitDriverInfo();
bool PopulateConfig(GLContext* main_gl_context);
extern VideoConfig g_ogl_config;
} // namespace OGL
File diff suppressed because it is too large Load Diff
@@ -1,99 +1,25 @@
// Copyright 2008 Dolphin Emulator Project
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <array>
#include <string>
#include <string_view>
#include "VideoCommon/AbstractGfx.h"
#include "Common/GL/GLContext.h"
#include "Common/GL/GLExtensions/GLExtensions.h"
#include "VideoCommon/RenderBase.h"
class BoundingBox;
class GLContext;
namespace OGL
{
class OGLFramebuffer;
class OGLPipeline;
class OGLTexture;
enum GlslVersion
{
Glsl130,
Glsl140,
Glsl150,
Glsl330,
Glsl400, // and above
Glsl430,
GlslEs300, // GLES 3.0
GlslEs310, // GLES 3.1
GlslEs320, // GLES 3.2
};
enum class EsTexbufType
{
TexbufNone,
TexbufCore,
TexbufOes,
TexbufExt
};
enum class EsFbFetchType
{
FbFetchNone,
FbFetchExt,
FbFetchArm,
};
// ogl-only config, so not in VideoConfig.h
struct VideoConfig
{
bool bIsES;
bool bSupportsGLPinnedMemory;
bool bSupportsGLSync;
bool bSupportsGLBaseVertex;
bool bSupportsGLBufferStorage;
bool bSupportsMSAA;
GlslVersion eSupportedGLSLVersion;
bool bSupportViewportFloat;
bool bSupportsAEP;
bool bSupportsDebug;
bool bSupportsCopySubImage;
u8 SupportedESPointSize;
EsTexbufType SupportedESTextureBuffer;
bool bSupportsTextureStorage;
bool bSupports2DTextureStorageMultisample;
bool bSupports3DTextureStorageMultisample;
bool bSupportsConservativeDepth;
bool bSupportsImageLoadStore;
bool bSupportsAniso;
bool bSupportsBitfield;
bool bSupportsTextureSubImage;
EsFbFetchType SupportedFramebufferFetch;
bool bSupportsShaderThreadShuffleNV;
const char* gl_vendor;
const char* gl_renderer;
const char* gl_version;
s32 max_samples;
};
extern VideoConfig g_ogl_config;
class Renderer : public ::Renderer
class OGLGfx final : public AbstractGfx
{
public:
Renderer(std::unique_ptr<GLContext> main_gl_context, float backbuffer_scale);
~Renderer() override;
static Renderer* GetInstance() { return static_cast<Renderer*>(g_renderer.get()); }
OGLGfx(std::unique_ptr<GLContext> main_gl_context, float backbuffer_scale);
~OGLGfx();
bool IsHeadless() const override;
bool Initialize() override;
void Shutdown() override;
std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config,
std::string_view name) override;
std::unique_ptr<AbstractStagingTexture>
@@ -116,6 +42,8 @@ public:
void SetAndDiscardFramebuffer(AbstractFramebuffer* framebuffer) override;
void SetAndClearFramebuffer(AbstractFramebuffer* framebuffer, const ClearColor& color_value = {},
float depth_value = 0.0f) override;
void ClearRegion(const MathUtil::Rectangle<int>& rc, const MathUtil::Rectangle<int>& target_rc,
bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z) override;
void SetScissorRect(const MathUtil::Rectangle<int>& rc) override;
void SetTexture(u32 index, const AbstractTexture* texture) override;
void SetSamplerState(u32 index, const SamplerState& state) override;
@@ -137,34 +65,30 @@ public:
void WaitForGPUIdle() override;
void OnConfigChanged(u32 bits) override;
void ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable, bool alphaEnable,
bool zEnable, u32 color, u32 z) override;
virtual void SelectLeftBuffer() override;
virtual void SelectRightBuffer() override;
virtual void SelectMainBuffer() override;
std::unique_ptr<VideoCommon::AsyncShaderCompiler> CreateAsyncShaderCompiler() override;
// Only call methods from this on the GPU thread.
GLContext* GetMainGLContext() const { return m_main_gl_context.get(); }
bool IsGLES() const { return m_main_gl_context->IsGLES(); }
bool IsGLES() const;
// Invalidates a cached texture binding. Required for texel buffers when they borrow the units.
void InvalidateTextureBinding(u32 index) { m_bound_textures[index] = nullptr; }
// The shared framebuffer exists for copying textures when extensions are not available. It is
// slower, but the only way to do these things otherwise.
GLuint GetSharedReadFramebuffer() const { return m_shared_read_framebuffer; }
GLuint GetSharedDrawFramebuffer() const { return m_shared_draw_framebuffer; }
u32 GetSharedReadFramebuffer() const { return m_shared_read_framebuffer; }
u32 GetSharedDrawFramebuffer() const { return m_shared_draw_framebuffer; }
void BindSharedReadFramebuffer();
void BindSharedDrawFramebuffer();
// Restores FBO binding after it's been changed.
void RestoreFramebufferBinding();
protected:
std::unique_ptr<BoundingBox> CreateBoundingBox() const override;
virtual void SelectLeftBuffer() override;
virtual void SelectRightBuffer() override;
virtual void SelectMainBuffer() override;
SurfaceInfo GetSurfaceInfo() const override;
private:
void CheckForSurfaceChange();
@@ -181,7 +105,14 @@ private:
RasterizationState m_current_rasterization_state;
DepthState m_current_depth_state;
BlendingState m_current_blend_state;
GLuint m_shared_read_framebuffer = 0;
GLuint m_shared_draw_framebuffer = 0;
u32 m_shared_read_framebuffer = 0;
u32 m_shared_draw_framebuffer = 0;
float m_backbuffer_scale;
};
inline OGLGfx* GetOGLGfx()
{
return static_cast<OGLGfx*>(g_gfx.get());
}
} // namespace OGL
+7 -15
View File
@@ -46,8 +46,10 @@ Make AA apply instantly during gameplay if possible
#include "Core/Config/GraphicsSettings.h"
#include "VideoBackends/OGL/OGLBoundingBox.h"
#include "VideoBackends/OGL/OGLConfig.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoBackends/OGL/OGLPerfQuery.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLVertexManager.h"
#include "VideoBackends/OGL/ProgramShaderCache.h"
#include "VideoBackends/OGL/SamplerCache.h"
@@ -185,26 +187,16 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
if (!InitializeGLExtensions(main_gl_context.get()) || !FillBackendInfo())
return false;
InitializeShared();
g_renderer = std::make_unique<Renderer>(std::move(main_gl_context), wsi.render_surface_scale);
g_gfx = std::make_unique<OGLGfx>(std::move(main_gl_context), wsi.render_surface_scale);
ProgramShaderCache::Init();
g_vertex_manager = std::make_unique<VertexManager>();
g_shader_cache = std::make_unique<VideoCommon::ShaderCache>();
g_framebuffer_manager = std::make_unique<FramebufferManager>();
g_perf_query = GetPerfQuery();
g_texture_cache = std::make_unique<TextureCacheBase>();
g_sampler_cache = std::make_unique<SamplerCache>();
g_bounding_box = std::make_unique<OGLBoundingBox>();
if (!g_vertex_manager->Initialize() || !g_shader_cache->Initialize() ||
!g_renderer->Initialize() || !g_framebuffer_manager->Initialize() ||
!g_texture_cache->Initialize())
{
PanicAlertFmtT("Failed to initialize renderer classes");
Shutdown();
return false;
}
InitializeShared();
g_shader_cache->InitializeShaderCache();
return true;
}
@@ -6,7 +6,7 @@
#include "Common/GL/GLUtil.h"
#include "Common/MsgHandler.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoBackends/OGL/OGLVertexManager.h"
#include "VideoBackends/OGL/ProgramShaderCache.h"
@@ -19,7 +19,7 @@
namespace OGL
{
std::unique_ptr<NativeVertexFormat>
Renderer::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
OGLGfx::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
{
return std::make_unique<GLVertexFormat>(vtx_decl);
}
@@ -8,7 +8,8 @@
#include "Common/CommonTypes.h"
#include "Common/GL/GLExtensions/GLExtensions.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VideoConfig.h"
@@ -16,7 +17,7 @@ namespace OGL
{
std::unique_ptr<PerfQueryBase> GetPerfQuery()
{
const bool is_gles = static_cast<Renderer*>(g_renderer.get())->IsGLES();
const bool is_gles = static_cast<OGLGfx*>(g_gfx.get())->IsGLES();
if (is_gles && GLExtensions::Supports("GL_NV_occlusion_query_samples"))
return std::make_unique<PerfQueryGLESNV>();
else if (is_gles)
@@ -5,7 +5,6 @@
#include "Common/Assert.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLShader.h"
#include "VideoBackends/OGL/OGLVertexManager.h"
#include "VideoBackends/OGL/ProgramShaderCache.h"
@@ -8,7 +8,7 @@
#include "Common/MathUtil.h"
#include "Common/MemoryUtil.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLConfig.h"
#include "VideoCommon/DriverDetails.h"
#include "VideoCommon/OnScreenDisplay.h"
+9 -7
View File
@@ -7,6 +7,8 @@
#include "Common/CommonTypes.h"
#include "Common/MsgHandler.h"
#include "VideoBackends/OGL/OGLConfig.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoBackends/OGL/SamplerCache.h"
#include "VideoCommon/VideoConfig.h"
@@ -160,7 +162,7 @@ OGLTexture::OGLTexture(const TextureConfig& tex_config, std::string_view name)
OGLTexture::~OGLTexture()
{
Renderer::GetInstance()->UnbindTexture(this);
GetOGLGfx()->UnbindTexture(this);
glDeleteTextures(1, &m_texId);
}
@@ -190,10 +192,10 @@ void OGLTexture::BlitFramebuffer(OGLTexture* srcentry, const MathUtil::Rectangle
const MathUtil::Rectangle<int>& dst_rect, u32 dst_layer,
u32 dst_level)
{
Renderer::GetInstance()->BindSharedReadFramebuffer();
GetOGLGfx()->BindSharedReadFramebuffer();
glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, srcentry->m_texId, src_level,
src_layer);
Renderer::GetInstance()->BindSharedDrawFramebuffer();
GetOGLGfx()->BindSharedDrawFramebuffer();
glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, m_texId, dst_level,
dst_layer);
@@ -206,7 +208,7 @@ void OGLTexture::BlitFramebuffer(OGLTexture* srcentry, const MathUtil::Rectangle
// The default state for the scissor test is enabled. We don't need to do a full state
// restore, as the framebuffer and scissor test are the only things we changed.
glEnable(GL_SCISSOR_TEST);
Renderer::GetInstance()->RestoreFramebufferBinding();
GetOGLGfx()->RestoreFramebufferBinding();
}
void OGLTexture::ResolveFromTexture(const AbstractTexture* src,
@@ -388,7 +390,7 @@ void OGLStagingTexture::CopyFromTexture(const AbstractTexture* src,
else
{
// Mutate the shared framebuffer.
Renderer::GetInstance()->BindSharedReadFramebuffer();
GetOGLGfx()->BindSharedReadFramebuffer();
if (AbstractTexture::IsDepthFormat(gltex->GetFormat()))
{
glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, 0, 0, 0);
@@ -404,7 +406,7 @@ void OGLStagingTexture::CopyFromTexture(const AbstractTexture* src,
glReadPixels(src_rect.left, src_rect.top, src_rect.GetWidth(), src_rect.GetHeight(),
GetGLFormatForTextureFormat(src->GetFormat()),
GetGLTypeForTextureFormat(src->GetFormat()), reinterpret_cast<void*>(dst_offset));
Renderer::GetInstance()->RestoreFramebufferBinding();
GetOGLGfx()->RestoreFramebufferBinding();
}
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
@@ -597,7 +599,7 @@ std::unique_ptr<OGLFramebuffer> OGLFramebuffer::Create(OGLTexture* color_attachm
}
DEBUG_ASSERT(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
Renderer::GetInstance()->RestoreFramebufferBinding();
GetOGLGfx()->RestoreFramebufferBinding();
return std::make_unique<OGLFramebuffer>(color_attachment, depth_attachment, color_format,
depth_format, width, height, layers, samples, fbo);
@@ -12,8 +12,8 @@
#include "Common/CommonTypes.h"
#include "Common/GL/GLExtensions/GLExtensions.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoBackends/OGL/OGLPipeline.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLStreamBuffer.h"
#include "VideoBackends/OGL/ProgramShaderCache.h"
@@ -116,7 +116,7 @@ bool VertexManager::UploadTexelBuffer(const void* data, u32 data_size, TexelBuff
// Bind the correct view to the texel buffer slot.
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_BUFFER, m_texel_buffer_views[static_cast<u32>(format)]);
Renderer::GetInstance()->InvalidateTextureBinding(0);
GetOGLGfx()->InvalidateTextureBinding(0);
return true;
}
@@ -141,11 +141,11 @@ bool VertexManager::UploadTexelBuffer(const void* data, u32 data_size, TexelBuff
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_BUFFER, m_texel_buffer_views[static_cast<u32>(format)]);
Renderer::GetInstance()->InvalidateTextureBinding(0);
GetOGLGfx()->InvalidateTextureBinding(0);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_BUFFER, m_texel_buffer_views[static_cast<u32>(palette_format)]);
Renderer::GetInstance()->InvalidateTextureBinding(1);
GetOGLGfx()->InvalidateTextureBinding(1);
return true;
}
@@ -22,7 +22,8 @@
#include "Core/ConfigManager.h"
#include "Core/System.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLConfig.h"
#include "VideoBackends/OGL/OGLGfx.h"
#include "VideoBackends/OGL/OGLShader.h"
#include "VideoBackends/OGL/OGLStreamBuffer.h"
#include "VideoBackends/OGL/OGLVertexManager.h"
@@ -863,8 +864,7 @@ u64 ProgramShaderCache::GenerateShaderID()
bool SharedContextAsyncShaderCompiler::WorkerThreadInitMainThread(void** param)
{
std::unique_ptr<GLContext> context =
static_cast<Renderer*>(g_renderer.get())->GetMainGLContext()->CreateSharedContext();
std::unique_ptr<GLContext> context = GetOGLGfx()->GetMainGLContext()->CreateSharedContext();
if (!context)
{
PanicAlertFmt("Failed to create shared context for shader compiling.");
@@ -6,7 +6,7 @@
#include <memory>
#include "Common/CommonTypes.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoBackends/OGL/OGLConfig.h"
#include "VideoCommon/VideoConfig.h"
namespace OGL
+1 -1
View File
@@ -9,7 +9,7 @@
#include "Common/CommonTypes.h"
#include "Common/GL/GLUtil.h"
#include "VideoBackends/OGL/OGLRender.h"
#include "VideoCommon/RenderState.h"
namespace OGL
{
+2
View File
@@ -13,6 +13,8 @@
#include "VideoCommon/VertexManagerBase.h"
#include "VideoCommon/VideoConfig.h"
std::unique_ptr<AbstractGfx> g_gfx;
bool AbstractGfx::IsHeadless() const
{
return true;
+2
View File
@@ -13,6 +13,8 @@
#include <algorithm>
std::unique_ptr<BoundingBox> g_bounding_box;
void BoundingBox::Enable(PixelShaderManager& pixel_shader_manager)
{
m_is_active = true;
+18 -2
View File
@@ -39,8 +39,10 @@
#include "VideoBackends/Metal/VideoBackend.h"
#endif
#include "VideoCommon/AbstractGfx.h"
#include "VideoCommon/AsyncRequests.h"
#include "VideoCommon/BPStructs.h"
#include "VideoCommon/BoundingBox.h"
#include "VideoCommon/CPMemory.h"
#include "VideoCommon/CommandProcessor.h"
#include "VideoCommon/Fifo.h"
@@ -324,9 +326,16 @@ void VideoBackendBase::InitializeShared()
// do not initialize again for the config window
m_initialized = true;
g_renderer = std::make_unique<Renderer>();
if (!g_renderer)
{
// Null and Software Backends supply their own Renderer
g_renderer = std::make_unique<Renderer>();
}
g_presenter = std::make_unique<VideoCommon::Presenter>();
g_frame_dumper = std::make_unique<FrameDumper>();
g_texture_cache = std::make_unique<TextureCacheBase>();
g_framebuffer_manager = std::make_unique<FramebufferManager>();
g_shader_cache = std::make_unique<VideoCommon::ShaderCache>();
auto& system = Core::System::GetInstance();
auto& command_processor = system.GetCommandProcessor();
@@ -340,7 +349,9 @@ void VideoBackendBase::InitializeShared()
system.GetPixelShaderManager().Init();
TMEM::Init();
if (!g_renderer->Initialize() || !g_presenter->Initialize())
if (!g_vertex_manager->Initialize() || !g_renderer->Initialize() || !g_presenter->Initialize() ||
!g_shader_cache->Initialize() || !g_framebuffer_manager->Initialize() ||
!g_texture_cache->Initialize() || !g_bounding_box->Initialize())
{
PanicAlertFmtT("Failed to initialize renderer classes");
Shutdown();
@@ -349,6 +360,8 @@ void VideoBackendBase::InitializeShared()
g_Config.VerifyValidity();
UpdateActiveConfig();
g_shader_cache->InitializeShaderCache();
}
void VideoBackendBase::ShutdownShared()
@@ -363,12 +376,15 @@ void VideoBackendBase::ShutdownShared()
if (g_texture_cache)
g_texture_cache->Shutdown();
g_bounding_box.reset();
g_perf_query.reset();
g_texture_cache.reset();
g_framebuffer_manager.reset();
g_shader_cache.reset();
g_vertex_manager.reset();
g_renderer.reset();
g_presenter.reset();
g_gfx.reset();
m_initialized = false;