Improve logging of indexed enable and disable calls.
authorMika Isojärvi <misojarvi@google.com>
Mon, 9 Mar 2015 21:10:33 +0000 (14:10 -0700)
committerJarkko Poyry <jpoyry@google.com>
Mon, 9 Mar 2015 21:30:07 +0000 (21:30 +0000)
Change-Id: Iddf92e228c2843b06fc89ca181db3d3a07e8c6f1

framework/opengl/gluCallLogWrapper.inl
framework/opengl/gluStrUtil.inl
framework/opengl/gluStrUtilPrototypes.inl
scripts/opengl/gen_call_log_wrapper.py
scripts/opengl/gen_str_util.py

index 2e433e073f4957f192daae28de6f7c5ede2300bd..8f947381c13564e5b554330aaaefb0237af2194b 100644 (file)
@@ -928,7 +928,7 @@ void CallLogWrapper::glDisableVertexAttribArray (glw::GLuint index)
 void CallLogWrapper::glDisablei (glw::GLenum target, glw::GLuint index)
 {
        if (m_enableLog)
-               m_log << TestLog::Message << "glDisablei(" << toHex(target) << ", " << index << ");" << TestLog::EndMessage;
+               m_log << TestLog::Message << "glDisablei(" << getIndexedEnableCapStr(target) << ", " << index << ");" << TestLog::EndMessage;
        m_gl.disablei(target, index);
 }
 
@@ -1117,7 +1117,7 @@ void CallLogWrapper::glEnableVertexAttribArray (glw::GLuint index)
 void CallLogWrapper::glEnablei (glw::GLenum target, glw::GLuint index)
 {
        if (m_enableLog)
-               m_log << TestLog::Message << "glEnablei(" << toHex(target) << ", " << index << ");" << TestLog::EndMessage;
+               m_log << TestLog::Message << "glEnablei(" << getIndexedEnableCapStr(target) << ", " << index << ");" << TestLog::EndMessage;
        m_gl.enablei(target, index);
 }
 
@@ -2453,7 +2453,7 @@ glw::GLboolean CallLogWrapper::glIsEnabled (glw::GLenum cap)
 glw::GLboolean CallLogWrapper::glIsEnabledi (glw::GLenum target, glw::GLuint index)
 {
        if (m_enableLog)
-               m_log << TestLog::Message << "glIsEnabledi(" << toHex(target) << ", " << index << ");" << TestLog::EndMessage;
+               m_log << TestLog::Message << "glIsEnabledi(" << getIndexedEnableCapStr(target) << ", " << index << ");" << TestLog::EndMessage;
        glw::GLboolean returnValue = m_gl.isEnabledi(target, index);
        if (m_enableLog)
                m_log << TestLog::Message << "// " << getBooleanStr(returnValue) << " returned" << TestLog::EndMessage;
index 4e3422deae5447f03a5b7cb20594d4f4cdc1ffeb..583b27a4de373c80b3adadd2db03fe8ee75312a8 100644 (file)
@@ -490,6 +490,15 @@ const char* getEnableCapName (int value)
        }
 }
 
+const char* getIndexedEnableCapName (int value)
+{
+       switch (value)
+       {
+               case GL_BLEND:  return "GL_BLEND";
+               default:                return DE_NULL;
+       }
+}
+
 const char* getWindingName (int value)
 {
        switch (value)
@@ -1373,7 +1382,13 @@ const char* getGettableIndexedStateName (int value)
                case GL_IMAGE_BINDING_LAYER:                            return "GL_IMAGE_BINDING_LAYER";
                case GL_IMAGE_BINDING_ACCESS:                           return "GL_IMAGE_BINDING_ACCESS";
                case GL_IMAGE_BINDING_FORMAT:                           return "GL_IMAGE_BINDING_FORMAT";
-               case GL_BLEND_EQUATION:                                         return "GL_BLEND_EQUATION";
+               case GL_BLEND_EQUATION_RGB:                                     return "GL_BLEND_EQUATION_RGB";
+               case GL_BLEND_EQUATION_ALPHA:                           return "GL_BLEND_EQUATION_ALPHA";
+               case GL_BLEND_SRC_RGB:                                          return "GL_BLEND_SRC_RGB";
+               case GL_BLEND_SRC_ALPHA:                                        return "GL_BLEND_SRC_ALPHA";
+               case GL_BLEND_DST_RGB:                                          return "GL_BLEND_DST_RGB";
+               case GL_BLEND_DST_ALPHA:                                        return "GL_BLEND_DST_ALPHA";
+               case GL_COLOR_WRITEMASK:                                        return "GL_COLOR_WRITEMASK";
                default:                                                                        return DE_NULL;
        }
 }
index 3cb35465ca4bfffad81e3da67ee5aa172bb06169..4c888b8bfdfd921688752482a36c776119e90f5a 100644 (file)
@@ -26,6 +26,7 @@ const char*                                                   getBufferQueryName                                              (int value);
 const char*                                                    getFaceName                                                             (int value);
 const char*                                                    getCompareFuncName                                              (int value);
 const char*                                                    getEnableCapName                                                (int value);
+const char*                                                    getIndexedEnableCapName                                 (int value);
 const char*                                                    getWindingName                                                  (int value);
 const char*                                                    getHintModeName                                                 (int value);
 const char*                                                    getHintName                                                             (int value);
