From f5dd9c17cdcb8440e2e7fe5c6a007bc42f8aedfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 27 Feb 2018 20:40:44 +0100 Subject: [PATCH] Add comment trying to clarify shutdown of GPU_GLES, restore the wipe, minor tweaks. Should help #10652 This reverts commit 10be0cad96f9a48b510254c9050f03748ac2b1eb. --- GPU/Common/DrawEngineCommon.cpp | 2 +- GPU/GLES/GPU_GLES.cpp | 6 ++++++ ext/native/thin3d/thin3d_gl.cpp | 5 ++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index abba527ef2..166cd9a659 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -701,7 +701,7 @@ void DrawEngineCommon::SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, dhash = __rotl(dhash ^ (u32)(uintptr_t)inds, 13); dhash = __rotl(dhash ^ (u32)vertType, 13); dhash = __rotl(dhash ^ (u32)vertexCount, 13); - dcid_ = dhash ^ (u32)prim;; + dcid_ = dhash ^ (u32)prim; } if (inds) { diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index 477f507344..ea65a9faec 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -120,6 +120,12 @@ GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw) } GPU_GLES::~GPU_GLES() { + GLRenderManager *render = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); + render->Wipe(); + + // If we're here during app shutdown (exiting the Windows app in-game, for example) + // everything should already be cleared since DeviceLost has been run. + framebufferManagerGL_->DestroyAllFBOs(); shaderManagerGL_->ClearCache(true); depalShaderCache_.Clear(); diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index 0b6f216891..5ef1af4874 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -231,7 +231,7 @@ GLuint ShaderStageToOpenGL(ShaderStage stage) { class OpenGLShaderModule : public ShaderModule { public: OpenGLShaderModule(GLRenderManager *render, ShaderStage stage) : render_(render), stage_(stage) { - ILOG("Shader module created (%p)", this); + DLOG("Shader module created (%p)", this); glstage_ = ShaderStageToOpenGL(stage); } @@ -297,7 +297,7 @@ public: OpenGLPipeline(GLRenderManager *render) : render_(render) { } ~OpenGLPipeline() { - ILOG("OpenGLPipeline released"); + DLOG("OpenGLPipeline released"); for (auto &iter : shaders) { iter->Release(); } @@ -633,7 +633,6 @@ OpenGLTexture::OpenGLTexture(GLRenderManager *render, const TextureDesc &desc) : bool genMips = false; if ((int)desc.initData.size() < desc.mipLevels && desc.generateMips) { - ILOG("Generating mipmaps"); // Assumes the texture is bound for editing genMips = true; generatedMips_ = true;