makeFramebufferWithoutAttachments creates invalid framebuffer
authorAlex Walters <alex.walters@imgtec.com>
Thu, 27 Apr 2017 09:24:08 +0000 (10:24 +0100)
committerAlex Walters <alex.walters@imgtec.com>
Thu, 27 Apr 2017 09:24:08 +0000 (10:24 +0100)
Current behaviour of setting width, height, and layers to zero is
invalid. The validity language specifies that width, height, and
layers must be > 0.

The same function exists in the utils files for sparse_resources
and synchronization tests, I've removed the unused copies.

Affects:

dEQP-VK.tessellation*

Components: Vulkan

VK-GL-CTS issue: 265

(cherry picked from commit bce45b549d21f068a75d005fe55bd87460b5df29)

Change-Id: I7e6196944b1197ca3ce2d16ff17623e6e9bcfae7

external/vulkancts/modules/vulkan/synchronization/vktSynchronizationUtil.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationUtil.hpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationUtil.cpp

index ecfab5a..7e59f2b 100644 (file)
@@ -441,45 +441,6 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface&  vk,
        return createRenderPass(vk, device, &renderPassInfo);
 }
 
-Move<VkRenderPass> makeRenderPassWithoutAttachments (const DeviceInterface&    vk,
-                                                                                                        const VkDevice                 device)
-{
-       const VkAttachmentReference unusedAttachment =
-       {
-               VK_ATTACHMENT_UNUSED,                                                           // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout        layout;
-       };
-
-       const VkSubpassDescription subpassDescription =
-       {
-               (VkSubpassDescriptionFlags)0,                                           // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-               0u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-               &unusedAttachment,                                                                      // const VkAttachmentReference*         pDepthStencilAttachment;
-               0u,                                                                                                     // deUint32                                                     preserveAttachmentCount;
-               DE_NULL                                                                                         // const deUint32*                                      pPreserveAttachments;
-       };
-
-       const VkRenderPassCreateInfo renderPassInfo =
-       {
-               VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-               DE_NULL,                                                                                        // const void*                                          pNext;
-               (VkRenderPassCreateFlags)0,                                                     // VkRenderPassCreateFlags                      flags;
-               0u,                                                                                                     // deUint32                                                     attachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentDescription*       pAttachments;
-               1u,                                                                                                     // deUint32                                                     subpassCount;
-               &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-               0u,                                                                                                     // deUint32                                                     dependencyCount;
-               DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-       };
-
-       return createRenderPass(vk, device, &renderPassInfo);
-}
-
 Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
                                                                         const VkDevice                         device,
                                                                         const VkRenderPass                     renderPass,
@@ -503,25 +464,6 @@ Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&                vk,
        return createFramebuffer(vk, device, &framebufferInfo);
 }
 
-Move<VkFramebuffer> makeFramebufferWithoutAttachments (const DeviceInterface&          vk,
-                                                                                                          const VkDevice                               device,
-                                                                                                          const VkRenderPass                   renderPass)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               0u,                                                                                             // uint32_t                                    attachmentCount;
-               DE_NULL,                                                                                // const VkImageView*                          pAttachments;
-               0u,                                                                                             // uint32_t                                    width;
-               0u,                                                                                             // uint32_t                                    height;
-               0u,                                                                                             // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 GraphicsPipelineBuilder& GraphicsPipelineBuilder::setShader (const DeviceInterface&                    vk,
                                                                                                                         const VkDevice                                 device,
                                                                                                                         const VkShaderStageFlagBits    stage,
index 79e352d..49feef5 100644 (file)
@@ -220,9 +220,7 @@ vk::Move<vk::VkPipelineLayout>      makePipelineLayout                                                      (const vk::DeviceInterfa
 vk::Move<vk::VkPipelineLayout> makePipelineLayoutWithoutDescriptors            (const vk::DeviceInterface& vk, const vk::VkDevice device);
 vk::Move<vk::VkPipeline>               makeComputePipeline                                                     (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkPipelineLayout pipelineLayout, const vk::VkShaderModule shaderModule, const vk::VkSpecializationInfo* specInfo, PipelineCacheData& pipelineCacheData);
 vk::Move<vk::VkRenderPass>             makeRenderPass                                                          (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkFormat colorFormat);
-vk::Move<vk::VkRenderPass>             makeRenderPassWithoutAttachments                        (const vk::DeviceInterface& vk, const vk::VkDevice device);
 vk::Move<vk::VkFramebuffer>            makeFramebuffer                                                         (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const vk::VkImageView colorAttachment, const deUint32 width, const deUint32 height, const deUint32 layers);
-vk::Move<vk::VkFramebuffer>            makeFramebufferWithoutAttachments                       (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass);
 vk::Move<vk::VkImageView>              makeImageView                                                           (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkImage image, const vk::VkImageViewType viewType, const vk::VkFormat format, const vk::VkImageSubresourceRange subresourceRange);
 vk::Move<vk::VkEvent>                  makeEvent                                                                       (const vk::DeviceInterface& vk, const vk::VkDevice device);
 vk::VkBufferImageCopy                  makeBufferImageCopy                                                     (const vk::VkImageSubresourceLayers subresourceLayers, const vk::VkExtent3D extent);
index 58f6c96..c7c8edc 100644 (file)
@@ -482,9 +482,9 @@ Move<VkFramebuffer> makeFramebufferWithoutAttachments (const DeviceInterface&               v
                renderPass,                                                                             // VkRenderPass                                renderPass;
                0u,                                                                                             // uint32_t                                    attachmentCount;
                DE_NULL,                                                                                // const VkImageView*                          pAttachments;
-               0u,                                                                                             // uint32_t                                    width;
-               0u,                                                                                             // uint32_t                                    height;
-               0u,                                                                                             // uint32_t                                    layers;
+               1u,                                                                                             // uint32_t                                    width;
+               1u,                                                                                             // uint32_t                                    height;
+               1u,                                                                                             // uint32_t                                    layers;
        };
 
        return createFramebuffer(vk, device, &framebufferInfo);