@@ -99,6 +100,7 @@ inline tcu::Format::Enum<int, 2>     getBufferQueryStr                                               (int value)             { return tc
 inline tcu::Format::Enum<int, 2>       getFaceStr                                                              (int value)             { return tcu::Format::Enum<int, 2>(getFaceName, value); }
 inline tcu::Format::Enum<int, 2>       getCompareFuncStr                                               (int value)             { return tcu::Format::Enum<int, 2>(getCompareFuncName, value); }
 inline tcu::Format::Enum<int, 2>       getEnableCapStr                                                 (int value)             { return tcu::Format::Enum<int, 2>(getEnableCapName, value); }
+inline tcu::Format::Enum<int, 2>       getIndexedEnableCapStr                                  (int value)             { return tcu::Format::Enum<int, 2>(getIndexedEnableCapName, value); }
 inline tcu::Format::Enum<int, 2>       getWindingStr                                                   (int value)             { return tcu::Format::Enum<int, 2>(getWindingName, value); }
 inline tcu::Format::Enum<int, 2>       getHintModeStr                                                  (int value)             { return tcu::Format::Enum<int, 2>(getHintModeName, value); }
 inline tcu::Format::Enum<int, 2>       getHintStr                                                              (int value)             { return tcu::Format::Enum<int, 2>(getHintName, value); }
index f13d7bb6df7c3eaf364e964a47d79f53b8a5e005..84bf266b7e899b2353fe625dc0609b99e727c38e 100644 (file)
@@ -95,6 +95,7 @@ CALL_LOG_SPECS = {
        "glDeleteProgramPipelines":                             LogSpec({1: pointer(size = "n")}),
        "glDepthFunc":                                                  LogSpec({0: enum("CompareFunc")}),
        "glDisable":                                                    LogSpec({0: enum("EnableCap")}),
+       "glDisablei":                                                   LogSpec({0: enum("IndexedEnableCap")}),
        "glDrawArrays":                                                 LogSpec({0: enum("PrimitiveType")}),
        "glDrawArraysInstanced":                                LogSpec({0: enum("PrimitiveType")}),
        "glDrawBuffers":                                                LogSpec({1: enumPointer("DrawReadBuffer", size = "n")}),
@@ -110,6 +111,7 @@ CALL_LOG_SPECS = {
        "glMultiDrawElements":                                  LogSpec({0: enum("PrimitiveType"), 2: enum("Type")}),
        "glMultiDrawElementsBaseVertex":                LogSpec({0: enum("PrimitiveType"), 2: enum("Type")}),
        "glEnable":                                                             LogSpec({0: enum("EnableCap")}),
+       "glEnablei":                                                    LogSpec({0: enum("IndexedEnableCap")}),
        "glEndQuery":                                                   LogSpec({0: enum("QueryTarget")}),
        "glFramebufferRenderbuffer":                    LogSpec({0: enum("FramebufferTarget"), 1: enum("FramebufferAttachment"), 2: enum("FramebufferTarget")}),
        "glFramebufferTexture2D":                               LogSpec({0: enum("FramebufferTarget"), 1: enum("FramebufferAttachment"), 2: enum("TextureTarget")}),
@@ -202,6 +204,7 @@ CALL_LOG_SPECS = {
 #      "glGetVertexAttribPointerv":
        "glHint":                                                               LogSpec({0: enum("Hint"), 1: enum("HintMode")}),
        "glIsEnabled":                                                  LogSpec({0: enum("EnableCap")}),
+       "glIsEnabledi":                                                 LogSpec({0: enum("IndexedEnableCap")}),
        "glPixelStorei":                                                LogSpec({0: enum("PixelStoreParameter")}),
        "glReadBuffer":                                                 LogSpec({0: enum("DrawReadBuffer")}),
        "glReadPixels":                                                 LogSpec({4: enum("PixelFormat"), 5: enum("Type")}),
index 0fe7f95180e52de5265477c1b1eff8769edafa9d..c6b1517e5e3d459a1b4cd0b283b5c56afda08fcc 100644 (file)
@@ -328,6 +328,9 @@ ENUM_GROUPS = [
                                                         "PRIMITIVE_RESTART", "SAMPLE_MASK", "DEBUG_OUTPUT", "DEBUG_OUTPUT_SYNCHRONOUS",
                                                         "BLEND_ADVANCED_COHERENT_KHR"]),
 
+       # Indexed enable-disable bit
+       ("IndexedEnableCap",    ["BLEND"]),
+
        # Polygon winding
        ("Winding",                             ["CW", "CCW"]),
 
@@ -788,7 +791,13 @@ ENUM_GROUPS = [
                "IMAGE_BINDING_LAYER",
                "IMAGE_BINDING_ACCESS",
                "IMAGE_BINDING_FORMAT",
-               "BLEND_EQUATION",
+               "BLEND_EQUATION_RGB",
+               "BLEND_EQUATION_ALPHA",
+               "BLEND_SRC_RGB",
+               "BLEND_SRC_ALPHA",
+               "BLEND_DST_RGB",
+               "BLEND_DST_ALPHA",
+               "COLOR_WRITEMASK",
        ]),
 
        ("GettableString", [