mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-24 04:51:09 +00:00
Leak resources on linux context shutdown if not bound. Closes #3921
* Linux doesn't support rebinding contexts between EGL (Android binding API) and GLX (linux) even if no context is bound, so if one platform is used then the other we can't bind our child contexts in order to delete objects when a context is destroyed. * We will have to do the same as we do if a different context is bound, and hope that the driver tidies this stuff up for us when the context is deleted.
This commit is contained in:
4 files changed
+7
-1
No files matched your search
@@ -60,6 +60,8 @@ class EGLPlatform : public GLPlatform
|
||||
RDCDriver m_API = RDCDriver::OpenGLES;
|
||||
bool m_Debug = false;
|
||||
|
||||
bool CanFreshBindOnDeletion() { return false; }
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
if(EGL.MakeCurrent)
|
||||
|
||||
@@ -304,6 +304,8 @@ struct GLPlatform
|
||||
virtual GLWindowingData MakeOutputWindow(WindowingData window, bool depth,
|
||||
GLWindowingData share_context) = 0;
|
||||
|
||||
virtual bool CanFreshBindOnDeletion() { return true; }
|
||||
|
||||
// for pushing and popping a child context. The default implementation just does
|
||||
// MakeContextCurrent but platforms can override this if they need more complex state handling
|
||||
virtual bool PushChildContext(GLWindowingData existing, GLWindowingData newChild,
|
||||
|
||||
@@ -1136,7 +1136,7 @@ void WrappedOpenGL::DeleteContext(void *contextHandle)
|
||||
|
||||
GLWindowingData savedContext;
|
||||
|
||||
if(existing.ctx == NULL)
|
||||
if(existing.ctx == NULL && m_Platform.CanFreshBindOnDeletion())
|
||||
{
|
||||
if(m_Platform.PushChildContext(existing, ctxdata.shareGroup->m_BackDoor, &savedContext))
|
||||
{
|
||||
|
||||
@@ -53,6 +53,8 @@ class GLXPlatform : public GLPlatform
|
||||
RDCDriver m_API = RDCDriver::OpenGL;
|
||||
bool m_Debug = false;
|
||||
|
||||
bool CanFreshBindOnDeletion() { return false; }
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
if(GLX.glXMakeCurrent)
|
||||
|
||||
Reference in new issue
Block a user