Fix build on main branch
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 13 Oct 2022 15:28:27 +0000 (17:28 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Fri, 14 Oct 2022 16:13:22 +0000 (16:13 +0000)
This commit fixes several build errors and warnings on the main branch,
as reported by clang/GCC on a Ubuntu 20.04 system. The warnings were
also being converted to errors in check_build_sanity, preventing the
checks from completing successfully.

* VulkanSC did not compile with DEQP_SUPPORT_DRM.
* Some GL callbacks used the wrong prototype.
* Some functions had write-only variables that were not being used.
* One class was not using the "override" suffix for virtual methods
  consistently.

VK-GL-CTS issue: 4032
Components: OpenGL, Vulkan, Framework

Change-Id: I9c3e1af13713f1f6ed10cde1c475f7a1c7e6581a

15 files changed:
external/openglcts/modules/common/glcKHRDebugTests.cpp
external/openglcts/modules/common/glcKHRDebugTests.hpp
external/openglcts/modules/gl/gl3cCullDistanceTests.cpp
external/vulkancts/modules/vulkan/api/vktApiDeviceDrmPropertiesTests.cpp
external/vulkancts/modules/vulkan/api/vktApiDeviceInitializationTests.cpp
external/vulkancts/modules/vulkan/image/vktImageSubresourceLayoutTests.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiAcquireDrmDisplayTests.cpp
framework/common/tcuLibDrm.cpp
framework/common/tcuLibDrm.hpp
framework/opengl/gluShaderLibrary.cpp
framework/opengl/wrapper/glwTypes.inl
framework/platform/lnx/tcuLnxVulkanPlatform.cpp
modules/gles2/functional/es2fPolygonOffsetTests.cpp
modules/gles3/functional/es3fPolygonOffsetTests.cpp
modules/gles31/functional/es31fDebugTests.cpp

index efad8c4..8da51b2 100644 (file)
@@ -1797,7 +1797,7 @@ tcu::TestNode::IterateResult ReceivingMessagesTest::iterate()
  **/
 void ReceivingMessagesTest::debug_proc(glw::GLenum /* source */, glw::GLenum /* type */, glw::GLuint /* id */,
                                                                                glw::GLenum /* severity */, glw::GLsizei /* length */,
-                                                                               const glw::GLchar* /* message */, const void* info)
+                                                                               const glw::GLchar* /* message */, void* info)
 {
        GLuint* counter = (GLuint*)info;
 
@@ -2403,7 +2403,7 @@ SynchronousCallsTest::~SynchronousCallsTest(void)
  **/
 void SynchronousCallsTest::debug_proc(glw::GLenum /* source */, glw::GLenum /* type */, glw::GLuint /* id */,
                                                                          glw::GLenum /* severity */, glw::GLsizei /* length */,
-                                                                         const glw::GLchar* /* message */, const void* info)
+                                                                         const glw::GLchar* /* message */, void* info)
 {
        int* callback_executed = (int*)info;
 
index cce0c5a..b4d0b65 100644 (file)
@@ -318,7 +318,7 @@ public:
 private:
        /* Private routines */
        static void GLW_APIENTRY debug_proc(glw::GLenum source, glw::GLenum type, glw::GLuint id, glw::GLenum severity,
-                                                                               glw::GLsizei length, const glw::GLchar* message, const void* info);
+                                                                               glw::GLsizei length, const glw::GLchar* message, void* info);
 
        void inspectCallbackCounter(glw::GLuint& callback_counter, glw::GLuint expected_number_of_messages) const;
 
@@ -446,7 +446,7 @@ public:
 private:
        /* Private routines */
        static void GLW_APIENTRY debug_proc(glw::GLenum source, glw::GLenum type, glw::GLuint id, glw::GLenum severity,
-                                                                               glw::GLsizei length, const glw::GLchar* message, const void* info);
+                                                                               glw::GLsizei length, const glw::GLchar* message, void* info);
 
        de::ThreadLocal m_tls;
        deUint32                m_uid;
