From b9f1b9820f0636229e33e3256933b8f380b0c822 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 15 Jan 2015 15:25:18 +0000 Subject: [PATCH] Inline the glClear values in the description * Even though this is latched state from glClearColor etc, this means we don't have to list that in the pipeline state, we can just show it here where it's relevant. --- .../driver/gl/wrappers/gl_draw_funcs.cpp | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp index 96af7bbff..991a36721 100644 --- a/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_draw_funcs.cpp @@ -2724,17 +2724,28 @@ bool WrappedOpenGL::Serialise_glClear(GLbitfield mask) { AddEvent(CLEARBUFFERF, desc); string name = "glClear("; - if(Mask & GL_DEPTH_BUFFER_BIT) - name += "GL_DEPTH_BUFFER_BIT | "; if(Mask & GL_COLOR_BUFFER_BIT) - name += "GL_COLOR_BUFFER_BIT | "; + { + float col[4] = {0}; + m_Real.glGetFloatv(eGL_COLOR_CLEAR_VALUE, &col[0]); + name += StringFormat::Fmt("Color = <%f, %f, %f, %f>, ", col[0], col[1], col[2], col[3]); + } + if(Mask & GL_DEPTH_BUFFER_BIT) + { + float depth = 0; + m_Real.glGetFloatv(eGL_DEPTH_CLEAR_VALUE, &depth); + name += StringFormat::Fmt("Depth = <%f>, ", depth); + } if(Mask & GL_STENCIL_BUFFER_BIT) - name += "GL_STENCIL_BUFFER_BIT | "; + { + GLint stencil = 0; + m_Real.glGetIntegerv(eGL_STENCIL_CLEAR_VALUE, &stencil); + name += StringFormat::Fmt("Stencil = <0x%02x>, ", stencil); + } if(Mask & (eGL_DEPTH_BUFFER_BIT|eGL_COLOR_BUFFER_BIT|eGL_STENCIL_BUFFER_BIT)) { - name.pop_back(); // ' ' - name.pop_back(); // '|' + name.pop_back(); // ',' name.pop_back(); // ' ' }