Merge vk-gl-cts/vulkan-cts-1.1.3 into vk-gl-cts/vulkan-cts-1.1.4
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 6 Jun 2019 15:10:54 +0000 (17:10 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Thu, 6 Jun 2019 15:10:54 +0000 (17:10 +0200)
Change-Id: Id4adb91216cbc973009a884cf29f1d6fa4412980

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

index c75a4abc6267fa7c251d58162d9642ee46fbc90e,020019f08a8bc41672f85cbb58e5dc7dc18af87e..b66e94cf95823a62c5952c8dd840c7809afa3e5d
@@@ -2162,42 -2009,18 +2162,45 @@@ void MultisampleRenderer::initialize (C
        if (!isSupportedSampleCount(context.getInstanceInterface(), context.getPhysicalDevice(), m_multisampleStateParams.rasterizationSamples))
                throw tcu::NotSupportedError("Unsupported number of rasterization samples");
  
 -      const DeviceInterface&          vk                                              = context.getDeviceInterface();
 -      const VkDevice                          vkDevice                                = context.getDevice();
 -      const deUint32                          queueFamilyIndices[]    = { context.getUniversalQueueFamilyIndex(), context.getSparseQueueFamilyIndex() };
 -      const bool                                      sparse                                  = m_backingMode == IMAGE_BACKING_MODE_SPARSE;
 -      const VkComponentMapping        componentMappingRGBA    = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
 -      const VkImageCreateFlags        imageCreateFlags                = sparse ? (VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) : 0u;
 -      const VkSharingMode                     sharingMode                             = (sparse && context.getUniversalQueueFamilyIndex() != context.getSparseQueueFamilyIndex()) ? VK_SHARING_MODE_CONCURRENT : VK_SHARING_MODE_EXCLUSIVE;
 -      Allocator&                                      memAlloc                                = m_context.getDefaultAllocator();
 +      const DeviceInterface&                  vk                                              = context.getDeviceInterface();
 +      const VkDevice                                  vkDevice                                = context.getDevice();
 +      const VkPhysicalDeviceFeatures  features                                = context.getDeviceFeatures();
 +      const deUint32                                  queueFamilyIndices[]    = { context.getUniversalQueueFamilyIndex(), context.getSparseQueueFamilyIndex() };
 +      const bool                                              sparse                                  = m_backingMode == IMAGE_BACKING_MODE_SPARSE;
 +      const VkComponentMapping                componentMappingRGBA    = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
 +      const VkImageCreateFlags                imageCreateFlags                = sparse ? (VK_IMAGE_CREATE_SPARSE_BINDING_BIT | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) : 0u;
 +      const VkSharingMode                             sharingMode                             = (sparse && context.getUniversalQueueFamilyIndex() != context.getSparseQueueFamilyIndex()) ? VK_SHARING_MODE_CONCURRENT : VK_SHARING_MODE_EXCLUSIVE;
 +      Allocator&                                              memAlloc                                = m_context.getDefaultAllocator();
 +      const bool                                              usesResolveImage                = m_renderType == RENDER_TYPE_RESOLVE || m_renderType == RENDER_TYPE_DEPTHSTENCIL_ONLY;
 +
 +      if (sparse)
 +      {
 +              bool sparseSamplesSupported = false;
 +              switch(m_multisampleStateParams.rasterizationSamples)
 +              {
 +                      case VK_SAMPLE_COUNT_2_BIT:
 +                              sparseSamplesSupported = features.sparseResidency2Samples;
 +                              break;
 +                      case VK_SAMPLE_COUNT_4_BIT:
 +                              sparseSamplesSupported = features.sparseResidency4Samples;
 +                              break;
 +                      case VK_SAMPLE_COUNT_8_BIT:
 +                              sparseSamplesSupported = features.sparseResidency8Samples;
 +                              break;
 +                      case VK_SAMPLE_COUNT_16_BIT:
 +                              sparseSamplesSupported = features.sparseResidency16Samples;
 +                              break;
 +                      default:
 +                              break;
 +              }
 +
 +              if (!sparseSamplesSupported)
 +                      throw tcu::NotSupportedError("Unsupported number of rasterization samples for sparse residency");
 +      }
  
+       if (sparse && !context.getDeviceFeatures().sparseBinding)
+               throw tcu::NotSupportedError("No sparseBinding support");
        // Create color image
        {
                const VkImageUsageFlags imageUsageFlags         = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT |