diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index d42b7e800..f865a180a 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -510,7 +510,7 @@ void DoVendorChecks(const GLHookSet &gl, GLPlatform &platform, GLWindowingData c // AMD throws an error if we try to copy the mips that are smaller than 4x4, if(gl.glGetError && gl.glGenTextures && gl.glBindTexture && gl.glCopyImageSubData && gl.glTexStorage2D && gl.glTexSubImage2D && gl.glTexParameteri && gl.glDeleteTextures && - HasExt[ARB_copy_image] && HasExt[ARB_texture_storage]) + HasExt[ARB_copy_image] && HasExt[ARB_texture_storage] && !IsGLES) { GLuint texs[2]; gl.glGenTextures(2, texs); @@ -645,8 +645,9 @@ void DoVendorChecks(const GLHookSet &gl, GLPlatform &platform, GLWindowingData c // only do this when we have a proper context e.g. on windows where an old // context is first created. Check to see if FBOs or VAOs are shared between // contexts. - if(GLCoreVersion >= 32 && gl.glGenVertexArrays && gl.glBindVertexArray && gl.glDeleteVertexArrays && - gl.glGenFramebuffers && gl.glBindFramebuffer && gl.glDeleteFramebuffers) + if((IsGLES || GLCoreVersion >= 32) && gl.glGenVertexArrays && gl.glBindVertexArray && + gl.glDeleteVertexArrays && gl.glGenFramebuffers && gl.glBindFramebuffer && + gl.glDeleteFramebuffers) { // gen & create an FBO and VAO GLuint fbo = 0; @@ -2218,7 +2219,18 @@ void CopyProgramFragDataBindings(const GLHookSet &gl, GLuint progsrc, GLuint pro GLint idx = gl.glGetFragDataLocation(progsrc, refl->OutputSig[i].varName.elems); if(idx >= 0) - gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.elems); + { + if(gl.glBindFragDataLocation) + { + gl.glBindFragDataLocation(progdst, (GLuint)idx, refl->OutputSig[i].varName.elems); + } + else + { + // glBindFragDataLocation is not core GLES, but it is in GL_EXT_blend_func_extended + // TODO what to do if that extension is not supported + RDCERR("glBindFragDataLocation is not supported!"); + } + } } } diff --git a/renderdoc/driver/gl/gl_common.h b/renderdoc/driver/gl/gl_common.h index dde7e94a0..62bf493b9 100644 --- a/renderdoc/driver/gl/gl_common.h +++ b/renderdoc/driver/gl/gl_common.h @@ -326,7 +326,7 @@ extern bool IsGLES; EXT_TO_CHECK(99, 99, EXT_polygon_offset_clamp) \ EXT_TO_CHECK(99, 99, EXT_raster_multisample) \ EXT_TO_CHECK(99, 30, EXT_texture_swizzle) \ - EXT_TO_CHECK(99, 32, KHR_blend_equation_advanced_coherent) \ + EXT_TO_CHECK(99, 99, KHR_blend_equation_advanced_coherent) \ /* OpenGL ES extensions */ \ EXT_TO_CHECK(99, 99, EXT_clip_cull_distance) \ EXT_TO_CHECK(99, 99, EXT_multisample_compatibility) \ diff --git a/renderdoc/driver/gl/gl_driver.cpp b/renderdoc/driver/gl/gl_driver.cpp index e5d020e00..84b0bd12f 100644 --- a/renderdoc/driver/gl/gl_driver.cpp +++ b/renderdoc/driver/gl/gl_driver.cpp @@ -3736,11 +3736,15 @@ void WrappedOpenGL::ContextReplayLog(LogState readType, uint32_t startEventID, u if(q == eGL_NONE) break; - for(int j = 0; j < 8; j++) + int indices = IsGLES ? 1 : 8; // GLES does not support indices + for(int j = 0; j < indices; j++) { if(m_ActiveQueries[i][j]) { - m_Real.glEndQueryIndexed(q, j); + if(IsGLES) + m_Real.glEndQuery(q); + else + m_Real.glEndQueryIndexed(q, j); m_ActiveQueries[i][j] = false; } } diff --git a/renderdoc/driver/gl/gl_hooks_egl.cpp b/renderdoc/driver/gl/gl_hooks_egl.cpp index 4cca52907..05b36c052 100644 --- a/renderdoc/driver/gl/gl_hooks_egl.cpp +++ b/renderdoc/driver/gl/gl_hooks_egl.cpp @@ -221,8 +221,8 @@ public: Display *dpy = XOpenDisplay(NULL); if(dpy == NULL) return ret; - break; #endif + break; } default: RDCERR("Unexpected window system %u", system); break; } @@ -435,8 +435,12 @@ __attribute__((visibility("default"))) EGLContext eglCreateContext(EGLDisplay di init.depthBits = value; eglhooks.eglGetConfigAttrib_real(display, config, EGL_STENCIL_SIZE, &value); init.stencilBits = value; - // TODO: how to detect this? +// TODO: how to detect this? +#if ENABLED(RDOC_ANDROID) + init.isSRGB = 0; +#else init.isSRGB = 1; +#endif GLWindowingData data; data.egl_dpy = display; diff --git a/renderdoc/driver/gl/gl_replay_egl.cpp b/renderdoc/driver/gl/gl_replay_egl.cpp index f41d28bdb..fe80f716a 100644 --- a/renderdoc/driver/gl/gl_replay_egl.cpp +++ b/renderdoc/driver/gl/gl_replay_egl.cpp @@ -113,6 +113,10 @@ ReplayCreateStatus GLES_CreateReplayDevice(const char *logfile, IReplayDriver ** return status; } +#if ENABLED(RDOC_ANDROID) + initParams.isSRGB = 0; +#endif + #if DISABLED(RDOC_ANDROID) Display *dpy = XOpenDisplay(NULL); diff --git a/renderdoc/driver/gl/gl_shader_refl.cpp b/renderdoc/driver/gl/gl_shader_refl.cpp index 57646d7fc..925adca42 100644 --- a/renderdoc/driver/gl/gl_shader_refl.cpp +++ b/renderdoc/driver/gl/gl_shader_refl.cpp @@ -283,7 +283,8 @@ GLuint MakeSeparableShaderProgram(WrappedOpenGL &gl, GLenum type, vector gl.glGetProgramiv(sepProg, eGL_LINK_STATUS, &status); // allow any vertex processing shader to redeclare gl_PerVertex - if(status == 0 && type != eGL_FRAGMENT_SHADER && type != eGL_COMPUTE_SHADER) + // on GLES it is not required + if(!IsGLES && status == 0 && type != eGL_FRAGMENT_SHADER && type != eGL_COMPUTE_SHADER) { gl.glDeleteProgram(sepProg); sepProg = 0;