diff --git a/renderdoc/driver/gl/glx_platform.cpp b/renderdoc/driver/gl/glx_platform.cpp index dc2fbb51d..4986817d3 100644 --- a/renderdoc/driver/gl/glx_platform.cpp +++ b/renderdoc/driver/gl/glx_platform.cpp @@ -50,6 +50,8 @@ void *GetGLHandle() class GLXPlatform : public GLPlatform { + RDCDriver m_API = RDCDriver::OpenGLES; + bool MakeContextCurrent(GLWindowingData data) { if(GLX.glXMakeCurrent) @@ -241,7 +243,8 @@ class GLXPlatform : public GLPlatform attribs[i++] = 0; #endif attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB; - attribs[i++] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + attribs[i++] = m_API == RDCDriver::OpenGLES ? GLX_CONTEXT_ES2_PROFILE_BIT_EXT + : GLX_CONTEXT_CORE_PROFILE_BIT_ARB; GLXContext ctx = GLX.glXCreateContextAttribsARB(dpy, fbcfg[0], share_context.ctx, true, attribs); @@ -342,6 +345,8 @@ class GLXPlatform : public GLPlatform RDCASSERT(api == RDCDriver::OpenGL || api == RDCDriver::OpenGLES); + m_API = api; + int attribs[64] = {0}; int i = 0; diff --git a/renderdoc/driver/gl/wgl_platform.cpp b/renderdoc/driver/gl/wgl_platform.cpp index c4bd7f584..35b2dd2ed 100644 --- a/renderdoc/driver/gl/wgl_platform.cpp +++ b/renderdoc/driver/gl/wgl_platform.cpp @@ -29,6 +29,8 @@ class WGLPlatform : public GLPlatform { + RDCDriver m_API = RDCDriver::OpenGLES; + bool MakeContextCurrent(GLWindowingData data) { if(WGL.wglMakeCurrent) @@ -108,6 +110,9 @@ class WGLPlatform : public GLPlatform SetPixelFormat(dc, pf, &pfd); + int profile = m_API == RDCDriver::OpenGLES ? WGL_CONTEXT_ES2_PROFILE_BIT_EXT + : WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + const int attribs[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, 3, @@ -116,7 +121,7 @@ class WGLPlatform : public GLPlatform WGL_CONTEXT_FLAGS_ARB, 0, WGL_CONTEXT_PROFILE_MASK_ARB, - WGL_CONTEXT_CORE_PROFILE_BIT_ARB, + profile, 0, 0, }; @@ -289,7 +294,8 @@ class WGLPlatform : public GLPlatform attribs[i++] = 0; #endif attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; - attribs[i++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + attribs[i++] = m_API == RDCDriver::OpenGLES ? WGL_CONTEXT_ES2_PROFILE_BIT_EXT + : WGL_CONTEXT_CORE_PROFILE_BIT_ARB; HGLRC rc = WGL.wglCreateContextAttribsARB(DC, share_context.ctx, attribs); if(rc == NULL) @@ -374,6 +380,8 @@ class WGLPlatform : public GLPlatform RDCASSERT(api == RDCDriver::OpenGL || api == RDCDriver::OpenGLES); + m_API = api; + bool success = RegisterClass(); if(!success)