Fix another set of warnings reported by GCC
authorPyry Haulos <phaulos@google.com>
Thu, 21 Jul 2016 21:12:26 +0000 (14:12 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 21 Jul 2016 21:12:26 +0000 (14:12 -0700)
external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesShaderIntrinsicsStorage.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationInternallySynchronizedObjectsTests.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp

index c00cc44..669f4ff 100644 (file)
@@ -48,8 +48,8 @@ void SparseShaderIntrinsicsCaseStorage::initPrograms (vk::SourceCollections& pro
        const std::string       formatDataStr   = getShaderImageDataType(m_format);
        const std::string       formatQualStr   = getShaderImageFormatQualifier(m_format);
 
-       const std::string  coordString          = getShaderImageCoordinates(m_imageType, 
-                                                                                                                                       "%local_int_GlobalInvocationID_x", 
+       const std::string  coordString          = getShaderImageCoordinates(m_imageType,
+                                                                                                                                       "%local_int_GlobalInvocationID_x",
                                                                                                                                        "%local_ivec2_GlobalInvocationID_xy",
                                                                                                                                        "%local_ivec3_GlobalInvocationID_xyz");
        // Create compute program
@@ -212,7 +212,7 @@ void SparseShaderIntrinsicsCaseStorage::initPrograms (vk::SourceCollections& pro
                // Load residency code for OpImageSparse*
                << "%local_residency_code = OpCompositeExtract %type_int %local_sparse_op_result 0\n"
                // End Call OpImageSparse*
-                       
+
                // Load texels image
                << "%local_image_texels = OpLoad %type_image_texels %uniform_image_texels\n"
 
@@ -236,16 +236,16 @@ void SparseShaderIntrinsicsCaseStorage::initPrograms (vk::SourceCollections& pro
 
                // Loaded texel is not in resident memory
                << "OpImageWrite %local_image_residency " << coordString << " %constant_uvec4_not_resident\n"
-                       
+
                << "OpBranch %branch_texel_resident\n"
                << "%branch_texel_resident = OpLabel\n"
-                       
+
                << "OpBranch %label_out_range_z\n"
                << "%label_out_range_z = OpLabel\n"
 
                << "OpBranch %label_out_range_y\n"
                << "%label_out_range_y = OpLabel\n"
-                       
+
                << "OpBranch %label_out_range_x\n"
                << "%label_out_range_x = OpLabel\n"
 
@@ -266,7 +266,7 @@ std::string SparseCaseOpImageSparseFetch::sparseImageTypeDecl (const std::string
 
 std::string    SparseCaseOpImageSparseFetch::sparseImageOpString  (const std::string& resultVariable,
                                                                                                                                const std::string& resultType,
-                                                                                                                               const std::string& image, 
+                                                                                                                               const std::string& image,
                                                                                                                                const std::string& coord,
                                                                                                                                const std::string& mipLevel) const
 {
@@ -423,12 +423,12 @@ void SparseShaderIntrinsicsInstanceStorage::recordCommands (vk::Allocator&                                al
 
        const VkSpecializationMapEntry specializationMapEntries[6] =
        {
-               { 1u, 0u * sizeof(deUint32), sizeof(deUint32) }, // GridSize.x
-               { 2u, 1u * sizeof(deUint32), sizeof(deUint32) }, // GridSize.y
-               { 3u, 2u * sizeof(deUint32), sizeof(deUint32) }, // GridSize.z
-               { 4u, 3u * sizeof(deUint32), sizeof(deUint32) }, // WorkGroupSize.x
-               { 5u, 4u * sizeof(deUint32), sizeof(deUint32) }, // WorkGroupSize.y
-               { 6u, 5u * sizeof(deUint32), sizeof(deUint32) }, // WorkGroupSize.z
+               { 1u, 0u * (deUint32)sizeof(deUint32), sizeof(deUint32) }, // GridSize.x
+               { 2u, 1u * (deUint32)sizeof(deUint32), sizeof(deUint32) }, // GridSize.y
+               { 3u, 2u * (deUint32)sizeof(deUint32), sizeof(deUint32) }, // GridSize.z
+               { 4u, 3u * (deUint32)sizeof(deUint32), sizeof(deUint32) }, // WorkGroupSize.x
+               { 5u, 4u * (deUint32)sizeof(deUint32), sizeof(deUint32) }, // WorkGroupSize.y
+               { 6u, 5u * (deUint32)sizeof(deUint32), sizeof(deUint32) }, // WorkGroupSize.z
        };
 
        Unique<VkShaderModule> shaderModule(createShaderModule(deviceInterface, *m_logicalDevice, m_context.getBinaryCollection().get("compute"), 0u));
@@ -441,10 +441,10 @@ void SparseShaderIntrinsicsInstanceStorage::recordCommands (vk::Allocator&                                al
 
                const VkSpecializationInfo specializationInfo =
                {
-                       sizeof(specializationMapEntries) / sizeof(VkSpecializationMapEntry),    // mapEntryCount
-                       specializationMapEntries,                                                                                               // pMapEntries
-                       sizeof(specializationData),                                                                                             // dataSize
-                       specializationData,                                                                                                             // pData
+                       (deUint32)DE_LENGTH_OF_ARRAY(specializationMapEntries), // mapEntryCount
+                       specializationMapEntries,                                                               // pMapEntries
+                       sizeof(specializationData),                                                             // dataSize
+                       specializationData,                                                                             // pData
                };
 
                // Create and bind compute pipeline
@@ -459,7 +459,7 @@ void SparseShaderIntrinsicsInstanceStorage::recordCommands (vk::Allocator&                          al
 
                // Bind resources
                const VkImageSubresourceRange mipLevelRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, mipLevelNdx, 1u, 0u, imageSparseInfo.arrayLayers);
-               
+
                imageSparseViews[mipLevelNdx] = makeVkSharedPtr(makeImageView(deviceInterface, *m_logicalDevice, imageSparse, mapImageViewType(m_imageType), imageSparseInfo.format, mipLevelRange));
                const VkDescriptorImageInfo imageSparseDescInfo = makeDescriptorImageInfo(DE_NULL, **imageSparseViews[mipLevelNdx], VK_IMAGE_LAYOUT_GENERAL);
 
index d873592..8706ead 100644 (file)
@@ -607,7 +607,7 @@ public:
                ResultCollector         resultCollector;
                for (int executionNdx = 0; executionNdx < EXECUTION_PER_THREAD; ++executionNdx)
                {
-                       const int shaderNdx                                     = executionNdx % m_pipelineInfo.size();
+                       const int shaderNdx                                     = executionNdx % (int)m_pipelineInfo.size();
                        const DeviceInterface&  vk                      = m_context.getDeviceInterface();
                        const VkDevice                  device          = m_queues.getDevice();
                        Move<VkPipeline>                pipeline        = createComputePipeline(vk,device,m_pipelineCache, &m_pipelineInfo[shaderNdx]);
@@ -637,7 +637,7 @@ public:
                ResultCollector         resultCollector;
                for (int executionNdx = 0; executionNdx < EXECUTION_PER_THREAD; ++executionNdx)
                {
-                       const int shaderNdx                                     = executionNdx % m_pipelineInfo.size();
+                       const int shaderNdx                                     = executionNdx % (int)m_pipelineInfo.size();
                        const DeviceInterface&  vk                      = m_context.getDeviceInterface();
                        const VkDevice                  device          = m_queues.getDevice();
                        Move<VkPipeline>                pipeline        = createGraphicsPipeline(vk,device, m_pipelineCache, &m_pipelineInfo[shaderNdx]);
index 1396886..88f7172 100644 (file)
@@ -3251,7 +3251,7 @@ public:
                        vk.cmdBindVertexBuffers(cmdBuffer, 0u, 1u, &m_resource.getBuffer().handle, &vertexBufferOffset);
                }
 
-               vk.cmdDraw(cmdBuffer, static_cast<deUint32>(dataSizeBytes)/sizeof(tcu::UVec4), 1u, 0u, 0u);
+               vk.cmdDraw(cmdBuffer, static_cast<deUint32>(dataSizeBytes / sizeof(tcu::UVec4)), 1u, 0u, 0u);
                endRenderPass(vk, cmdBuffer);
        }
 
index 4de0915..61bc271 100644 (file)
@@ -1549,6 +1549,7 @@ tcu::TestStatus resizeSwapchainTest (Context& context, Type wsiType)
        Move<VkSwapchainKHR>                    prevSwapchain;
 
        DE_ASSERT(platformProperties.swapchainExtent != PlatformProperties::SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE);
+       DE_UNREF(platformProperties);
 
        for (deUint32 sizeNdx = 0; sizeNdx < sizes.size(); ++sizeNdx)
        {