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.
This commit is contained in:
baldurk
2014-12-30 23:51:47 +00:00
parent c1727e9035
commit 6c635e3157
@@ -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);