From 6c635e31571245e3554d0449ab0aceb4177a48fc Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 30 Dec 2014 23:51:47 +0000 Subject: [PATCH] For ease of use, skip glDisable for any deprecated compat caps * This is for working with compatibility profiles, which I only plan to do when it's harmless little tweaks like this. Not in a significant way (like supporting the fixed function pipeline, display lists, etc). * The theory here is that glDisable on a deprecated cap is 'harmless' as it's already off by not existing. And maybe when capturing a mostly-core program that has some legacy code or runs in compatibility, it calls glDisable for these caps but never plans to use them. So we can ignore it * If glEnable is called though, we serialise that and it will fire errors and the replay will be wrong. That doesn't change. --- renderdoc/driver/gl/wrappers/gl_state_funcs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/renderdoc/driver/gl/wrappers/gl_state_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_state_funcs.cpp index a94951e56..9c05ace17 100644 --- a/renderdoc/driver/gl/wrappers/gl_state_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_state_funcs.cpp @@ -839,6 +839,15 @@ void WrappedOpenGL::glDisable(GLenum cap) if(m_State == WRITING_CAPFRAME) { + // Skip some compatibility caps purely for the sake of avoiding debug message spam. + // We don't explicitly support compatibility, but where it's trivial we try and support it. + // If these are enabled anywhere in the program/capture then the replay will probably be + // wrong, but some legacy codebases running compatibility might still disable these. + // So we don't skip these on glEnable (they will be serialised, and fire an error as + // appropriate). + if(cap == 0x0B50) return; // GL_LIGHTING + if(cap == 0x0BC0) return; // GL_ALPHA_TEST + SCOPED_SERIALISE_CONTEXT(DISABLE); Serialise_glDisable(cap);