Merge vk-gl-cts/vulkan-cts-1.1.1 into vk-gl-cts/vulkan-cts-next-dev
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 22 Feb 2018 14:23:23 +0000 (15:23 +0100)
committerAlexander Galazin <alexander.galazin@arm.com>
Thu, 22 Feb 2018 14:23:23 +0000 (15:23 +0100)
Change-Id: I34f59a239f54a494734f6934cdadf9cc45d02fcb

1  2 
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp

@@@ -555,16 -555,6 +555,16 @@@ void uploadTestTextureInternal (const D
        VK_CHECK(vk.waitForFences(device, 1, &fence.get(), true, ~(0ull) /* infinity */));
  }
  
 +bool checkSparseImageFormatSupport (const VkPhysicalDevice            physicalDevice,
 +                                                                      const InstanceInterface&        instance,
 +                                                                      const VkImageCreateInfo&        imageCreateInfo)
 +{
 +      const std::vector<VkSparseImageFormatProperties> sparseImageFormatPropVec =
 +              getPhysicalDeviceSparseImageFormatProperties(instance, physicalDevice, imageCreateInfo.format, imageCreateInfo.imageType, imageCreateInfo.samples, imageCreateInfo.usage, imageCreateInfo.tiling);
 +
 +      return (sparseImageFormatPropVec.size() != 0);
 +}
 +
  void allocateAndBindSparseImage (const DeviceInterface&                                               vk,
                                                                 VkDevice                                                                       device,
                                                                 const VkPhysicalDevice                                         physicalDevice,
        deUint32                                                                sparseMemoryReqCount    = 0;
  
        // Check if the image format supports sparse operations
 -      const std::vector<VkSparseImageFormatProperties> sparseImageFormatPropVec =
 -              getPhysicalDeviceSparseImageFormatProperties(instance, physicalDevice, imageCreateInfo.format, imageCreateInfo.imageType, imageCreateInfo.samples, imageCreateInfo.usage, imageCreateInfo.tiling);
 -
 -      if (sparseImageFormatPropVec.size() == 0)
 +      if (!checkSparseImageFormatSupport(physicalDevice, instance, imageCreateInfo))
                TCU_THROW(NotSupportedError, "The image format does not support sparse operations.");
  
        vk.getImageSparseMemoryRequirements(device, destImage, &sparseMemoryReqCount, DE_NULL);
                                imageMipTailMemoryBinds.push_back(imageMipTailMemoryBind);
                        }
                }
                // Handle Metadata. Similarly to MIP tail in aspectRequirements, there are two cases to consider here:
                //
                // 1) VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT is requested by the driver: each layer needs a separate tail.
@@@ -812,9 -804,8 +811,9 @@@ void uploadTestTextureInternalSparse (c
                                                                          const VkPhysicalDevice                                        physicalDevice,
                                                                          const InstanceInterface&                                      instance,
                                                                          const VkImageCreateInfo&                                      imageCreateInfo,
 -                                                                        VkQueue                                                                       queue,
 -                                                                        deUint32                                                                      queueFamilyIndex,
 +                                                                        VkQueue                                                                       universalQueue,
 +                                                                        deUint32                                                                      universalQueueFamilyIndex,
 +                                                                        VkQueue                                                                       sparseQueue,
                                                                          Allocator&                                                            allocator,
                                                                          std::vector<de::SharedPtr<Allocation> >&      allocations,
                                                                          const TestTexture&                                            srcTexture,
                bufferSize              = stencilOffset + srcStencilTexture->getSize();
        }
  
 -      allocateAndBindSparseImage (vk, device, physicalDevice, instance, imageCreateInfo, imageMemoryBindSemaphore.get(), queue, allocator, allocations, format, destImage);
 +      allocateAndBindSparseImage (vk, device, physicalDevice, instance, imageCreateInfo, imageMemoryBindSemaphore.get(), sparseQueue, allocator, allocations, format, destImage);
  
        {
                // Create source buffer
  
                Move<VkBuffer>                  buffer          = createBuffer(vk, device, &bufferParams);
                de::MovePtr<Allocation> bufferAlloc = allocator.allocate(getBufferMemoryRequirements(vk, device, *buffer), MemoryRequirement::HostVisible);
 -              Move<VkCommandPool>             cmdPool         = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
 +              Move<VkCommandPool>             cmdPool         = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, universalQueueFamilyIndex);
                Move<VkCommandBuffer>   cmdBuffer       = allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
                Move<VkFence>                   fence           = createFence(vk, device);
  
  
                try
                {
 -                      VK_CHECK(vk.queueSubmit(queue, 1, &submitInfo, *fence));
 +                      VK_CHECK(vk.queueSubmit(universalQueue, 1, &submitInfo, *fence));
                        VK_CHECK(vk.waitForFences(device, 1, &fence.get(), true, ~(0ull) /* infinity */));
                }
                catch (...)
@@@ -1028,9 -1019,8 +1027,9 @@@ void uploadTestTextureSparse (const Dev
                                                          const VkPhysicalDevice                                        physicalDevice,
                                                          const InstanceInterface&                                      instance,
                                                          const VkImageCreateInfo&                                      imageCreateInfo,
 -                                                        VkQueue                                                                       queue,
 -                                                        deUint32                                                                      queueFamilyIndex,
 +                                                        VkQueue                                                                       universalQueue,
 +                                                        deUint32                                                                      universalQueueFamilyIndex,
 +                                                        VkQueue                                                                       sparseQueue,
                                                          Allocator&                                                            allocator,
                                                          std::vector<de::SharedPtr<Allocation> >&      allocations,
                                                          const TestTexture&                                            srcTexture,
                                                                                 physicalDevice,
                                                                                 instance,
                                                                                 imageCreateInfo,
 -                                                                               queue,
 -                                                                               queueFamilyIndex,
 +                                                                               universalQueue,
 +                                                                               universalQueueFamilyIndex,
 +                                                                               sparseQueue,
                                                                                 allocator,
                                                                                 allocations,
                                                                                 *srcDepthTexture,
                                                                                 physicalDevice,
                                                                                 instance,
                                                                                 imageCreateInfo,
 -                                                                               queue,
 -                                                                               queueFamilyIndex,
 +                                                                               universalQueue,
 +                                                                               universalQueueFamilyIndex,
 +                                                                               sparseQueue,
                                                                                 allocator,
                                                                                 allocations,
                                                                                 srcTexture,