Fix Fedora 32 gcc/clang warnings
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 7 May 2020 14:16:08 +0000 (16:16 +0200)
committerziga <ziga@lunarg.com>
Mon, 22 Aug 2022 17:45:03 +0000 (19:45 +0200)
Component: AOSP, OpenGL, Vulkan

VK-GL-CTS issue: 2350

Affects:
KHR*direct_state_access.vertex_arrays*
KHR*core.arrays_of_arrays.sized_declarations_invalid*
dEQP-VK.geometry.*

Change-Id: I55680ac671d0610917d45f7187deec6e883dd6b7

22 files changed:
external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp
external/openglcts/modules/gl/gl4cShaderStorageBufferObjectTests.cpp
external/openglcts/modules/gles31/es31cArrayOfArraysTests.cpp
external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp
external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalClearAttachmentTests.cpp
external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDrawTests.cpp
external/vulkancts/modules/vulkan/draw/vktBasicDrawTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawConcurrentTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp
external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderDrawParametersTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateCBTests.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateDSTests.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateGeneralTests.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateRSTests.cpp
external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateVPTests.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryBasicClass.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineBlendTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp
modules/gles31/functional/es31fSeparateShaderTests.cpp
modules/gles31/functional/es31fVertexAttributeBindingTests.cpp

index dd42b58..9e0ba0d 100644 (file)
@@ -316,7 +316,7 @@ glw::GLuint EnableDisableAttributesTest::BuildProgram(const char* vertex_shader,
                glw::GLuint                              id;
        } shader[] = { { vertex_shader, GL_VERTEX_SHADER, 0 }, { s_fragment_shader, GL_FRAGMENT_SHADER, 0 } };
 
-       glw::GLuint const shader_count = sizeof(shader) / sizeof(shader[0]);
+       glw::GLuint const shader_count = DE_LENGTH_OF_ARRAY(shader);
 
        glw::GLuint po = 0;
 
@@ -884,7 +884,7 @@ void ElementBufferTest::PrepareProgram()
                glw::GLuint                              id;
        } shader[] = { { s_vertex_shader, GL_VERTEX_SHADER, 0 }, { s_fragment_shader, GL_FRAGMENT_SHADER, 0 } };
 
-       glw::GLuint const shader_count = sizeof(shader) / sizeof(shader[0]);
+       glw::GLuint const shader_count = DE_LENGTH_OF_ARRAY(shader);
 
        try
        {
@@ -1331,7 +1331,7 @@ void VertexBuffersTest::PrepareProgram()
                glw::GLuint                              id;
        } shader[] = { { s_vertex_shader, GL_VERTEX_SHADER, 0 }, { s_fragment_shader, GL_FRAGMENT_SHADER, 0 } };
 
-       glw::GLuint const shader_count = sizeof(shader) / sizeof(shader[0]);
+       glw::GLuint const shader_count = DE_LENGTH_OF_ARRAY(shader);
 
        try
        {
@@ -1962,7 +1962,7 @@ void AttributeFormatTest::PrepareProgram(glw::GLint size, AtributeFormatFunction
                                         0 },
                                   { { s_fragment_shader, DE_NULL, DE_NULL }, 1, GL_FRAGMENT_SHADER, 0 } };
 
-       glw::GLuint const shader_count = sizeof(shader) / sizeof(shader[0]);
+       glw::GLuint const shader_count = DE_LENGTH_OF_ARRAY(shader);
 
        try
        {
@@ -2652,7 +2652,7 @@ void AttributeBindingTest::PrepareProgram()
                glw::GLuint                              id;
        } shader[] = { { s_vertex_shader, GL_VERTEX_SHADER, 0 }, { s_fragment_shader, GL_FRAGMENT_SHADER, 0 } };
 
