Fix dEQP-VK.api.image_clearing.*.clear_depth_stencil_image
authorTom Cooper <tom.cooper@arm.com>
Mon, 3 Feb 2020 14:39:33 +0000 (14:39 +0000)
committerTom Cooper <tom.cooper@arm.com>
Tue, 4 Feb 2020 11:22:49 +0000 (06:22 -0500)
Check device extensions before trying to create the renderpass using
vkCreateRenderPass2KHR.

Components: Vulkan

VK-GL-CTS Issue: 2208

Affects: dEQP-VK.api.image_clearing.*

Change-Id: I02bb1ccb8f07c7f2baa7357a639f4bdcc1dcd73f

external/vulkancts/modules/vulkan/api/vktApiImageClearingTests.cpp

index 26aed40b8e4ce2843d18fbd2dc07ec81ce9b7a4a..bede5f47d40faaabaff21fff5d75588129891e22 100644 (file)
@@ -552,8 +552,8 @@ protected:
        Unique<VkImage>                                         m_image;
        de::MovePtr<Allocation>                         m_imageMemory;
        Unique<VkImageView>                                     m_imageView;
-       Unique<VkRenderPass>                            m_renderPass;
-       Unique<VkFramebuffer>                           m_frameBuffer;
+       Move<VkRenderPass>                                      m_renderPass;
+       Move<VkFramebuffer>                                     m_frameBuffer;
 };
 
 ImageClearingTestInstance::ImageClearingTestInstance (Context& context, const TestParams& params)
@@ -588,14 +588,18 @@ ImageClearingTestInstance::ImageClearingTestInstance (Context& context, const Te
                                                                                                 m_imageAspectFlags,
                                                                                                 params.imageViewLayerRange) : vk::Move<VkImageView>())
 
-       , m_renderPass                          (m_isAttachmentFormat ? createRenderPass(params.imageFormat) : vk::Move<vk::VkRenderPass>())
-       , m_frameBuffer                         (m_isAttachmentFormat ? createFrameBuffer(*m_imageView, *m_renderPass, params.imageExtent.width, params.imageExtent.height, params.imageViewLayerRange.layerCount) : vk::Move<vk::VkFramebuffer>())
 {
        if (m_params.allocationKind == ALLOCATION_KIND_DEDICATED)
                context.requireDeviceFunctionality("VK_KHR_dedicated_allocation");
 
        if (m_params.separateDepthStencilLayoutMode != SEPARATE_DEPTH_STENCIL_LAYOUT_MODE_NONE)
                context.requireDeviceFunctionality("VK_KHR_separate_depth_stencil_layouts");
+
+       if (m_isAttachmentFormat)
+       {
+               m_renderPass = createRenderPass(params.imageFormat);
+               m_frameBuffer = createFrameBuffer(*m_imageView, *m_renderPass, params.imageExtent.width, params.imageExtent.height, params.imageViewLayerRange.layerCount);
+       }
 }
 
 ImageClearingTestInstance::ViewType ImageClearingTestInstance::getViewType (deUint32 imageLayerCount) const