index 79225a7..95f7c12 100644 (file)
@@ -2221,7 +2221,6 @@ void CullDistance::FunctionalTest::executeRenderTest(glw::GLuint   clipdistances_
        glw::GLenum                       mode                                            = GL_NONE;
        glw::GLuint                       n_clipped_vertices_real        = 0;
        glw::GLuint                       n_culled_primitives_real      = 0;
-       glw::GLuint                       n_not_clipped_vertices_real = 0;
        const glw::GLuint        primitive_vertices_count =
                ((primitive_mode == PRIMITIVE_MODE_LINES) ? 2 : (primitive_mode == PRIMITIVE_MODE_POINTS) ? 1 : 3);
        const glw::GLuint stride_in_floats =
@@ -2456,10 +2455,6 @@ void CullDistance::FunctionalTest::executeRenderTest(glw::GLuint  clipdistances_
 
                                        TCU_FAIL("Vertex is unexpectedly clipped or invisible");
                                }
-                               else
-                               {
-                                       n_not_clipped_vertices_real++;
-                               }
                        }
                }
 
index fa764c2..3222a51 100644 (file)
@@ -55,7 +55,7 @@ void testFilesExist (const VkPhysicalDeviceDrmPropertiesEXT& deviceDrmProperties
        bool primaryFound = !deviceDrmProperties.hasPrimary;
        bool renderFound = !deviceDrmProperties.hasRender;
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
        static const tcu::LibDrm libDrm;
 
        int numDrmDevices;
@@ -71,7 +71,7 @@ void testFilesExist (const VkPhysicalDeviceDrmPropertiesEXT& deviceDrmProperties
                renderFound = true;
 
        libDrm.freeDevices(drmDevices, numDrmDevices);
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
        if (!primaryFound && !renderFound) {
                TCU_THROW(NotSupportedError, "Nether DRM primary nor render device files were found");
index f97e23a..a7e290a 100644 (file)
@@ -1544,7 +1544,6 @@ tcu::TestStatus createDeviceWithUnsupportedFeaturesTest (Context& context)
        const VkPhysicalDeviceFeatures2                 deviceFeatures2                 = deviceFeaturesAll.getCoreFeatures2();
        const VkPhysicalDeviceFeatures                  deviceFeatures                  = deviceFeatures2.features;
        const vector<VkQueueFamilyProperties>   queueFamilyProperties   = getPhysicalDeviceQueueFamilyProperties(instanceDriver, physicalDevice);
-       int                                                                             numErrors                               = 0;
 
        // Test features listed in VkPhysicalDeviceFeatures structure
        {
@@ -1656,7 +1655,6 @@ tcu::TestStatus createDeviceWithUnsupportedFeaturesTest (Context& context)
 
                        if (res != VK_ERROR_FEATURE_NOT_PRESENT)
                        {
-                               numErrors++;
                                resultCollector.fail("Not returning VK_ERROR_FEATURE_NOT_PRESENT when creating device with feature "
                                + de::toString(feature.name) + ", which was reported as unsupported.");
                        }
index 9b408cf..a54e01c 100644 (file)
@@ -89,7 +89,6 @@ BufferLevels::BufferLevels (VkImageType type, VkFormat format, VkExtent3D levelZ
 
        VkDeviceSize    currentOffset   = 0ull;
        VkExtent3D              nextExtent              = levelZero;
-       deUint32                levelCount              = 0;
 
        if (!aspects || (aspects & VK_IMAGE_ASPECT_COLOR_BIT))
        {
@@ -130,7 +129,6 @@ BufferLevels::BufferLevels (VkImageType type, VkFormat format, VkExtent3D levelZ
                        nextExtent.depth = std::max(1u, (nextExtent.depth / 2u));
 
                currentOffset += level.size;
-               ++levelCount;
        }
 }
 
index cd2b953..2732e6f 100644 (file)
@@ -31,9 +31,9 @@
 #include "tcuDefs.hpp"
 #include "tcuLibDrm.hpp"
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 #include <fcntl.h>
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 #include <string>
 #include <vector>
@@ -45,9 +45,9 @@ namespace wsi
 using namespace vk;
 using std::string;
 using std::vector;
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 using tcu::LibDrm;
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 #define INVALID_PTR 0xFFFFFFFF
 
@@ -79,7 +79,7 @@ public:
 private:
        CustomInstance                          createInstanceWithAcquireDrmDisplay                     (void);
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
        LibDrm::FdPtr                           getDrmFdPtr                                                                     (void);
        deUint32                                        getConnectedConnectorId                                         (int fd, deUint32 connectorId = 0);
        deUint32                                        getValidCrtcId                                                          (int fd, deUint32 connectorId);
@@ -98,7 +98,7 @@ private:
        tcu::TestStatus                         testReleaseDisplayEXT                                           (void);
 
        const LibDrm                            m_libDrm;
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
        const CustomInstance            m_instance;
        const InstanceInterface&        m_vki;
@@ -132,7 +132,7 @@ AcquireDrmDisplayTestInstance::AcquireDrmDisplayTestInstance (Context& context,
  *//*--------------------------------------------------------------------*/
 tcu::TestStatus AcquireDrmDisplayTestInstance::iterate (void)
 {
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
        switch (m_testId)
        {
                case DRM_TEST_INDEX_GET_DRM_DISPLAY:                                                    return testGetDrmDisplayEXT();
@@ -154,7 +154,7 @@ tcu::TestStatus AcquireDrmDisplayTestInstance::iterate (void)
        TCU_FAIL("Invalid test identifier");
 #else
        TCU_THROW(NotSupportedError, "Drm not supported.");
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 }
 
 // /*--------------------------------------------------------------------*//*!
@@ -177,7 +177,7 @@ CustomInstance AcquireDrmDisplayTestInstance::createInstanceWithAcquireDrmDispla
        return createCustomInstanceWithExtensions(m_context, requiredExtensions);
 }
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 // /*--------------------------------------------------------------------*//*!
 //  * \brief Open a fd for the Drm corresponding to the Vulkan instance
 //  *
@@ -663,7 +663,7 @@ tcu::TestStatus AcquireDrmDisplayTestInstance::testReleaseDisplayEXT (void)
 
        return tcu::TestStatus::pass("pass");
 }
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 /*--------------------------------------------------------------------*//*!
  * \brief Acquire Drm display tests case class
index 7d53528..d5d835e 100644 (file)
@@ -22,7 +22,7 @@
 * \brief Drm utilities.
 *//*--------------------------------------------------------------------*/
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 #include "tcuLibDrm.hpp"
 
@@ -204,4 +204,4 @@ const char* LibDrm::libDrmFiles[] =
 
 } // tcu
 
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
index cae3135..2868392 100644 (file)
@@ -24,7 +24,7 @@
 * \brief Drm utilities.
 *//*--------------------------------------------------------------------*/
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 #include "deDynamicLibrary.hpp"
 
@@ -91,6 +91,6 @@ private:
 
 } // tcu
 
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
-#endif // _TCULIBDRM_HPP
\ No newline at end of file
+#endif // _TCULIBDRM_HPP
index 347ce4c..e8ea64b 100644 (file)
@@ -1036,14 +1036,11 @@ void ShaderParser::parseValue (ValueBlock& valueBlock)
        // Parse actual value.
        if (m_curToken == TOKEN_LEFT_BRACKET) // value list
        {
-               int     arrayLength     = 0; // \todo [2015-08-03 pyry] Currently unused
-
                advanceToken(TOKEN_LEFT_BRACKET);
 
                for (;;)
                {
                        parseValueElement(basicType, dstBlock->back());
-                       arrayLength++;
 
                        if (m_curToken == TOKEN_RIGHT_BRACKET)
                                break;
index eb40825..76d3d1a 100644 (file)
@@ -83,7 +83,7 @@ typedef struct __GLsync*      GLsync;
 typedef void*                          GLeglImageOES;
 
 /* Callback for GL_ARB_debug_output. */
-typedef void (GLW_APIENTRY* GLDEBUGPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam);
+typedef void (GLW_APIENTRY* GLDEBUGPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
 
 /* OES_EGL_image */
 typedef void*                          GLeglImageOES;
index 6b08369..4d57526 100644 (file)
@@ -38,7 +38,9 @@
 
 using de::MovePtr;
 using de::UniquePtr;
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 using tcu::LibDrm;
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 #if defined (DEQP_SUPPORT_X11)
 #      include "tcuLnxX11.hpp"
@@ -227,7 +229,7 @@ public:
 
 #endif // DEQP_SUPPORT_HEADLESS
 
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 struct VulkanWindowDirectDrm : public vk::wsi::Window
 {
@@ -244,7 +246,7 @@ public:
        {
        }
 
-       vk::wsi::Window* createWindow (const Maybe<UVec2>&) const
+       vk::wsi::Window* createWindow (const Maybe<UVec2>&) const override
        {
                return new VulkanWindowDirectDrm();
        }
@@ -321,7 +323,7 @@ public:
        bool m_initialized = false;
 };
 
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
 class VulkanLibrary : public vk::Library
 {
@@ -377,10 +379,10 @@ vk::wsi::Display* VulkanPlatform::createWsiDisplay (vk::wsi::Type wsiType) const
        case vk::wsi::TYPE_HEADLESS:
                return new VulkanDisplayHeadless();
 #endif // DEQP_SUPPORT_HEADLESS
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
        case vk::wsi::TYPE_DIRECT_DRM:
                return new VulkanDisplayDirectDrm();
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
 
        default:
                TCU_THROW(NotSupportedError, "WSI type not supported");
@@ -407,10 +409,10 @@ bool VulkanPlatform::hasDisplay (vk::wsi::Type wsiType) const
        case vk::wsi::TYPE_HEADLESS:
                return true;
 #endif // DEQP_SUPPORT_HEADLESS
-#if DEQP_SUPPORT_DRM
+#if DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
        case vk::wsi::TYPE_DIRECT_DRM:
                return true;
-#endif // DEQP_SUPPORT_DRM
+#endif // DEQP_SUPPORT_DRM && !defined (CTS_USES_VULKANSC)
        default:
                return false;
 
index 0c69b62..d8f4439 100644 (file)
@@ -99,7 +99,6 @@ int compareImages (tcu::TestLog& log, glu::RenderContext& renderCtx, const tcu::
        const tcu::IVec4        threshold               = tcu::IVec4(colorThreshold, colorThreshold, colorThreshold, formatThreshold.getAlpha() > 0 ? colorThreshold : 0)
                                                                                + tcu::IVec4(formatThreshold.getRed(), formatThreshold.getGreen(), formatThreshold.getBlue(), formatThreshold.getAlpha());
 
-       int                     deviatingPixels = 0;
        int                     faultyPixels    = 0;
        int                     compareFailed   = -1;
 
@@ -139,7 +138,6 @@ int compareImages (tcu::TestLog& log, glu::RenderContext& renderCtx, const tcu::
                                        diffMask.setPixel(MASK_COLOR_DEV, x, y);
                                        if (compareFailed == -1)
                                                compareFailed = 0;
-                                       deviatingPixels++;
                                        continue;
                                }
                        }
index b8d13ba..e19f56f 100644 (file)
@@ -102,7 +102,6 @@ int compareImages (tcu::TestLog& log, glu::RenderContext& renderCtx, const tcu::
        const tcu::IVec4        threshold               = tcu::IVec4(colorThreshold, colorThreshold, colorThreshold, formatThreshold.getAlpha() > 0 ? colorThreshold : 0)
                                                                                + tcu::IVec4(formatThreshold.getRed(), formatThreshold.getGreen(), formatThreshold.getBlue(), formatThreshold.getAlpha());
 
-       int                     deviatingPixels = 0;
        int                     faultyPixels    = 0;
        int                     compareFailed   = -1;
 
@@ -142,7 +141,6 @@ int compareImages (tcu::TestLog& log, glu::RenderContext& renderCtx, const tcu::
                                        diffMask.setPixel(MASK_COLOR_DEV, x, y);
                                        if (compareFailed == -1)
                                                compareFailed = 0;
-                                       deviatingPixels++;
                                        continue;
                                }
                        }
index f0dbc9f..9f8e03b 100644 (file)
@@ -310,7 +310,7 @@ struct MessageData
        MessageData (const MessageID& id_, GLenum severity_, const string& message_) : id(id_) , severity(severity_) , message(message_) {}
 };
 
-extern "C" typedef void GLW_APIENTRY DebugCallbackFunc(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, const void*);
+extern "C" typedef void GLW_APIENTRY DebugCallbackFunc(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, void*);
 
 // Base class
 class BaseCase : public NegativeTestShared::ErrorCase
@@ -356,7 +356,7 @@ protected:
        tcu::ResultCollector            m_results;
 };
 
-void BaseCase::callbackHandle (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam)
+void BaseCase::callbackHandle (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, void* userParam)
 {
        static_cast<BaseCase*>(const_cast<void*>(userParam))->callback(source, type, id, severity, string(message, &message[length]));
 }
@@ -2804,7 +2804,7 @@ GroupStackDepthQueryCase::IterateResult GroupStackDepthQueryCase::iterate (void)
        return STOP;
 }
 
-extern "C" void GLW_APIENTRY emptyCallback(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, const void*)
+extern "C" void GLW_APIENTRY emptyCallback(GLenum, GLenum, GLuint, GLenum, GLsizei, const char*, void*)
 {
        // empty
 }