-       glw::GLuint const shader_count = sizeof(shader) / sizeof(shader[0]);
+       glw::GLuint const shader_count = DE_LENGTH_OF_ARRAY(shader);
 
        try
        {
@@ -4770,7 +4770,7 @@ tcu::TestNode::IterateResult AttributeFormatErrorsTest::iterate()
                {
                        bad_type++;
                        is_accepted_type = false;
-                       for (glw::GLuint i = 0; i < sizeof(accepted_types) / sizeof(accepted_types[0]); ++i)
+                       for (glw::GLuint i = 0; i < DE_LENGTH_OF_ARRAY(accepted_types); ++i)
                        {
                                if (accepted_types[i] == bad_type)
                                {
@@ -5481,7 +5481,7 @@ tcu::TestNode::IterateResult GetVertexArrayIndexedErrorsTest::iterate()
                {
                        bad_pname++;
                        is_accepted_pname = false;
-                       for (glw::GLuint i = 0; i < sizeof(accepted_pnames) / sizeof(accepted_pnames[0]); ++i)
+                       for (glw::GLuint i = 0; i < DE_LENGTH_OF_ARRAY(accepted_pnames); ++i)
                        {
                                if (accepted_pnames[i] == bad_pname)
                                {
index 564a1f0..7597d49 100644 (file)
@@ -6109,7 +6109,7 @@ class AdvancedWriteTessellation : public ShaderStorageBufferObjectBase
                        int  pad[3];
                        vec4 position;
                } data[6];
-               memset(data, 0, sizeof(data));
+               deMemset((void *)data, 0, sizeof(data));
                glGenBuffers(1, &m_storage_buffer);
                glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_storage_buffer);
                glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(data), data, GL_DYNAMIC_DRAW);
index 189cbab..2ef6ea0 100644 (file)
@@ -1787,7 +1787,7 @@ void sized_declarations_invalid_sizes1<API>::test_shader_compilation(
        };
 
        for (size_t invalid_declarations_index = 0;
-                invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations[0]);
+                invalid_declarations_index < DE_LENGTH_OF_ARRAY(invalid_declarations);
                 invalid_declarations_index++)
        {
                std::string shader_source;
@@ -1825,7 +1825,7 @@ void sized_declarations_invalid_sizes2<API>::test_shader_compilation(
        };
 
        for (size_t invalid_declarations_index = 0;
-                invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations[0]);
+                invalid_declarations_index < DE_LENGTH_OF_ARRAY(invalid_declarations);
                 invalid_declarations_index++)
        {
                std::string shader_source;
@@ -1864,7 +1864,7 @@ void sized_declarations_invalid_sizes3<API>::test_shader_compilation(
        std::string non_constant_variable_declaration = "    uint a = 2u;\n";
 
        for (size_t invalid_declarations_index = 0;
-                invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations[0]);
+                invalid_declarations_index < DE_LENGTH_OF_ARRAY(invalid_declarations);
                 invalid_declarations_index++)
        {
                std::string shader_source;
index cba2e02..4cc5ad6 100644 (file)
@@ -386,7 +386,7 @@ void initPrograms (SourceCollections& programCollection, const LineOrientation l
 
 void initProgramsPointSize (SourceCollections& programCollection)
 {
-       addSimplePrograms(programCollection, 0.75f * RENDER_SIZE);
+       addSimplePrograms(programCollection, 0.75f * static_cast<float>(RENDER_SIZE));
 }
 
 //! Primitives fully inside the clip volume.
index f0173e0..43fbb93 100644 (file)
@@ -185,7 +185,7 @@ tcu::TestStatus ConditionalClearAttachmentTest::iterate (void)
        submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                                                                  referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
index 352e964..e84d114 100644 (file)
@@ -456,7 +456,7 @@ tcu::TestStatus ConditionalDraw::iterate (void)
        submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                                                                  referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
index 997d865..120235d 100644 (file)
@@ -663,7 +663,7 @@ tcu::TestStatus DrawTestInstance<DrawParams>::iterate (void)
        submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::TextureLevel refImage (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::TextureLevel refImage (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        tcu::clear(refImage.getAccess(), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
        std::vector<tcu::Vec4>  vertices;
@@ -779,7 +779,7 @@ tcu::TestStatus DrawTestInstance<DrawIndexedParams>::iterate (void)
        submitCommandsAndWait(m_vk, vkDevice, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::TextureLevel       refImage        (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::TextureLevel       refImage        (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        tcu::clear(refImage.getAccess(), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
        std::vector<tcu::Vec4>  vertices;
@@ -908,7 +908,7 @@ tcu::TestStatus DrawTestInstance<DrawIndirectParams>::iterate (void)
        submitCommandsAndWait(m_vk, vkDevice, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::TextureLevel refImage (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::TextureLevel refImage (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        tcu::clear(refImage.getAccess(), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
        for (std::vector<vk::VkDrawIndirectCommand>::const_iterator it = m_data.commands.begin(); it != m_data.commands.end(); ++it)
@@ -1090,7 +1090,7 @@ tcu::TestStatus DrawTestInstance<DrawIndexedIndirectParams>::iterate (void)
        submitCommandsAndWait(m_vk, vkDevice, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::TextureLevel refImage (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::TextureLevel refImage (vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        tcu::clear(refImage.getAccess(), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
        for (std::vector<vk::VkDrawIndexedIndirectCommand>::const_iterator cmd = m_data.commands.begin(); cmd != m_data.commands.end(); ++cmd)
index f0d693d..03679c3 100644 (file)
@@ -332,7 +332,7 @@ tcu::TestStatus ConcurrentDraw::iterate (void)
 
        // Validation - draw
 
-       tcu::Texture2D referenceFrame(mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
 
        referenceFrame.allocLevel(0);
 
index 8192cde..85b6d2c 100644 (file)
@@ -168,7 +168,7 @@ tcu::TestStatus DrawIndexed::iterate (void)
        submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                                                                  referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -275,7 +275,7 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void)
        // Validation
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth = referenceFrame.getWidth();
index 9d46cf4..60b11e1 100644 (file)
@@ -601,7 +601,7 @@ tcu::TestStatus IndirectDraw::iterate (void)
        submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -948,7 +948,7 @@ tcu::TestStatus IndirectDrawInstanced<FirstInstanceSupport>::iterate (void)
        // Validation
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5 + static_cast<float>(HEIGHT)));
 
        referenceFrame.allocLevel(0);
 
index 3741046..32bd129 100644 (file)
@@ -199,8 +199,8 @@ void DrawTest::drawReferenceImage (const tcu::PixelBufferAccess& refImage) const
        const Vec4      allColors[]                     = { Vec4(1.0f), Vec4(0.0f, 0.0f, 1.0f, 1.0f), Vec4(0.0f, 1.0f, 0.0f, 1.0f) };
        const int       numInstances            = isInstanced() ? MAX_INSTANCE_COUNT            : 1;
        const int       numIndirectDraws        = isMultiDraw() ? MAX_INDIRECT_DRAW_COUNT       : 1;
-       const int       rectWidth                       = static_cast<int>(WIDTH  * 0.6f / 2.0f);
-       const int       rectHeight                      = static_cast<int>(HEIGHT * 0.6f / 2.0f);
+       const int       rectWidth                       = static_cast<int>(static_cast<float>(WIDTH)  * 0.6f / 2.0f);
+       const int       rectHeight                      = static_cast<int>(static_cast<float>(HEIGHT) * 0.6f / 2.0f);
 
        DE_ASSERT(DE_LENGTH_OF_ARRAY(perInstanceOffset) >= numInstances);
        DE_ASSERT(DE_LENGTH_OF_ARRAY(allColors) >= numInstances && DE_LENGTH_OF_ARRAY(allColors) >= numIndirectDraws);
@@ -213,8 +213,8 @@ void DrawTest::drawReferenceImage (const tcu::PixelBufferAccess& refImage) const
        {
                const Vec2      offset  = perInstanceOffset[instanceNdx] + perDrawOffset[drawNdx];
                const Vec4&     color   = allColors[isMultiDraw() ? drawNdx : instanceNdx];
-               int                     x               = static_cast<int>(WIDTH  * (1.0f - 0.3f + offset.x()) / 2.0f);
-               int                     y               = static_cast<int>(HEIGHT * (1.0f - 0.3f + offset.y()) / 2.0f);
+               int                     x               = static_cast<int>(static_cast<float>(WIDTH)  * (1.0f - 0.3f + offset.x()) / 2.0f);
+               int                     y               = static_cast<int>(static_cast<float>(HEIGHT) * (1.0f - 0.3f + offset.y()) / 2.0f);
 
                tcu::clear(tcu::getSubregion(refImage, x, y, rectWidth, rectHeight), color);
        }
@@ -296,7 +296,7 @@ tcu::TestStatus DrawTest::iterate (void)
 
        // Validate
        {
-               tcu::TextureLevel referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), static_cast<int>(0.5f + WIDTH), static_cast<int>(0.5f + HEIGHT));
+               tcu::TextureLevel referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), static_cast<int>(0.5f + static_cast<float>(WIDTH)), static_cast<int>(0.5f + static_cast<float>(HEIGHT)));
 
                drawReferenceImage(referenceFrame.getAccess());
 
index 2fd0642..c72b858 100644 (file)
@@ -152,7 +152,7 @@ tcu::TestStatus SimpleDraw::iterate (void)
        submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
        // Validation
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
 
        referenceFrame.allocLevel(0);
 
@@ -246,7 +246,7 @@ tcu::TestStatus SimpleDrawInstanced::iterate (void)
        // Validation
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
-       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
 
        referenceFrame.allocLevel(0);
 
index 3622e98..499a6df 100644 (file)
@@ -115,7 +115,7 @@ public:
 
                //validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
index 784f10b..024ab82 100644 (file)
@@ -450,7 +450,7 @@ public:
 
                // validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
@@ -634,7 +634,7 @@ tcu::TestStatus DepthBoundsTestInstance::iterate (void)
        const vk::VkDevice      device          = m_context.getDevice();
 
        // Prepare depth image
-       tcu::Texture2D depthData(vk::mapVkFormat(m_depthAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+       tcu::Texture2D depthData(vk::mapVkFormat(m_depthAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
        depthData.allocLevel(0);
 
        const deInt32 depthDataWidth    = depthData.getWidth();
@@ -698,7 +698,7 @@ tcu::TestStatus DepthBoundsTestInstance::iterate (void)
 
        // Validation
        {
-               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                referenceFrame.allocLevel(0);
 
                const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -827,7 +827,7 @@ public:
 
                // validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
@@ -984,7 +984,7 @@ public:
 
                // validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
index 9d09fc6..254eab1 100644 (file)
@@ -106,7 +106,7 @@ public:
                submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
                //validation
-               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                referenceFrame.allocLevel(0);
 
                const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -203,7 +203,7 @@ public:
                submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
                //validation
-               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                referenceFrame.allocLevel(0);
 
                const deInt32 frameWidth = referenceFrame.getWidth();
@@ -340,7 +340,7 @@ public:
                submitCommandsAndWait(m_vk, device, queue, m_cmdBuffer.get());
 
                //validation
-               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                referenceFrame.allocLevel(0);
 
                const deInt32 frameWidth        = referenceFrame.getWidth();
index a47a429..d487798 100644 (file)
@@ -421,7 +421,7 @@ public:
                {
                        VK_CHECK(m_vk.queueWaitIdle(queue));
 
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
@@ -514,7 +514,7 @@ public:
 
                // validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -599,7 +599,7 @@ public:
 
                // validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
index 26ffdb3..a35c669 100644 (file)
@@ -129,7 +129,7 @@ public:
 
        virtual void setDynamicStates(void)
        {
-               const vk::VkViewport viewport   = { 0.0f, 0.0f, (float)WIDTH * 2, (float)HEIGHT * 2, 0.0f, 0.0f };
+               const vk::VkViewport viewport   = { 0.0f, 0.0f, static_cast<float>(WIDTH) * 2.0f, static_cast<float>(HEIGHT) * 2.0f, 0.0f, 0.0f };
                const vk::VkRect2D scissor              = { { 0, 0 }, { WIDTH, HEIGHT } };
 
                setDynamicViewportState(1, &viewport, &scissor);
@@ -140,7 +140,7 @@ public:
 
        virtual tcu::Texture2D buildReferenceFrame (void)
        {
-               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                referenceFrame.allocLevel(0);
 
                const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -187,7 +187,7 @@ public:
 
        virtual tcu::Texture2D buildReferenceFrame (void)
        {
-               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+               tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                referenceFrame.allocLevel(0);
 
                const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -308,7 +308,7 @@ public:
 
                // validation
                {
-                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+                       tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5f + static_cast<float>(WIDTH)), (int)(0.5f + static_cast<float>(HEIGHT)));
                        referenceFrame.allocLevel(0);
 
                        const deInt32 frameWidth = referenceFrame.getWidth();
index 24cb4b3..c90e076 100644 (file)
@@ -78,7 +78,7 @@ tcu::TestStatus GeometryExpanderRenderTestInstance::iterate (void)
                                                                                                                                vk,
                                                                                                                                device,
                                                                                                                                memAlloc,
-                                                                                                                               makeImageCreateInfo(resolution, colorFormat, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT),
+                                                                                                                               makeImageCreateInfo(resolution, colorFormat, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT),
                                                                                                                                MemoryRequirement::Any
                                                                                                                        );
        const Unique<VkRenderPass>              renderPass                              (makeRenderPass(vk, device, colorFormat));
index 3f0dba1..1821ed1 100644 (file)
@@ -849,8 +849,8 @@ float getNormChannelThreshold (const tcu::TextureFormat& format, int numBits)
 {
        switch (tcu::getTextureChannelClass(format.type))
        {
-               case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:     return BlendTest::QUAD_COUNT / static_cast<float>((1 << numBits) - 1);
-               case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:       return BlendTest::QUAD_COUNT / static_cast<float>((1 << (numBits - 1)) - 1);
+               case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT:     return static_cast<float>(BlendTest::QUAD_COUNT) / static_cast<float>((1 << numBits) - 1);
+               case tcu::TEXTURECHANNELCLASS_SIGNED_FIXED_POINT:       return static_cast<float>(BlendTest::QUAD_COUNT) / static_cast<float>((1 << (numBits - 1)) - 1);
                default:
                        break;
        }
index 32e6187..bc64f4d 100644 (file)
@@ -13192,7 +13192,7 @@ tcu::TestCaseGroup* createFloat16CompositeInsertExtractSet (tcu::TestContext& te
        const string                                            opName                  (op);
        const deUint32                                          opIndex                 = (opName == "OpCompositeInsert") ? 0
                                                                                                                : (opName == "OpCompositeExtract") ? 1
-                                                                                                               : -1;
+                                                                                                               : std::numeric_limits<deUint32>::max();
 
        const StringTemplate preMain
        (
index 4043fec..dea33ce 100644 (file)
@@ -1724,7 +1724,7 @@ TestCaseGroup* createSeparateShaderTests (Context& ctx)
        enum
        {
                NUM_INTERPOLATIONS      = VARYINGINTERPOLATION_RANDOM, // VARYINGINTERPOLATION_RANDOM is one after last fully specified interpolation
-               INTERFACEFLAGS_LAST = BINDING_LAST * NUM_INTERPOLATIONS * NUM_INTERPOLATIONS
+               INTERFACEFLAGS_LAST = static_cast<int>(BINDING_LAST) * static_cast<int>(NUM_INTERPOLATIONS) * static_cast<int>(NUM_INTERPOLATIONS)
        };
 
        for (deUint32 flags = 0; flags < INTERFACEFLAGS_LAST; ++flags)
index e430fd4..7f6e614 100644 (file)
@@ -735,12 +735,12 @@ void MultipleBindingCase::createBuffers (void)
        if (m_spec.instanced)
        {
                // store single basic primitive
-               primitiveData[0] = tcu::Vec4(0.0f,                              0.0f,                           0.0f, 1.0f);
-               primitiveData[1] = tcu::Vec4(0.0f,                              2.0f / GRID_SIZE,       0.0f, 1.0f);
-               primitiveData[2] = tcu::Vec4(2.0f / GRID_SIZE,  2.0f / GRID_SIZE,       0.0f, 1.0f);
-               primitiveData[3] = tcu::Vec4(0.0f,                              0.0f,                           0.0f, 1.0f);
-               primitiveData[4] = tcu::Vec4(2.0f / GRID_SIZE,  2.0f / GRID_SIZE,       0.0f, 1.0f);
-               primitiveData[5] = tcu::Vec4(2.0f / GRID_SIZE,  0.0f,                           0.0f, 1.0f);
+               primitiveData[0] = tcu::Vec4(0.0f,                                              0.0f,                                           0.0f, 1.0f);
+               primitiveData[1] = tcu::Vec4(0.0f,                                              2.0f / float(GRID_SIZE),        0.0f, 1.0f);
+               primitiveData[2] = tcu::Vec4(2.0f / float(GRID_SIZE),   2.0f / float(GRID_SIZE),        0.0f, 1.0f);
+               primitiveData[3] = tcu::Vec4(0.0f,                                              0.0f,                                           0.0f, 1.0f);
+               primitiveData[4] = tcu::Vec4(2.0f / float(GRID_SIZE),   2.0f / float(GRID_SIZE),        0.0f, 1.0f);
+               primitiveData[5] = tcu::Vec4(2.0f / float(GRID_SIZE),   0.0f,                                           0.0f, 1.0f);
        }
        else
        {
@@ -1013,12 +1013,12 @@ void MixedBindingCase::createBuffers (void)
 
        for (int primNdx = 0; primNdx < numPositionCells; ++primNdx)
        {
-               positionData[primNdx*6 + 0] =  tcu::Vec4(0.0f,                          0.0f,                           0.0f, 1.0f);
-               positionData[primNdx*6 + 1] =  tcu::Vec4(0.0f,                          2.0f / GRID_SIZE,       0.0f, 1.0f);
-               positionData[primNdx*6 + 2] =  tcu::Vec4(2.0f / GRID_SIZE,      2.0f / GRID_SIZE,       0.0f, 1.0f);
-               positionData[primNdx*6 + 3] =  tcu::Vec4(0.0f,                          0.0f,                           0.0f, 1.0f);
-               positionData[primNdx*6 + 4] =  tcu::Vec4(2.0f / GRID_SIZE,      2.0f / GRID_SIZE,       0.0f, 1.0f);
-               positionData[primNdx*6 + 5] =  tcu::Vec4(2.0f / GRID_SIZE,      0.0f,                           0.0f, 1.0f);
+               positionData[primNdx*6 + 0] =  tcu::Vec4(0.0f,                                          0.0f,                                           0.0f, 1.0f);
+               positionData[primNdx*6 + 1] =  tcu::Vec4(0.0f,                                          2.0f / float(GRID_SIZE),        0.0f, 1.0f);
+               positionData[primNdx*6 + 2] =  tcu::Vec4(2.0f / float(GRID_SIZE),       2.0f / float(GRID_SIZE),        0.0f, 1.0f);
+               positionData[primNdx*6 + 3] =  tcu::Vec4(0.0f,                                          0.0f,                                           0.0f, 1.0f);
+               positionData[primNdx*6 + 4] =  tcu::Vec4(2.0f / float(GRID_SIZE),       2.0f / float(GRID_SIZE),        0.0f, 1.0f);
+               positionData[primNdx*6 + 5] =  tcu::Vec4(2.0f / float(GRID_SIZE),       0.0f,                                           0.0f, 1.0f);
        }
 
        // color & offset