mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Fix wrong API being used for cloned child GL contexts
This commit is contained in:
@@ -213,6 +213,7 @@ class CGLPlatform : public GLPlatform
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SetDriverType(RDCDriver api) {}
|
||||
RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
RDCASSERT(api == RDCDriver::OpenGL);
|
||||
|
||||
@@ -371,6 +371,7 @@ class EGLPlatform : public GLPlatform
|
||||
}
|
||||
|
||||
bool PopulateForReplay() { return EGL.PopulateForReplay(); }
|
||||
void SetDriverType(RDCDriver api) { m_API = api; }
|
||||
RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
Display *xlibDisplay = RenderDoc::Inst().GetGlobalEnvironment().xlibDisplay;
|
||||
|
||||
@@ -324,6 +324,7 @@ struct GLPlatform
|
||||
virtual bool CanCreateGLContext() = 0;
|
||||
virtual bool CanCreateGLESContext() = 0;
|
||||
virtual bool PopulateForReplay() = 0;
|
||||
virtual void SetDriverType(RDCDriver api) = 0;
|
||||
virtual RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug) = 0;
|
||||
virtual void *GetReplayFunction(const char *funcname) = 0;
|
||||
};
|
||||
@@ -349,6 +350,7 @@ class GLDummyPlatform : public GLPlatform
|
||||
virtual bool CanCreateGLContext() { return true; }
|
||||
virtual bool CanCreateGLESContext() { return true; }
|
||||
virtual bool PopulateForReplay() { return true; }
|
||||
virtual void SetDriverType(RDCDriver api) {}
|
||||
virtual RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
return ResultCode::Succeeded;
|
||||
|
||||
@@ -613,7 +613,7 @@ WrappedOpenGL::WrappedOpenGL(GLPlatform &platform)
|
||||
BuildGLExtensions();
|
||||
BuildGLESExtensions();
|
||||
// by default we assume OpenGL driver
|
||||
SetDriverType(RDCDriver::OpenGL);
|
||||
m_DriverType = RDCDriver::OpenGL;
|
||||
|
||||
m_Replay = new GLReplay(this);
|
||||
|
||||
@@ -978,6 +978,12 @@ WrappedOpenGL::~WrappedOpenGL()
|
||||
delete m_Replay;
|
||||
}
|
||||
|
||||
void WrappedOpenGL::SetDriverType(RDCDriver type)
|
||||
{
|
||||
m_DriverType = type;
|
||||
m_Platform.SetDriverType(m_DriverType);
|
||||
}
|
||||
|
||||
ContextPair &WrappedOpenGL::GetCtx()
|
||||
{
|
||||
GLContextTLSData *ret = (GLContextTLSData *)Threading::GetTLSValue(m_CurCtxDataTLS);
|
||||
|
||||
@@ -623,7 +623,7 @@ public:
|
||||
CaptureState GetState() { return m_State; }
|
||||
GLReplay *GetReplay() { return m_Replay; }
|
||||
WriteSerialiser &GetSerialiser() { return m_ScratchSerialiser; }
|
||||
void SetDriverType(RDCDriver type) { m_DriverType = type; }
|
||||
void SetDriverType(RDCDriver type);
|
||||
bool isGLESMode() { return m_DriverType == RDCDriver::OpenGLES; }
|
||||
RDCDriver GetDriverType() { return m_DriverType; }
|
||||
ContextPair &GetCtx();
|
||||
|
||||
@@ -50,7 +50,7 @@ void *GetGLHandle()
|
||||
|
||||
class GLXPlatform : public GLPlatform
|
||||
{
|
||||
RDCDriver m_API = RDCDriver::OpenGLES;
|
||||
RDCDriver m_API = RDCDriver::OpenGL;
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
@@ -336,6 +336,7 @@ class GLXPlatform : public GLPlatform
|
||||
}
|
||||
|
||||
bool PopulateForReplay() { return GLX.PopulateForReplay(); }
|
||||
void SetDriverType(RDCDriver api) { m_API = api; }
|
||||
RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
// force debug in development builds
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
class WGLPlatform : public GLPlatform
|
||||
{
|
||||
RDCDriver m_API = RDCDriver::OpenGLES;
|
||||
RDCDriver m_API = RDCDriver::OpenGL;
|
||||
|
||||
bool MakeContextCurrent(GLWindowingData data)
|
||||
{
|
||||
@@ -371,6 +371,7 @@ class WGLPlatform : public GLPlatform
|
||||
}
|
||||
|
||||
bool PopulateForReplay() { return WGL.PopulateForReplay(); }
|
||||
void SetDriverType(RDCDriver api) { m_API = api; }
|
||||
RDResult InitialiseAPI(GLWindowingData &replayContext, RDCDriver api, bool debug)
|
||||
{
|
||||
// force debug in development builds
|
||||
|
||||
Reference in New Issue
Block a user