Merge common util functions, part 2
authorIlkka Saarelainen <ilkka.saarelainen@siru.fi>
Wed, 5 Jun 2019 10:25:42 +0000 (13:25 +0300)
committerAlexander Galazin <alexander.galazin@arm.com>
Wed, 19 Jun 2019 10:56:15 +0000 (12:56 +0200)
Many tests have their own util functions for creating commonly used
Vulkan objects.
This CL moves the following helper functions to the framework:

- makePipelineLayout()
- makeFramebuffer()
- makeCommandPool()

Affects: dEQP-VK.*

Components: Vulkan, Framework

VK-GL-CTS issue: 1709

Change-Id: Ibf57e036ba7475bef17d9c17e4a56f95d2d4c767
(cherry picked from commit 09183bd2b37e0d561ba4a44f5713e3b1096299b8)

64 files changed:
external/vulkancts/framework/vulkan/vkObjUtil.cpp
external/vulkancts/framework/vulkan/vkObjUtil.hpp
external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.cpp
external/vulkancts/modules/vulkan/compute/vktComputeTestsUtil.hpp
external/vulkancts/modules/vulkan/conditional_rendering/vktConditionalDispatchTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawDiscardRectanglesTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderLayerTests.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsEarlyFragmentTests.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsMakeUtil.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsMakeUtil.hpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsScissorMultiViewportTests.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsScissorTests.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryInstancedRenderingTests.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryLayeredRenderingTests.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryTestsUtil.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryTestsUtil.hpp
external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp
external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp
external/vulkancts/modules/vulkan/image/vktImageTestsUtil.cpp
external/vulkancts/modules/vulkan/image/vktImageTestsUtil.hpp
external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp
external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderUtil.cpp
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderUtil.hpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMakeUtil.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineMakeUtil.hpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilExportTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemBufferValidator.hpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemImageValidator.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemShaderImageAccessTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.hpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWorkgroupStorageTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemYCbCrConversionTests.cpp
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp
external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesBufferTests.cpp
external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesTestsUtil.cpp
external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesTestsUtil.hpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmCrossStageInterfaceTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationInternallySynchronizedObjectsTests.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationOperation.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationUtil.cpp
external/vulkancts/modules/vulkan/synchronization/vktSynchronizationUtil.hpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationCommonEdgeTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationCoordinatesTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationFractionalSpacingTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationGeometryGridRenderTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationGeometryPassthroughTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationGeometryPointSizeTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationInvarianceTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationMiscDrawTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationPrimitiveDiscardTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationShaderInputOutputTests.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationUserDefinedIO.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationUtil.cpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationUtil.hpp
external/vulkancts/modules/vulkan/tessellation/vktTessellationWindingTests.cpp
external/vulkancts/modules/vulkan/transform_feedback/vktTransformFeedbackFuzzLayoutCase.cpp
external/vulkancts/modules/vulkan/transform_feedback/vktTransformFeedbackSimpleTests.cpp
external/vulkancts/modules/vulkan/util/vktDrawUtil.cpp

index f8cadb8..ee1494f 100644 (file)
@@ -545,4 +545,81 @@ VkBufferCreateInfo makeBufferCreateInfo (const VkDeviceSize                        size,
        return bufferCreateInfo;
 }
 
+Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
+                                                                                  const VkDevice                               device,
+                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
+{
+       return makePipelineLayout(vk, device, (descriptorSetLayout == DE_NULL) ? 0u : 1u, &descriptorSetLayout);
+}
+
+Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
+                                                                                  const VkDevice                               device,
+                                                                                  const deUint32                               setLayoutCount,
+                                                                                  const VkDescriptorSetLayout* descriptorSetLayout)
+{
+       const VkPipelineLayoutCreateInfo pipelineLayoutParams =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                                      sType;
+               DE_NULL,                                                                                        // const void*                                          pNext;
+               0u,                                                                                                     // VkPipelineLayoutCreateFlags          flags;
+               setLayoutCount,                                                                         // deUint32                                                     setLayoutCount;
+               descriptorSetLayout,                                                            // const VkDescriptorSetLayout*         pSetLayouts;
+               0u,                                                                                                     // deUint32                                                     pushConstantRangeCount;
+               DE_NULL,                                                                                        // const VkPushConstantRange*           pPushConstantRanges;
+       };
+
+       return createPipelineLayout(vk, device, &pipelineLayoutParams);
+}
+
+Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
+                                                                        const VkDevice                 device,
+                                                                        const VkRenderPass             renderPass,
+                                                                        const VkImageView              colorAttachment,
+                                                                        const deUint32                 width,
+                                                                        const deUint32                 height,
+                                                                        const deUint32                 layers)
+{
+       return makeFramebuffer(vk, device, renderPass, 1u, &colorAttachment, width, height, layers);
+}
+
+Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
+                                                                        const VkDevice                 device,
+                                                                        const VkRenderPass             renderPass,
+                                                                        const deUint32                 attachmentCount,
+                                                                        const VkImageView*             colorAttachments,
+                                                                        const deUint32                 width,
+                                                                        const deUint32                 height,
+                                                                        const deUint32                 layers)
+{
+       const VkFramebufferCreateInfo framebufferInfo =
+       {
+               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,      // VkStructureType                      sType;
+               DE_NULL,                                                                        // const void*                          pNext;
+               (VkFramebufferCreateFlags)0,                            // VkFramebufferCreateFlags     flags;
+               renderPass,                                                                     // VkRenderPass                         renderPass;
+               attachmentCount,                                                        // uint32_t                                     attachmentCount;
+               colorAttachments,                                                       // const VkImageView*           pAttachments;
+               width,                                                                          // uint32_t                                     width;
+               height,                                                                         // uint32_t                                     height;
+               layers,                                                                         // uint32_t                                     layers;
+       };
+
+       return createFramebuffer(vk, device, &framebufferInfo);
+}
+
+Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk,
+                                                                        const VkDevice                 device,
+                                                                        const deUint32                 queueFamilyIndex)
+{
+       const VkCommandPoolCreateInfo commandPoolParams =
+       {
+               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,                     // VkStructureType                      sType;
+               DE_NULL,                                                                                        // const void*                          pNext;
+               VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,        // VkCommandPoolCreateFlags     flags;
+               queueFamilyIndex,                                                                       // deUint32                                     queueFamilyIndex;
+       };
+
+       return createCommandPool(vk, device, &commandPoolParams);
+}
+
 } // vk
index 2c65630..cf6d0b1 100644 (file)
@@ -105,6 +105,36 @@ Move<VkDescriptorSet> makeDescriptorSet (const DeviceInterface&                    vk,
 VkBufferCreateInfo makeBufferCreateInfo (const VkDeviceSize                    size,
                                                                                 const VkBufferUsageFlags       usage);
 
+Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
+                                                                                  const VkDevice                               device,
+                                                                                  const VkDescriptorSetLayout  descriptorSetLayout = DE_NULL);
+
+Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
+                                                                                  const VkDevice                               device,
+                                                                                  const deUint32                               setLayoutCount,
+                                                                                  const VkDescriptorSetLayout* descriptorSetLayout);
+
+Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
+                                                                        const VkDevice                 device,
+                                                                        const VkRenderPass             renderPass,
+                                                                        const VkImageView              colorAttachment,
+                                                                        const deUint32                 width,
+                                                                        const deUint32                 height,
+                                                                        const deUint32                 layers = 1u);
+
+Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
+                                                                        const VkDevice                 device,
+                                                                        const VkRenderPass             renderPass,
+                                                                        const deUint32                 attachmentCount,
+                                                                        const VkImageView*             colorAttachments,
+                                                                        const deUint32                 width,
+                                                                        const deUint32                 height,
+                                                                        const deUint32                 layers = 1u);
+
+Move<VkCommandPool> makeCommandPool (const DeviceInterface&    vk,
+                                                                        const VkDevice                 device,
+                                                                        const deUint32                 queueFamilyIndex);
+
 } // vk
 
 #endif // _VKOBJUTIL_HPP
index 49c8a4f..f23e32c 100644 (file)
@@ -69,51 +69,6 @@ VkBufferImageCopy makeBufferImageCopy (const VkExtent3D extent,
        return copyParams;
 }
 
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
-       const VkCommandPoolCreateInfo commandPoolParams =
-       {
-               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,                     // VkStructureType                      sType;
-               DE_NULL,                                                                                        // const void*                          pNext;
-               VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,        // VkCommandPoolCreateFlags     flags;
-               queueFamilyIndex,                                                                       // deUint32                                     queueFamilyIndex;
-       };
-       return createCommandPool(vk, device, &commandPoolParams);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo pipelineLayoutParams =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                                      sType;
-               DE_NULL,                                                                                        // const void*                                          pNext;
-               static_cast<VkPipelineLayoutCreateFlags>(0u),           // VkPipelineLayoutCreateFlags          flags;
-               0u,                                                                                                     // deUint32                                                     setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout*         pSetLayouts;
-               0u,                                                                                                     // deUint32                                                     pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*           pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &pipelineLayoutParams);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo pipelineLayoutParams =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                                      sType;
-               DE_NULL,                                                                                        // const void*                                          pNext;
-               static_cast<VkPipelineLayoutCreateFlags>(0u),           // VkPipelineLayoutCreateFlags          flags;
-               1u,                                                                                                     // deUint32                                                     setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout*         pSetLayouts;
-               0u,                                                                                                     // deUint32                                                     pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*           pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &pipelineLayoutParams);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&                                   vk,
                                                                          const VkDevice                                                        device,
                                                                          const VkPipelineLayout                                        pipelineLayout,
index 0bb5704..8fd58aa 100644 (file)
@@ -79,17 +79,6 @@ private:
        Image&                                                  operator=               (const Image&);
 };
 
-vk::Move<vk::VkCommandPool>                    makeCommandPool                         (const vk::DeviceInterface&                                     vk,
-                                                                                                                                const vk::VkDevice                                                     device,
-                                                                                                                                const deUint32                                                         queueFamilyIndex);
-
-vk::Move<vk::VkPipelineLayout> makePipelineLayout                              (const vk::DeviceInterface&                                     vk,
-                                                                                                                                const vk::VkDevice                                                     device);
-
-vk::Move<vk::VkPipelineLayout> makePipelineLayout                              (const vk::DeviceInterface&                                     vk,
-                                                                                                                                const vk::VkDevice                                                     device,
-                                                                                                                                const vk::VkDescriptorSetLayout                        descriptorSetLayout);
-
 vk::Move<vk::VkPipeline>               makeComputePipeline                             (const vk::DeviceInterface&                                     vk,
                                                                                                                                 const vk::VkDevice                                                     device,
                                                                                                                                 const vk::VkPipelineLayout                                     pipelineLayout,
index 53ed290..bacc1e2 100644 (file)
@@ -210,13 +210,13 @@ tcu::TestStatus ConditionalDispatchTestInstance::iterate (void)
 
        // Setup pipeline
 
-       const vk::Unique<vk::VkShaderModule>    shaderModule(createShaderModule(vk, device, m_context.getBinaryCollection().get("comp"), 0u));
-       const vk::Unique<vk::VkPipelineLayout>  pipelineLayout(compute::makePipelineLayout(vk, device, *descriptorSetLayout));
-       const vk::Unique<vk::VkPipeline>                pipeline(compute::makeComputePipeline(vk, device, *pipelineLayout, *shaderModule));
+       const vk::Unique<vk::VkShaderModule>    shaderModule            (createShaderModule(vk, device, m_context.getBinaryCollection().get("comp"), 0u));
+       const vk::Unique<vk::VkPipelineLayout>  pipelineLayout          (makePipelineLayout(vk, device, *descriptorSetLayout));
+       const vk::Unique<vk::VkPipeline>                pipeline                        (compute::makeComputePipeline(vk, device, *pipelineLayout, *shaderModule));
 
-       const vk::Unique<vk::VkCommandPool>             cmdPool(compute::makeCommandPool(vk, device, queueFamilyIndex));
-       const vk::Unique<vk::VkCommandBuffer>   cmdBuffer(vk::allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
-       const vk::Unique<vk::VkCommandBuffer>   secondaryCmdBuffer(vk::allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_SECONDARY));
+       const vk::Unique<vk::VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
+       const vk::Unique<vk::VkCommandBuffer>   cmdBuffer                       (vk::allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const vk::Unique<vk::VkCommandBuffer>   secondaryCmdBuffer      (vk::allocateCommandBuffer(vk, device, *cmdPool, vk::VK_COMMAND_BUFFER_LEVEL_SECONDARY));
 
        // Create indirect buffer
        const vk::VkDispatchIndirectCommand dispatchCommands[] = { { 1u, 1u, 1u } };
index aed04ca..749227f 100644 (file)
@@ -30,6 +30,8 @@
 #include "vkTypeUtil.hpp"
 #include "vkImageUtil.hpp"
 #include "vkMemUtil.hpp"
+#include "vkObjUtil.hpp"
+#include "vkCmdUtil.hpp"
 #include "vkQueryUtil.hpp"
 #include "vktTestGroupUtil.hpp"
 #include "vktTestCase.hpp"
@@ -92,119 +94,6 @@ inline VkDeviceSize sizeInBytes(const std::vector<T>& vec)
        return vec.size() * sizeof(vec[0]);
 }
 
-VkBufferCreateInfo makeBufferCreateInfo (const VkDeviceSize                    bufferSize,
-                                                                                const VkBufferUsageFlags       usage)
-{
-       const VkBufferCreateInfo bufferCreateInfo =
-       {
-               VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,           // VkStructureType              sType;
-               DE_NULL,                                                                        // const void*                  pNext;
-               (VkBufferCreateFlags)0,                                         // VkBufferCreateFlags  flags;
-               bufferSize,                                                                     // VkDeviceSize         size;
-               usage,                                                                          // VkBufferUsageFlags   usage;
-               VK_SHARING_MODE_EXCLUSIVE,                                      // VkSharingMode                sharingMode;
-               0u,                                                                                     // deUint32                     queueFamilyIndexCount;
-               DE_NULL,                                                                        // const deUint32*              pQueueFamilyIndices;
-       };
-       return bufferCreateInfo;
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                                      sType;
-               DE_NULL,                                                                                        // const void*                                          pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags          flags;
-               0u,                                                                                                     // deUint32                                                     setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout*         pSetLayouts;
-               0u,                                                                                                     // deUint32                                                     pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*           pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkImageView> makeImageView (const DeviceInterface&                        vk,
-                                                                const VkDevice                                 vkDevice,
-                                                                const VkImage                                  image,
-                                                                const VkImageViewType                  viewType,
-                                                                const VkFormat                                 format,
-                                                                const VkImageSubresourceRange  subresourceRange)
-{
-       const VkImageViewCreateInfo imageViewParams =
-       {
-               VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,               // VkStructureType                      sType;
-               DE_NULL,                                                                                // const void*                          pNext;
-               (VkImageViewCreateFlags)0,                                              // VkImageViewCreateFlags       flags;
-               image,                                                                                  // VkImage                                      image;
-               viewType,                                                                               // VkImageViewType                      viewType;
-               format,                                                                                 // VkFormat                                     format;
-               makeComponentMappingRGBA(),                                             // VkComponentMapping           components;
-               subresourceRange,                                                               // VkImageSubresourceRange      subresourceRange;
-       };
-       return createImageView(vk, vkDevice, &imageViewParams);
-}
-
-void beginCommandBuffer (const DeviceInterface& vk, const VkCommandBuffer commandBuffer)
-{
-       const VkCommandBufferBeginInfo info =
-       {
-               VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,    // VkStructureType                                                      sType;
-               DE_NULL,                                                                                // const void*                                                          pNext;
-               VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,    // VkCommandBufferUsageFlags                            flags;
-               DE_NULL,                                                                                // const VkCommandBufferInheritanceInfo*        pInheritanceInfo;
-       };
-       VK_CHECK(vk.beginCommandBuffer(commandBuffer, &info));
-}
-
-void submitCommandsAndWait (const DeviceInterface&     vk,
-                                                       const VkDevice                  device,
-                                                       const VkQueue                   queue,
-                                                       const VkCommandBuffer   commandBuffer)
-{
-       const Unique<VkFence> fence(createFence(vk, device));
-
-       const VkSubmitInfo submitInfo =
-       {
-               VK_STRUCTURE_TYPE_SUBMIT_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                        // const void*                                  pNext;
-               0u,                                                                     // uint32_t                                             waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*                   pWaitSemaphores;
-               DE_NULL,                                                        // const VkPipelineStageFlags*  pWaitDstStageMask;
-               1u,                                                                     // uint32_t                                             commandBufferCount;
-               &commandBuffer,                                         // const VkCommandBuffer*               pCommandBuffers;
-               0u,                                                                     // uint32_t                                             signalSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*                   pSignalSemaphores;
-       };
-       VK_CHECK(vk.queueSubmit(queue, 1u, &submitInfo, *fence));
-       VK_CHECK(vk.waitForFences(device, 1u, &fence.get(), DE_TRUE, ~0ull));
-}
-
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers = 1u)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                              sType;
-               DE_NULL,                                                                                // const void*                                  pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags             flags;
-               renderPass,                                                                             // VkRenderPass                                 renderPass;
-               attachmentCount,                                                                // uint32_t                                             attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                   pAttachments;
-               width,                                                                                  // uint32_t                                             width;
-               height,                                                                                 // uint32_t                                             height;
-               layers,                                                                                 // uint32_t                                             layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
 {
        MovePtr<Allocation> alloc = allocator.allocate(getImageMemoryRequirements(vk, device, image), requirement);
@@ -257,60 +146,6 @@ VkPipelineDiscardRectangleStateCreateInfoEXT makeDiscardRectangleStateCreateInfo
        return discardRectanglesCreateInfo;
 }
 
-//! A single-attachment, single-subpass render pass.
-Move<VkRenderPass> makeRenderPass (const DeviceInterface&      vk,
-                                                                  const VkDevice                       device,
-                                                                  const VkFormat                       colorFormat)
-{
-       const VkAttachmentDescription colorAttachmentDescription =
-       {
-               (VkAttachmentDescriptionFlags)0,                                        // VkAttachmentDescriptionFlags         flags;
-               colorFormat,                                                                            // VkFormat                                                     format;
-               VK_SAMPLE_COUNT_1_BIT,                                                          // VkSampleCountFlagBits                        samples;
-               VK_ATTACHMENT_LOAD_OP_CLEAR,                                            // VkAttachmentLoadOp                           loadOp;
-               VK_ATTACHMENT_STORE_OP_STORE,                                           // VkAttachmentStoreOp                          storeOp;
-               VK_ATTACHMENT_LOAD_OP_DONT_CARE,                                        // VkAttachmentLoadOp                           stencilLoadOp;
-               VK_ATTACHMENT_STORE_OP_DONT_CARE,                                       // VkAttachmentStoreOp                          stencilStoreOp;
-               VK_IMAGE_LAYOUT_UNDEFINED,                                                      // VkImageLayout                                        initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        finalLayout;
-       };
-
-       const VkAttachmentReference colorAttachmentRef =
-       {
-               0u,                                                                                                     // deUint32                                                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        layout;
-       };
-
-       const VkSubpassDescription subpassDescription =
-       {
-               (VkSubpassDescriptionFlags)0,                                           // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-               1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-               &colorAttachmentRef,                                                            // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-               DE_NULL,                                                                                        // 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;
-               1u,                                                                                                     // deUint32                                                     attachmentCount;
-               &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
-               1u,                                                                                                     // deUint32                                                     subpassCount;
-               &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-               0u,                                                                                                     // deUint32                                                     dependencyCount;
-               DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-       };
-
-       return createRenderPass(vk, device, &renderPassInfo);
-}
-
 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&                  vk,
                                                                           const VkDevice                                       device,
                                                                           const VkPipelineLayout                       pipelineLayout,
@@ -715,10 +550,9 @@ tcu::TestStatus DiscardRectanglesTestInstance::iterate     (void)
                m_vertexModule                          = createShaderModule    (vk, device, m_context.getBinaryCollection().get("vert"), 0u);
                m_fragmentModule                        = createShaderModule    (vk, device, m_context.getBinaryCollection().get("frag"), 0u);
                m_renderPass                            = makeRenderPass                (vk, device, colorFormat);
-               m_framebuffer                           = makeFramebuffer               (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
+               m_framebuffer                           = makeFramebuffer               (vk, device, *m_renderPass, m_colorAttachment.get(),
                                                                                                                         static_cast<deUint32>(m_renderSize.x()),
-                                                                                                                        static_cast<deUint32>(m_renderSize.y()),
-                                                                                                                        1u);
+                                                                                                                        static_cast<deUint32>(m_renderSize.y()));
                m_pipelineLayout                        = makePipelineLayout    (vk, device);
 
                generateDiscardRectangles(m_renderSize, m_params.numRectangles, m_rectangles);
index ea15401..db5e8cf 100644 (file)
@@ -77,46 +77,6 @@ inline VkDeviceSize sizeInBytes(const std::vector<T>& vec)
        return vec.size() * sizeof(vec[0]);
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers = 1u)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentCount,                                                                // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
 {
        MovePtr<Allocation> alloc = allocator.allocate(getImageMemoryRequirements(vk, device, image), requirement);
@@ -675,7 +635,7 @@ public:
                m_vertexModule          = createShaderModule    (vk, device, context.getBinaryCollection().get("vert"), 0u);
                m_fragmentModule        = createShaderModule    (vk, device, context.getBinaryCollection().get("frag"), 0u);
                m_renderPass            = makeRenderPass                (vk, device, m_colorFormat);
-               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
+               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, m_colorAttachment.get(),
                                                                                                         static_cast<deUint32>(m_renderSize.x()),
                                                                                                         static_cast<deUint32>(m_renderSize.y()),
                                                                                                         numLayers);
index c6829ca..15170f0 100644 (file)
@@ -76,46 +76,6 @@ inline VkDeviceSize sizeInBytes(const std::vector<T>& vec)
        return vec.size() * sizeof(vec[0]);
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers = 1u)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentCount,                                                                // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
 {
        MovePtr<Allocation> alloc = allocator.allocate(getImageMemoryRequirements(vk, device, image), requirement);
@@ -681,7 +641,7 @@ public:
                m_vertexModule          = createShaderModule    (vk, device, context.getBinaryCollection().get("vert"), 0u);
                m_fragmentModule        = createShaderModule    (vk, device, context.getBinaryCollection().get("frag"), 0u);
                m_renderPass            = makeRenderPass                (vk, device, m_colorFormat);
-               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
+               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, m_colorAttachment.get(),
                                                                                                         static_cast<deUint32>(m_renderSize.x()),  static_cast<deUint32>(m_renderSize.y()));
                m_pipelineLayout        = makePipelineLayout    (vk, device);
                m_pipeline                      = makeGraphicsPipeline  (vk, device, *m_pipelineLayout, *m_renderPass, *m_vertexModule, *m_tessellationControlModule,
index b5e51a3..8add6dc 100644 (file)
@@ -90,28 +90,6 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface&    vk,
        return makeRenderPass(vk, device, colorFormat, useDepthStencilAttachment ? depthStencilFormat : VK_FORMAT_UNDEFINED);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const tcu::IVec2                       size)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentCount,                                                                // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               static_cast<deUint32>(size.x()),                                // uint32_t                                    width;
-               static_cast<deUint32>(size.y()),                                // uint32_t                                    height;
-               1u,                                                                                             // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&  vk,
                                                                           const VkDevice                       device,
                                                                           const VkPipelineLayout       pipelineLayout,
@@ -432,7 +410,7 @@ tcu::TestStatus EarlyFragmentTestInstance::iterate (void)
        const Unique<VkShaderModule>    vertexModule  (createShaderModule(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
        const Unique<VkShaderModule>    fragmentModule(createShaderModule(vk, device, m_context.getBinaryCollection().get("frag"), 0u));
        const Unique<VkRenderPass>              renderPass        (makeRenderPass(vk, device, colorFormat, m_useTestAttachment, testFormat));
-       const Unique<VkFramebuffer>             framebuffer       (makeFramebuffer(vk, device, *renderPass, numUsedAttachmentImages, attachmentImages, renderSize));
+       const Unique<VkFramebuffer>             framebuffer       (makeFramebuffer(vk, device, *renderPass, numUsedAttachmentImages, attachmentImages, renderSize.x(), renderSize.y()));
        const Unique<VkPipelineLayout>  pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout));
        const Unique<VkPipeline>                pipeline          (makeGraphicsPipeline(vk, device, *pipelineLayout, *renderPass, *vertexModule, *fragmentModule, renderSize,
                                                                                                  (m_testMode == MODE_DEPTH), (m_testMode == MODE_STENCIL)));
index 39bb08a..e7a9faa 100644 (file)
@@ -35,39 +35,6 @@ namespace FragmentOperations
 using namespace vk;
 using de::MovePtr;
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&           vk,
                                                                          const VkDevice                                device,
                                                                          const VkPipelineLayout                pipelineLayout,
@@ -97,30 +64,6 @@ Move<VkPipeline> makeComputePipeline (const DeviceInterface&         vk,
        return createComputePipeline(vk, device, DE_NULL , &pipelineInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentCount,                                                                // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
 {
        MovePtr<Allocation> alloc = allocator.allocate(getImageMemoryRequirements(vk, device, image), requirement);
index bf9617a..294dda0 100644 (file)
@@ -36,10 +36,7 @@ namespace vkt
 namespace FragmentOperations
 {
 
-vk::Move<vk::VkPipelineLayout> makePipelineLayout              (const vk::DeviceInterface& vk, const vk::VkDevice device);
-vk::Move<vk::VkPipelineLayout> makePipelineLayout              (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
 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);
-vk::Move<vk::VkFramebuffer>            makeFramebuffer                 (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const deUint32 attachmentCount, const vk::VkImageView* pAttachments, const deUint32 width, const deUint32 height, const deUint32 layers = 1u);
 de::MovePtr<vk::Allocation>            bindImage                               (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkImage image, const vk::MemoryRequirement requirement);
 de::MovePtr<vk::Allocation>            bindBuffer                              (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkBuffer buffer, const vk::MemoryRequirement requirement);
 
index d9a2e4e..f872d65 100644 (file)
@@ -356,7 +356,7 @@ public:
                m_geometryModule        = createShaderModule    (vk, device, context.getBinaryCollection().get("geom"), 0u);
                m_fragmentModule        = createShaderModule    (vk, device, context.getBinaryCollection().get("frag"), 0u);
                m_renderPass            = makeRenderPass                (vk, device, m_colorFormat);
-               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
+               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, m_colorAttachment.get(),
                                                                                                         static_cast<deUint32>(m_renderSize.x()),  static_cast<deUint32>(m_renderSize.y()));
                m_pipelineLayout        = makePipelineLayout    (vk, device);
                m_pipeline                      = makeGraphicsPipeline  (vk, device, *m_pipelineLayout, *m_renderPass, *m_vertexModule, *m_geometryModule, *m_fragmentModule,
index 4160f76..6c29ae2 100644 (file)
@@ -376,7 +376,7 @@ public:
                m_vertexModule                          = createShaderModule    (vk, device, context.getBinaryCollection().get("vert"), 0u);
                m_fragmentModule                        = createShaderModule    (vk, device, context.getBinaryCollection().get("frag"), 0u);
                m_renderPass                            = makeRenderPass                (vk, device, m_colorFormat);
-               m_framebuffer                           = makeFramebuffer               (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
+               m_framebuffer                           = makeFramebuffer               (vk, device, *m_renderPass, m_colorAttachment.get(),
                                                                                                                         static_cast<deUint32>(m_renderSize.x()),  static_cast<deUint32>(m_renderSize.y()));
                m_pipelineLayout                        = makePipelineLayout    (vk, device);
                m_cmdPool                                       = createCommandPool             (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
index 040040b..24cb447 100644 (file)
@@ -170,7 +170,7 @@ void draw (Context&                                 context,
        const Unique<VkShaderModule>    fragmentModule                  (createShaderModule     (vk, device, context.getBinaryCollection().get("frag"), 0u));
 
        const Unique<VkRenderPass>              renderPass                              (vk::makeRenderPass             (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer                (vk, device, *renderPass, *colorAttachment, renderSize.x(), renderSize.y(), 1u));
+       const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer                (vk, device, *renderPass, *colorAttachment, renderSize.x(), renderSize.y()));
        const Unique<VkPipelineLayout>  pipelineLayout                  (makePipelineLayout             (vk, device));
        const Unique<VkPipeline>                pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule, renderExtent));
 
index d3326da..76dc41c 100644 (file)
@@ -358,30 +358,6 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&              vk,
                                                                        &pipelineDepthStencilStateInfo);        // const VkPipelineDepthStencilStateCreateInfo*         depthStencilStateCreateInfo
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
-                                                                        const VkDevice                 device,
-                                                                        const VkRenderPass             renderPass,
-                                                                        const VkImageView*             pAttachments,
-                                                                        const deUint32                 attachmentsCount,
-                                                                        const deUint32                 width,
-                                                                        const deUint32                 height,
-                                                                        const deUint32                 layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentsCount,                                                               // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 void copyLayeredImageToBuffer(const DeviceInterface& vk, VkCommandBuffer cmdBuffer, VkImage image, VkBuffer buffer, const ImageParams& imageParams)
 {
        // Image read barrier
@@ -1244,7 +1220,7 @@ tcu::TestStatus test (Context& context, const TestParams params)
        const Unique<VkShaderModule>    fragmentModule                  (createShaderModule             (vk, device, context.getBinaryCollection().get("frag"), 0u));
 
        const Unique<VkRenderPass>              renderPass                              (makeRenderPass                 (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer                (vk, device, *renderPass, &*colorAttachment, 1u, params.image.size.width,  params.image.size.height, numLayers));
+       const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer                (vk, device, *renderPass, *colorAttachment, params.image.size.width,  params.image.size.height, numLayers));
        const Unique<VkPipelineLayout>  pipelineLayout                  (makePipelineLayout             (vk, device));
        const Unique<VkPipeline>                pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule,
                                                                                                                                                                         makeExtent2D(params.image.size.width, params.image.size.height)));
@@ -1339,7 +1315,7 @@ tcu::TestStatus testLayeredReadBack (Context& context, const TestParams params)
        const Unique<VkShaderModule>            fragmentModule          (createShaderModule             (vk, device, context.getBinaryCollection().get("frag"), 0u));
 
        const Unique<VkRenderPass>                      renderPass                      (makeRenderPass                 (vk, device, colorFormat, dsFormat, dsUsed));
-       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                (vk, device, *renderPass, attachments, attachmentsCount, params.image.size.width, params.image.size.height, numLayers));
+       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                (vk, device, *renderPass, attachmentsCount, attachments, params.image.size.width, params.image.size.height, numLayers));
 
        const Move<VkDescriptorPool>            descriptorPool          = DescriptorPoolBuilder()
                                                                                                                          .addType(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, passCount)
@@ -1594,7 +1570,7 @@ tcu::TestStatus testSecondaryCmdBuffer (Context& context, const TestParams param
        const Unique<VkShaderModule>            fragmentModule          (createShaderModule(vk, device, context.getBinaryCollection().get("frag"), 0u));
 
        const Unique<VkRenderPass>                      renderPass                      (makeRenderPassWithSelfDependency(vk, device, colorFormat));
-       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer(vk, device, *renderPass, &*colorImageView, 1u, params.image.size.width, params.image.size.height, numLayers));
+       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorImageView, params.image.size.width, params.image.size.height, numLayers));
        const Unique<VkPipelineLayout>          pipelineLayout          (makePipelineLayout(vk, device, *descriptorSetLayout));
        const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline(vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule,
                                                                                                                                                                  makeExtent2D(params.image.size.width, params.image.size.height)));
index a74982e..2869da0 100644 (file)
@@ -426,47 +426,6 @@ VkBufferImageCopy makeBufferImageCopy (const vk::VkDeviceSize&                             bufferOffset,
        return copyParams;
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,                                                  // VkStructureType                              sType;
-               DE_NULL,                                                                                                                                // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                                                                 // VkPipelineLayoutCreateFlags  flags;
-               (descriptorSetLayout != DE_NULL ? 1u : 0u),                                                             // deUint32                                             setLayoutCount;
-               (descriptorSetLayout != DE_NULL ? &descriptorSetLayout : DE_NULL),              // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                                                             // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                                                                // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
-                                                                        const VkDevice                 device,
-                                                                        const VkRenderPass             renderPass,
-                                                                        const VkImageView              colorAttachment,
-                                                                        const deUint32                 width,
-                                                                        const deUint32                 height,
-                                                                        const deUint32                 layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               1u,                                                                                             // uint32_t                                    attachmentCount;
-               &colorAttachment,                                                               // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
-
 bool compareWithFileImage (Context& context, const tcu::ConstPixelBufferAccess& resultImage, std::string testName)
 {
        tcu::TextureLevel referenceImage;
index fccda6a..1dfa0eb 100644 (file)
@@ -170,8 +170,6 @@ std::size_t                                         calcOutputVertices                      (const vk::VkPrimitiveTopology& inputType)
 vk::VkImageCreateInfo                  makeImageCreateInfo                     (const tcu::IVec2& size, const vk::VkFormat format, const vk::VkImageUsageFlags usage, const deUint32 numArrayLayers = 1u);
 vk::VkBufferImageCopy                  makeBufferImageCopy                     (const vk::VkExtent3D extent, const vk::VkImageSubresourceLayers subresourceLayers);
 vk::VkBufferImageCopy                  makeBufferImageCopy                     (const vk::VkDeviceSize& bufferOffset, const vk::VkImageSubresourceLayers& imageSubresource, const vk::VkOffset3D& imageOffset, const vk::VkExtent3D& imageExtent);
-vk::Move<vk::VkPipelineLayout> makePipelineLayout                      (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout = DE_NULL);
-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);
 de::MovePtr<vk::Allocation>            bindImage                                       (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkImage image, const vk::MemoryRequirement requirement);
 de::MovePtr<vk::Allocation>            bindBuffer                                      (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkBuffer buffer, const vk::MemoryRequirement requirement);
 
index 42da3c0..36be1a7 100644 (file)
@@ -1722,7 +1722,7 @@ void GraphicsAttachmentsTestInstance::transcodeRead ()
 
                        const VkImageView                               attachmentBindInfos[]   = { *srcImageView, *dstImageView };
                        const VkExtent2D                                framebufferSize                 (makeExtent2D(dstImageResolution[0], dstImageResolution[1]));
-                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, DE_LENGTH_OF_ARRAY(attachmentBindInfos), attachmentBindInfos, framebufferSize, SINGLE_LAYER));
+                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, DE_LENGTH_OF_ARRAY(attachmentBindInfos), attachmentBindInfos, framebufferSize.width, framebufferSize.height, SINGLE_LAYER));
 
                        // Upload source image data
                        const Allocation& alloc = srcImageBuffer->getAllocation();
@@ -1856,7 +1856,7 @@ void GraphicsAttachmentsTestInstance::transcodeWrite ()
 
                        const VkImageView                               attachmentBindInfos[]   = { *srcImageView, *dstImageView };
                        const VkExtent2D                                framebufferSize                 (renderSize);
-                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, DE_LENGTH_OF_ARRAY(attachmentBindInfos), attachmentBindInfos, framebufferSize, SINGLE_LAYER));
+                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, DE_LENGTH_OF_ARRAY(attachmentBindInfos), attachmentBindInfos, framebufferSize.width, framebufferSize.height, SINGLE_LAYER));
 
                        // Upload source image data
                        const Allocation& alloc = srcImageBuffer->getAllocation();
@@ -2084,7 +2084,7 @@ bool GraphicsAttachmentsTestInstance::verifyDecompression (const std::vector<deU
        const VkImageMemoryBarrier                      refSrcCopyImageBarrierPost      = makeImageMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL, layoutShaderReadOnly ? VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL, refSrcImage->get(), subresourceRange);
        const VkImageMemoryBarrier                      resCompressedImageBarrier       = makeImageMemoryBarrier(0, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_GENERAL, layoutShaderReadOnly ? VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_GENERAL, resCompressedImage->get(), resSubresourceRange);
 
-       const Move<VkFramebuffer>                       framebuffer                                     (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, renderSize, getLayerCount()));
+       const Move<VkFramebuffer>                       framebuffer                                     (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, renderSize.width, renderSize.height, getLayerCount()));
 
        // Upload source image data
        {
@@ -2306,7 +2306,7 @@ void GraphicsTextureTestInstance::transcodeRead ()
                        const VkImageMemoryBarrier              dstInitImageBarrier             = makeImageMemoryBarrier(0u, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, dstImage->get(), dstSubresourceRange);
 
                        const VkExtent2D                                framebufferSize                 (makeExtent2D(dstImageResolution[0], dstImageResolution[1]));
-                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize, SINGLE_LAYER));
+                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize.width, framebufferSize.height, SINGLE_LAYER));
 
                        // Upload source image data
                        const Allocation& alloc = srcImageBuffer->getAllocation();
@@ -2446,7 +2446,7 @@ void GraphicsTextureTestInstance::transcodeWrite ()
                        const VkImageMemoryBarrier              dstInitImageBarrier             = makeImageMemoryBarrier(0u, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, dstImage->get(), dstSubresourceRange);
 
                        const VkExtent2D                                framebufferSize                 (makeExtent2D(dstImageResolution[0], dstImageResolution[1]));
-                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize, SINGLE_LAYER));
+                       const Move<VkFramebuffer>               framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize.width, framebufferSize.height, SINGLE_LAYER));
 
                        // Upload source image data
                        const Allocation& alloc = srcImageBuffer->getAllocation();
index c40b219..c240f44 100644 (file)
@@ -590,23 +590,6 @@ Move<VkSampler> makeSampler (const DeviceInterface& vk, const VkDevice device)
        return createSampler(vk, device, &samplerParams);
 }
 
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&      vk,
-                                                                                  const VkDevice                       device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
-               DE_NULL,
-               (VkPipelineLayoutCreateFlags)0,
-               0u,
-               DE_NULL,
-               0u,
-               DE_NULL,
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&          vk,
                                                                           const VkDevice                               device,
                                                                           const VkPipelineLayout               pipelineLayout,
@@ -766,29 +749,6 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface&  vk,
        return createRenderPass(vk, device, &renderPassInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
-                                                                        const VkDevice                 device,
-                                                                        const VkRenderPass             renderPass,
-                                                                        const deUint32                 attachmentCount,
-                                                                        const VkImageView*             pAttachments,
-                                                                        const IVec2                    size)
-{
-       const VkFramebufferCreateInfo framebufferInfo =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
-               DE_NULL,
-               (VkFramebufferCreateFlags)0,
-               renderPass,
-               attachmentCount,
-               pAttachments,
-               static_cast<deUint32>(size.x()),
-               static_cast<deUint32>(size.y()),
-               1u,
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 Move<VkCommandBuffer> makeCommandBuffer        (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
 {
        return allocateCommandBuffer(vk, device, commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
@@ -1392,7 +1352,11 @@ void UploadDownloadExecutor::uploadDraw(Context& context)
        }
 
        // Create framebuffer
-       m_uDraw.framebuffer     = makeFramebuffer(m_vk, m_device, *m_uDraw.renderPass, static_cast<deUint32>(m_uDraw.attachmentHandles.size()), &m_uDraw.attachmentHandles[0], m_caseDef.size.swizzle(0, 1));
+       {
+               const IVec2 size = m_caseDef.size.swizzle(0, 1);
+
+               m_uDraw.framebuffer = makeFramebuffer(m_vk, m_device, *m_uDraw.renderPass, static_cast<deUint32>(m_uDraw.attachmentHandles.size()), &m_uDraw.attachmentHandles[0], static_cast<deUint32>(size.x()), static_cast<deUint32>(size.y()));
+       }
 
        // Create command buffer
        {
index 8bdc111..10b48e0 100644 (file)
@@ -207,23 +207,6 @@ VkBufferImageCopy makeBufferImageCopy (const VkExtent3D extent,
        return copyParams;
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo pipelineLayoutParams =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                                      sType;
-               DE_NULL,                                                                                        // const void*                                          pNext;
-               0u,                                                                                                     // VkPipelineLayoutCreateFlags          flags;
-               1u,                                                                                                     // deUint32                                                     setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout*         pSetLayouts;
-               0u,                                                                                                     // deUint32                                                     pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*           pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &pipelineLayoutParams);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&   vk,
                                                                          const VkDevice                        device,
                                                                          const VkPipelineLayout        pipelineLayout,
@@ -1001,29 +984,5 @@ void beginRenderPass (const DeviceInterface&      vk,
        beginRenderPass(vk, commandBuffer, renderPass, framebuffer, renderArea, tcu::Vec4(0.0f), 0.0f, 0u);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
-                                                                        const VkDevice                 device,
-                                                                        const VkRenderPass             renderPass,
-                                                                        const deUint32                 attachmentCount,
-                                                                        const VkImageView*             pAttachments,
-                                                                        const VkExtent2D&              size,
-                                                                        const deUint32                 layersCount)
-{
-       const vk::VkFramebufferCreateInfo framebufferInfo =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                      sType;
-               DE_NULL,                                                                                // const void*                          pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags     flags;
-               renderPass,                                                                             // VkRenderPass                         renderPass;
-               attachmentCount,                                                                // uint32_t                                     attachmentCount;
-               pAttachments,                                                                   // const VkImageView*           pAttachments;
-               static_cast<deUint32>(size.width),                              // uint32_t                                     width;
-               static_cast<deUint32>(size.height),                             // uint32_t                                     height;
-               layersCount,                                                                    // uint32_t                                     layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 } // image
 } // vkt
index ebd331f..f753982 100644 (file)
@@ -114,10 +114,6 @@ deUint32                           getNumPixels            (const ImageType imageType, const tcu::UVec3& imageSiz
 deUint32                               getDimensions           (const ImageType imageType);                                                            //!< Coordinate dimension used for addressing (e.g. 3 (x,y,z) for 2d array)
 deUint32                               getLayerDimensions      (const ImageType imageType);                                                            //!< Coordinate dimension used for addressing a single layer (e.g. 2 (x,y) for 2d array)
 
-vk::Move<vk::VkPipelineLayout>         makePipelineLayout                              (const vk::DeviceInterface&                                     vk,
-                                                                                                                                        const vk::VkDevice                                                     device,
-                                                                                                                                        const vk::VkDescriptorSetLayout                        descriptorSetLayout);
-
 vk::Move<vk::VkPipeline>                       makeComputePipeline                             (const vk::DeviceInterface&                                     vk,
                                                                                                                                         const vk::VkDevice                                                     device,
                                                                                                                                         const vk::VkPipelineLayout                                     pipelineLayout,
@@ -168,14 +164,6 @@ void beginRenderPass (const vk::DeviceInterface&   vk,
                                          const vk::VkFramebuffer               framebuffer,
                                          const vk::VkExtent2D&                 renderSize);
 
-vk::Move<vk::VkFramebuffer> makeFramebuffer (const vk::DeviceInterface&        vk,
-                                                                                        const vk::VkDevice                     device,
-                                                                                        const vk::VkRenderPass         renderPass,
-                                                                                        const deUint32                         attachmentCount,
-                                                                                        const vk::VkImageView*         pAttachments,
-                                                                                        const vk::VkExtent2D&          size,
-                                                                                        const deUint32                         layersCount);
-
 } // image
 } // vkt
 
index 7c07c66..01165c3 100644 (file)
@@ -386,7 +386,7 @@ void GraphicsAttachmentsTestInstance::transcode (std::vector<deUint8>& srcData,
        const VkBufferImageCopy                                 dstCopyRegion                   = makeBufferImageCopy(m_parameters.size[0], m_parameters.size[1]);
 
        const VkImageView                                               attachmentBindInfos[]   = { *srcImageView, *dstImageView };
-       const Move<VkFramebuffer>                               framebuffer                             (makeFramebuffer(vk, device, *renderPass, DE_LENGTH_OF_ARRAY(attachmentBindInfos), attachmentBindInfos, renderSize, SINGLE_LAYER));
+       const Move<VkFramebuffer>                               framebuffer                             (makeFramebuffer(vk, device, *renderPass, DE_LENGTH_OF_ARRAY(attachmentBindInfos), attachmentBindInfos, renderSize.width, renderSize.height, SINGLE_LAYER));
 
        DE_ASSERT(srcImageSizeInBytes == dstImageSizeInBytes);
 
@@ -643,7 +643,7 @@ void GraphicsTextureTestInstance::transcode (std::vector<deUint8>& srcData, std:
        const VkBufferImageCopy                                 dstCopyRegion                   = makeBufferImageCopy(m_parameters.size[0], m_parameters.size[1]);
 
        const VkExtent2D                                                framebufferSize                 (makeExtent2D(m_parameters.size[0], m_parameters.size[1]));
-       const Move<VkFramebuffer>                               framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize, SINGLE_LAYER));
+       const Move<VkFramebuffer>                               framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0, DE_NULL, framebufferSize.width, framebufferSize.height, SINGLE_LAYER));
 
        DE_ASSERT(srcImageSizeInBytes == dstImageSizeInBytes);
 
index edeaef0..6207c6e 100644 (file)
@@ -155,25 +155,6 @@ std::vector<VkAttachmentDescription2KHR> convertAttachmentDescriptions (const st
        return attachmentDescriptions2;
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const deUint32                               setLayoutCount  = 0,
-                                                                                  const VkDescriptorSetLayout* pSetLayouts             = DE_NULL)
-{
-       const VkPipelineLayoutCreateInfo        pipelineLayoutCreateInfo        =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,  //  VkStructureType                                     sType;
-               DE_NULL,                                                                                //  const void*                                         pNext;
-               (VkPipelineLayoutCreateFlags)0,                                 //  VkPipelineLayoutCreateFlags         flags;
-               setLayoutCount,                                                                 //  deUint32                                            setLayoutCount;
-               pSetLayouts,                                                                    //  const VkDescriptorSetLayout*        pSetLayouts;
-               0u,                                                                                             //  deUint32                                            pushConstantRangeCount;
-               DE_NULL,                                                                                //  const VkPushConstantRange*          pPushConstantRanges;
-       };
-
-       return createPipelineLayout(vk, device, &pipelineLayoutCreateInfo);
-}
-
 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&          vk,
                                                                           const VkDevice                               device,
                                                                           const VkPipelineLayout               pipelineLayout,
index eb336b9..71e03fa 100644 (file)
@@ -351,9 +351,7 @@ tcu::TestStatus MultiViewRenderTestInstance::iterate (void)
        // FrameBuffer & renderPass
        Unique<VkRenderPass>                                            renderPass                                      (makeRenderPass (*m_device, *m_logicalDevice, m_parameters.colorFormat, m_parameters.viewMasks, m_parameters.renderPassType));
 
-       vector<VkImageView>                                                     attachments;
-       attachments.push_back(m_colorAttachment->getImageView());
-       Unique<VkFramebuffer>                                           frameBuffer                                     (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, attachments, m_parameters.extent.width, m_parameters.extent.height, 1u));
+       Unique<VkFramebuffer>                                           frameBuffer                                     (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, m_colorAttachment->getImageView(), m_parameters.extent.width, m_parameters.extent.height));
 
        // pipelineLayout
        Unique<VkPipelineLayout>                                        pipelineLayout                          (makePipelineLayout(*m_device, *m_logicalDevice));
@@ -1492,11 +1490,11 @@ tcu::TestStatus MultiViewAttachmentsTestInstance::iterate (void)
        vector<VkImageView>                                                     attachments;
        attachments.push_back(m_colorAttachment->getImageView());
        attachments.push_back(m_inputAttachment->getImageView());
-       Unique<VkFramebuffer>                                           frameBuffer                             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, attachments, m_parameters.extent.width, m_parameters.extent.height, 1u));
+       Unique<VkFramebuffer>                                           frameBuffer                             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, static_cast<deUint32>(attachments.size()), attachments.data(), m_parameters.extent.width, m_parameters.extent.height));
 
        // pipelineLayout
        m_descriptorSetLayout   = makeDescriptorSetLayout(*m_device, *m_logicalDevice);
-       m_pipelineLayout                = makePipelineLayout(*m_device, *m_logicalDevice, &m_descriptorSetLayout.get());
+       m_pipelineLayout                = makePipelineLayout(*m_device, *m_logicalDevice, m_descriptorSetLayout.get());
 
        // pipelines
        map<VkShaderStageFlagBits, ShaderModuleSP>      shaderModule;
@@ -2289,9 +2287,7 @@ tcu::TestStatus MultiViewMultsampleTestInstance::iterate (void)
        // FrameBuffer & renderPass
        Unique<VkRenderPass>                                            renderPass                                      (makeRenderPass (*m_device, *m_logicalDevice, m_parameters.colorFormat, m_parameters.viewMasks, m_parameters.renderPassType, VK_SAMPLE_COUNT_4_BIT));
 
-       vector<VkImageView>                                                     attachments;
-       attachments.push_back(m_colorAttachment->getImageView());
-       Unique<VkFramebuffer>                                           frameBuffer                                     (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, attachments, m_parameters.extent.width, m_parameters.extent.height, 1u));
+       Unique<VkFramebuffer>                                           frameBuffer                                     (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, m_colorAttachment->getImageView(), m_parameters.extent.width, m_parameters.extent.height));
 
        // pipelineLayout
        Unique<VkPipelineLayout>                                        pipelineLayout                          (makePipelineLayout(*m_device, *m_logicalDevice));
@@ -2482,8 +2478,7 @@ tcu::TestStatus MultiViewQueriesTestInstance::iterate (void)
 {
        const deUint32                                                          subpassCount                    = static_cast<deUint32>(m_parameters.viewMasks.size());
        Unique<VkRenderPass>                                            renderPass                              (makeRenderPass (*m_device, *m_logicalDevice, m_parameters.colorFormat, m_parameters.viewMasks, m_parameters.renderPassType));
-       vector<VkImageView>                                                     attachments                             (1u, m_colorAttachment->getImageView());
-       Unique<VkFramebuffer>                                           frameBuffer                             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, attachments, m_parameters.extent.width, m_parameters.extent.height, 1u));
+       Unique<VkFramebuffer>                                           frameBuffer                             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, m_colorAttachment->getImageView(), m_parameters.extent.width, m_parameters.extent.height));
        Unique<VkPipelineLayout>                                        pipelineLayout                  (makePipelineLayout(*m_device, *m_logicalDevice));
        vector<PipelineSp>                                                      pipelines                               (subpassCount);
        deUint64                                                                        occlusionValue                  = 0;
@@ -2793,8 +2788,7 @@ tcu::TestStatus MultiViewReadbackTestInstance::iterate (void)
                                                                                                                                          (m_parameters.viewIndex == TEST_TYPE_READBACK_WITH_EXPLICIT_CLEAR) ? VK_ATTACHMENT_LOAD_OP_DONT_CARE :
                                                                                                                                          VK_ATTACHMENT_LOAD_OP_LAST;
                Unique<VkRenderPass>                                            renderPass              (makeRenderPass (*m_device, *m_logicalDevice, m_parameters.colorFormat, m_parameters.viewMasks, m_parameters.renderPassType, VK_SAMPLE_COUNT_1_BIT, loadOp));
-               vector<VkImageView>                                                     attachments             (1u, m_colorAttachment->getImageView());
-               Unique<VkFramebuffer>                                           frameBuffer             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, attachments, m_parameters.extent.width, m_parameters.extent.height, 1u));
+               Unique<VkFramebuffer>                                           frameBuffer             (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, m_colorAttachment->getImageView(), m_parameters.extent.width, m_parameters.extent.height));
                Unique<VkPipelineLayout>                                        pipelineLayout  (makePipelineLayout(*m_device, *m_logicalDevice));
                vector<PipelineSp>                                                      pipelines               (subpassCount);
                map<VkShaderStageFlagBits, ShaderModuleSP>      shaderModule;
@@ -3087,7 +3081,7 @@ tcu::TestStatus MultiViewDepthStencilTestInstance::iterate (void)
        const deUint32                                                          subpassCount                            = static_cast<deUint32>(m_parameters.viewMasks.size());
        Unique<VkRenderPass>                                            renderPass                                      (makeRenderPassWithDepth (*m_device, *m_logicalDevice, m_parameters.colorFormat, m_parameters.viewMasks, m_dsFormat, m_parameters.renderPassType));
        vector<VkImageView>                                                     attachments                                     (makeAttachmentsVector());
-       Unique<VkFramebuffer>                                           frameBuffer                                     (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, attachments, m_parameters.extent.width, m_parameters.extent.height, 1u));
+       Unique<VkFramebuffer>                                           frameBuffer                                     (makeFramebuffer(*m_device, *m_logicalDevice, *renderPass, static_cast<deUint32>(attachments.size()), attachments.data(), m_parameters.extent.width, m_parameters.extent.height, 1u));
        Unique<VkPipelineLayout>                                        pipelineLayout                          (makePipelineLayout(*m_device, *m_logicalDevice));
        map<VkShaderStageFlagBits, ShaderModuleSP>      shaderModule;
        vector<PipelineSp>                                                      pipelines(subpassCount);
index 3e3636a..797da55 100644 (file)
@@ -132,46 +132,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkImageType imageType, const VkExte
        return imageInfo;
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const vector<VkImageView>&     attachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                      sType;
-               DE_NULL,                                                                                // const void*                          pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags     flags;
-               renderPass,                                                                             // VkRenderPass                         renderPass;
-               static_cast<deUint32>(attachments.size()),              // uint32_t                                     attachmentCount;
-               &attachments[0],                                                                // const VkImageView*           pAttachments;
-               width,                                                                                  // uint32_t                                     width;
-               height,                                                                                 // uint32_t                                     height;
-               layers,                                                                                 // uint32_t                                     layers;
-       };
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout* pSetLayouts)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,  // VkStructureType                              sType;
-               DE_NULL,                                                                                // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                 // VkPipelineLayoutCreateFlags  flags;
-               (DE_NULL == pSetLayouts)? 0u : 1u,                              // deUint32                                             setLayoutCount;
-               pSetLayouts,                                                                    // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                             // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 Move<VkDescriptorSetLayout> makeDescriptorSetLayout (const DeviceInterface&            vk,
                                                                                                        const VkDevice                          device)
 {
index 251f39c..fe1588a 100644 (file)
@@ -37,8 +37,6 @@ vk::VkImageAspectFlags                                getAspectFlags                                  (tcu::TextureFormat format);
 vk::VkFormat                                           getStencilBufferFormat                  (const vk::VkFormat depthStencilImageFormat);
 vk::VkFormat                                           getDepthBufferFormat                    (const vk::VkFormat depthStencilImageFormat);
 vk::VkImageCreateInfo                          makeImageCreateInfo                             (const vk::VkImageType imageType, const vk::VkExtent3D& extent, const vk::VkFormat format, const vk::VkImageUsageFlags usage, const vk::VkSampleCountFlagBits samples);
-vk::Move<vk::VkFramebuffer>                    makeFramebuffer                                 (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const std::vector<vk::VkImageView>& attachments, const deUint32 width, const deUint32 height, const deUint32 layers);
-vk::Move<vk::VkPipelineLayout>         makePipelineLayout                              (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout* pSetLayouts = DE_NULL);
 vk::Move<vk::VkDescriptorSetLayout>    makeDescriptorSetLayout                 (const vk::DeviceInterface& vk, const vk::VkDevice device);
 
 template<typename AttachmentDesc, typename AttachmentRef, typename SubpassDesc, typename SubpassDep, typename RenderPassCreateInfo>
index 9c9a23e..a224c6d 100644 (file)
@@ -60,39 +60,6 @@ Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevi
        return allocateCommandBuffer(vk, device, commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&           vk,
                                                                          const VkDevice                                device,
                                                                          const VkPipelineLayout                pipelineLayout,
@@ -121,29 +88,6 @@ Move<VkPipeline> makeComputePipeline (const DeviceInterface&                vk,
        };
        return createComputePipeline(vk, device, DE_NULL , &pipelineInfo);
 }
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentCount,                                                                // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
 
 MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
 {
index d65f703..09feead 100644 (file)
@@ -77,10 +77,7 @@ private:
 };
 
 vk::Move<vk::VkCommandBuffer>  makeCommandBuffer               (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
-vk::Move<vk::VkPipelineLayout> makePipelineLayout              (const vk::DeviceInterface& vk, const vk::VkDevice device);
-vk::Move<vk::VkPipelineLayout> makePipelineLayout              (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
 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);
-vk::Move<vk::VkFramebuffer>            makeFramebuffer                 (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const deUint32 attachmentCount, const vk::VkImageView* pAttachments, const deUint32 width, const deUint32 height, const deUint32 layers = 1u);
 de::MovePtr<vk::Allocation>            bindImage                               (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkImage image, const vk::MemoryRequirement requirement);
 de::MovePtr<vk::Allocation>            bindBuffer                              (const vk::DeviceInterface& vk, const vk::VkDevice device, vk::Allocator& allocator, const vk::VkBuffer buffer, const vk::MemoryRequirement requirement);
 de::MovePtr<vk::Allocation>            bindImageDedicated              (const vk::InstanceInterface& vki, const vk::DeviceInterface& vkd, const vk::VkPhysicalDevice physDevice, const vk::VkDevice device, const vk::VkImage image, const vk::MemoryRequirement requirement);
index df62bda..2997ec9 100644 (file)
@@ -624,7 +624,7 @@ tcu::TestStatus GraphicsTestInstance::iterate (void)
        // Pipeline
 
        const Unique<VkRenderPass>     renderPass    (makeRenderPass    (vk, device, imageFormat));
-       const Unique<VkFramebuffer>    framebuffer   (makeFramebuffer   (vk, device, *renderPass, 1u, &colorImageView.get(), static_cast<deUint32>(renderSize.x()), static_cast<deUint32>(renderSize.y())));
+       const Unique<VkFramebuffer>    framebuffer   (makeFramebuffer   (vk, device, *renderPass, colorImageView.get(), static_cast<deUint32>(renderSize.x()), static_cast<deUint32>(renderSize.y())));
        const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout(vk, device, *descriptorSetLayout));
        const Unique<VkCommandPool>    cmdPool       (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
        const Unique<VkCommandBuffer>  cmdBuffer     (makeCommandBuffer (vk, device, *cmdPool));
index 6fa4bc9..930b2d7 100644 (file)
@@ -435,29 +435,6 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&              vk,
        return createGraphicsPipeline(vk, device, DE_NULL, &graphicsPipelineInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               attachmentCount,                                                                // uint32_t                                    attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               1u,                                                                                             // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 tcu::TextureLevel generateReferenceImage (const tcu::TextureFormat     format,
                                                                                  const UVec2&                          renderSize,
                                                                                  const deUint32                        patternSize,
index 8a7414d..e3eaf4a 100644 (file)
@@ -34,6 +34,7 @@
 #include "vkPrograms.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 #include "vktTestCase.hpp"
 #include "vktTestGroupUtil.hpp"
 #include "tcuStringTemplate.hpp"
index 38dafa9..aa4dc56 100644 (file)
@@ -34,6 +34,7 @@
 #include "vktTestCase.hpp"
 #include "vktTestGroupUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "vktProtectedMemUtils.hpp"
 #include "vktProtectedMemContext.hpp"
index 4288cc4..78eb12a 100644 (file)
@@ -513,39 +513,6 @@ vk::VkResult queueSubmit (ProtectedContext&                context,
        return vk.waitForFences(device, 1u, &fence, DE_TRUE, timeout);
 }
 
-vk::Move<vk::VkDescriptorSet> makeDescriptorSet (const vk::DeviceInterface&                    vk,
-                                                                                                const vk::VkDevice                                     device,
-                                                                                                const vk::VkDescriptorPool                     descriptorPool,
-                                                                                                const vk::VkDescriptorSetLayout        setLayout)
-{
-       const vk::VkDescriptorSetAllocateInfo allocateParams =
-       {
-               vk::VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,     // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               descriptorPool,                                                                         // VkDescriptorPool                             descriptorPool;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &setLayout,                                                                                     // const VkDescriptorSetLayout* pSetLayouts;
-       };
-       return vk::allocateDescriptorSet(vk, device, &allocateParams);
-}
-
-vk::Move<vk::VkPipelineLayout> makePipelineLayout (const vk::DeviceInterface&          vk,
-                                                                                                  const vk::VkDevice                           device,
-                                                                                                  const vk::VkDescriptorSetLayout      descriptorSetLayout)
-{
-       const vk::VkPipelineLayoutCreateInfo info =
-       {
-               vk::VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,      // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (vk::VkPipelineLayoutCreateFlags)0,                                     // VkPipelineLayoutCreateFlags  flags;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return vk::createPipelineLayout(vk, device, &info);
-}
-
 vk::Move<vk::VkPipeline> makeComputePipeline (const vk::DeviceInterface&               vk,
                                                                                          const vk::VkDevice                            device,
                                                                                          const vk::VkPipelineLayout            pipelineLayout,
index 10039ce..9f41e15 100644 (file)
@@ -122,14 +122,6 @@ vk::VkResult                                               queueSubmit                                                     (ProtectedContext&                                      context,
                                                                                                                                                 vk::VkFence                                            fence,
                                                                                                                                                 deUint64                                                       timeout);
 
-vk::Move<vk::VkDescriptorSet>          makeDescriptorSet                                       (const vk::DeviceInterface&                     vk,
-                                                                                                                                                const vk::VkDevice                                     device,
-                                                                                                                                                const vk::VkDescriptorPool                     descriptorPool,
-                                                                                                                                                const vk::VkDescriptorSetLayout        setLayout);
-vk::Move<vk::VkPipelineLayout>         makePipelineLayout                                      (const vk::DeviceInterface&                     vk,
-                                                                                                                                                const vk::VkDevice                                     device,
-                                                                                                                                                const vk::VkDescriptorSetLayout        descriptorSetLayout);
-
 vk::Move<vk::VkPipeline>                       makeComputePipeline                                     (const vk::DeviceInterface&                     vk,
                                                                                                                                                 const vk::VkDevice                                     device,
                                                                                                                                                 const vk::VkPipelineLayout                     pipelineLayout,
index c0547e6..f5d4bbe 100644 (file)
@@ -34,6 +34,7 @@
 #include "vkTypeUtil.hpp"
 #include "vkYCbCrImageWithMemory.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "vktProtectedMemContext.hpp"
 #include "vktProtectedMemUtils.hpp"
index d2be3d7..3fb6221 100644 (file)
@@ -32,6 +32,7 @@
 #include "vkPrograms.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "deMath.h"
 
@@ -159,21 +160,6 @@ Move<VkQueryPool> makeQueryPool (const DeviceInterface& vk, const VkDevice devic
        return createQueryPool(vk, device, &queryPoolCreateInfo);
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface& vk, const VkDevice device, const VkDescriptorSetLayout* descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo pipelineLayoutParams =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,  // VkStructureType                                      sType;
-               DE_NULL,                                                                                // const void*                                          pNext;
-               0u,                                                                                             // VkPipelineLayoutCreateFlags          flags;
-               1u,                                                                                             // deUint32                                                     setLayoutCount;
-               descriptorSetLayout,                                                    // const VkDescriptorSetLayout*         pSetLayouts;
-               0u,                                                                                             // deUint32                                                     pushConstantRangeCount;
-               DE_NULL,                                                                                // const VkPushConstantRange*           pPushConstantRanges;
-       };
-       return (createPipelineLayout(vk, device, &pipelineLayoutParams));
-}
-
 void clearBuffer (const DeviceInterface& vk, const VkDevice device, const de::SharedPtr<Buffer> buffer, const VkDeviceSize bufferSizeBytes)
 {
        const std::vector<deUint8>      data                    ((size_t)bufferSizeBytes, 0u);
@@ -285,7 +271,7 @@ tcu::TestStatus     ComputeInvocationsTestInstance::iterate (void)
                        .addSingleBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT)
                        .build(vk, device));
 
-       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout(vk, device, &(*descriptorSetLayout)));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout(vk, device, *descriptorSetLayout));
 
        const Unique<VkDescriptorPool>          descriptorPool                  (DescriptorPoolBuilder()
                        .addType(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)
index 2a3bcb0..8ac3bfe 100755 (executable)
@@ -526,7 +526,7 @@ public:
                };
 
                m_renderPass            = makeRenderPass                (vk, device, m_colorFormat);
-               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, 1u, &m_colorAttachment.get(),
+               m_framebuffer           = makeFramebuffer               (vk, device, *m_renderPass, m_colorAttachment.get(),
                                                                                                         static_cast<deUint32>(m_renderSize.x()), static_cast<deUint32>(m_renderSize.y()));
                m_pipelineLayout        = makePipelineLayout    (vk, device, m_descriptorSetLayout);
                m_pipeline                      = makeGraphicsPipeline  (vk, device, *m_pipelineLayout, *m_renderPass, m_renderSize, m_topology, DE_LENGTH_OF_ARRAY(pShaderStages), pShaderStages);
index 53c1e06..c1218a3 100644 (file)
@@ -233,35 +233,6 @@ VkBufferImageCopy makeBufferImageCopy (const VkExtent3D            extent,
        return copyParams;
 }
 
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
-       const VkCommandPoolCreateInfo commandPoolParams =
-       {
-               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,                     // VkStructureType                      sType;
-               DE_NULL,                                                                                        // const void*                          pNext;
-               VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,        // VkCommandPoolCreateFlags     flags;
-               queueFamilyIndex,                                                                       // deUint32                                     queueFamilyIndex;
-       };
-       return createCommandPool(vk, device, &commandPoolParams);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo pipelineLayoutParams =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,                                          // VkStructureType                                      sType;
-               DE_NULL,                                                                                                                        // const void*                                          pNext;
-               0u,                                                                                                                                     // VkPipelineLayoutCreateFlags          flags;
-               (descriptorSetLayout != DE_NULL ? 1u : 0u),                                                     // deUint32                                                     setLayoutCount;
-               (descriptorSetLayout != DE_NULL ? &descriptorSetLayout : DE_NULL),      // const VkDescriptorSetLayout*         pSetLayouts;
-               0u,                                                                                                                                     // deUint32                                                     pushConstantRangeCount;
-               DE_NULL,                                                                                                                        // const VkPushConstantRange*           pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &pipelineLayoutParams);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&           vk,
                                                                          const VkDevice                                device,
                                                                          const VkPipelineLayout                pipelineLayout,
@@ -291,31 +262,6 @@ Move<VkPipeline> makeComputePipeline (const DeviceInterface&               vk,
        return createComputePipeline(vk, device, DE_NULL , &pipelineCreateInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const deUint32                         attachmentCount,
-                                                                        const VkImageView*                     pAttachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                               sType;
-               DE_NULL,                                                                                // const void*                                   pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags             flags;
-               renderPass,                                                                             // VkRenderPass                                 renderPass;
-               attachmentCount,                                                                // uint32_t                                             attachmentCount;
-               pAttachments,                                                                   // const VkImageView*                     pAttachments;
-               width,                                                                                  // uint32_t                                             width;
-               height,                                                                                 // uint32_t                                             height;
-               layers,                                                                                 // uint32_t                                             layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 de::MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
 {
        de::MovePtr<Allocation> alloc = allocator.allocate(getImageMemoryRequirements(vk, device, image), requirement);
index bffef7d..8ee2965 100644 (file)
@@ -133,29 +133,12 @@ deUint32                                          getImageSizeInBytes                                     (const vk::VkExtent3D&                          baseExtents,
                                                                                                                                         const deUint32                                         mipmapLevelsCount               = 1u,
                                                                                                                                         const deUint32                                         mipmapMemoryAlignment   = 1u);
 
-vk::Move<vk::VkCommandPool>            makeCommandPool                                         (const vk::DeviceInterface&                     vk,
-                                                                                                                                        const vk::VkDevice                                     device,
-                                                                                                                                        const deUint32                                         queueFamilyIndex);
-
-vk::Move<vk::VkPipelineLayout> makePipelineLayout                                      (const vk::DeviceInterface&                     vk,
-                                                                                                                                        const vk::VkDevice                                     device,
-                                                                                                                                        const vk::VkDescriptorSetLayout        descriptorSetLayout = DE_NULL);
-
 vk::Move<vk::VkPipeline>               makeComputePipeline                                     (const vk::DeviceInterface&                     vk,
                                                                                                                                         const vk::VkDevice                                     device,
                                                                                                                                         const vk::VkPipelineLayout                     pipelineLayout,
                                                                                                                                         const vk::VkShaderModule                       shaderModule,
                                                                                                                                         const vk::VkSpecializationInfo*        specializationInfo      = 0);
 
-vk::Move<vk::VkFramebuffer>            makeFramebuffer                                         (const vk::DeviceInterface&                     vk,
-                                                                                                                                        const vk::VkDevice                                     device,
-                                                                                                                                        const vk::VkRenderPass                         renderPass,
-                                                                                                                                        const deUint32                                         attachmentCount,
-                                                                                                                                        const vk::VkImageView*                         pAttachments,
-                                                                                                                                        const deUint32                                         width,
-                                                                                                                                        const deUint32                                         height,
-                                                                                                                                        const deUint32                                         layers = 1u);
-
 de::MovePtr<vk::Allocation>            bindImage                                                       (const vk::DeviceInterface&                     vk,
                                                                                                                                         const vk::VkDevice                                     device,
                                                                                                                                         vk::Allocator&                                         allocator,
index fd95500..438646f 100644 (file)
@@ -105,44 +105,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkImageType imageType, const VkExte
        return imageInfo;
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const VkImageView                      attachments,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height)
-{
-       const VkFramebufferCreateInfo framebufferInfo =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                      sType;
-               DE_NULL,                                                                                // const void*                          pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags     flags;
-               renderPass,                                                                             // VkRenderPass                         renderPass;
-               1u,                                                                                             // uint32_t                                     attachmentCount;
-               &attachments,                                                                   // const VkImageView*           pAttachments;
-               width,                                                                                  // uint32_t                                     width;
-               height,                                                                                 // uint32_t                                     height;
-               1u,                                                                                             // uint32_t                                     layers;
-       };
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       VkPipelineLayoutCreateInfo                              pipelineLayoutParams    =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,                  //      VkStructureType                                 sType;
-               DE_NULL,                                                                                                //      const void*                                             pNext;
-               (VkPipelineLayoutCreateFlags)0,
-               0u,                                                                                                             //      deUint32                                                descriptorSetCount;
-               DE_NULL,                                                                                                //      const VkDescriptorSetLayout*    pSetLayouts;
-               0u,                                                                                                             //      deUint32                                                pushConstantRangeCount;
-               DE_NULL,                                                                                                //      const VkPushConstantRange*              pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &pipelineLayoutParams);
-}
-
 void imageBarrier (const DeviceInterface&                      vk,
                                   const VkCommandBuffer                        cmdBuffer,
                                   const VkImage                                        image,
index 5e88aa8..bb398b5 100644 (file)
@@ -150,22 +150,6 @@ deUint32 getElementSizeInBytes(
                return bytes;
 }
 
-Move<VkPipelineLayout> makePipelineLayout(
-       Context& context, const VkDescriptorSetLayout descriptorSetLayout)
-{
-       const vk::VkPipelineLayoutCreateInfo pipelineLayoutParams = {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // VkStructureType sType;
-               DE_NULL,                          // const void*            pNext;
-               0u,                                       // VkPipelineLayoutCreateFlags    flags;
-               1u,                                       // deUint32             setLayoutCount;
-               &descriptorSetLayout, // const VkDescriptorSetLayout*   pSetLayouts;
-               0u,                                       // deUint32             pushConstantRangeCount;
-               DE_NULL, // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(context.getDeviceInterface(),
-                                                               context.getDevice(), &pipelineLayoutParams);
-}
-
 Move<VkRenderPass> makeRenderPass(Context& context, VkFormat format)
 {
        VkAttachmentReference colorReference = {
@@ -208,19 +192,6 @@ Move<VkRenderPass> makeRenderPass(Context& context, VkFormat format)
                                                        &renderPassCreateInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer(Context& context,
-                                                                       const VkRenderPass renderPass, const VkImageView imageView, deUint32 width,
-                                                                       deUint32 height)
-{
-       const VkFramebufferCreateInfo framebufferCreateInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, DE_NULL, 0u, renderPass, 1,
-               &imageView, width, height, 1
-       };
-
-       return createFramebuffer(context.getDeviceInterface(), context.getDevice(),
-                                                        &framebufferCreateInfo);
-}
-
 Move<VkPipeline> makeGraphicsPipeline(Context&                                                                 context,
                                                                          const VkPipelineLayout                                        pipelineLayout,
                                                                          const VkShaderStageFlags                                      stages,
@@ -341,21 +312,6 @@ Move<VkPipeline> makeComputePipeline(Context& context,
                                                                 context.getDevice(), DE_NULL, &pipelineCreateInfo);
 }
 
-Move<VkCommandPool> makeCommandPool(Context& context)
-{
-       const VkCommandPoolCreateInfo commandPoolParams =
-       {
-               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // VkStructureType sType;
-               DE_NULL,                                                                        // const void*        pNext;
-               VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // VkCommandPoolCreateFlags
-               // flags;
-               context.getUniversalQueueFamilyIndex(), // deUint32 queueFamilyIndex;
-       };
-
-       return createCommandPool(
-                          context.getDeviceInterface(), context.getDevice(), &commandPoolParams);
-}
-
 Move<VkCommandBuffer> makeCommandBuffer(
        Context& context, const VkCommandPool commandPool)
 {
@@ -485,8 +441,9 @@ struct Image : public BufferOrImage
                                   VkFormat format, VkImageUsageFlags usage = VK_IMAGE_USAGE_STORAGE_BIT)
                : BufferOrImage(true)
        {
-               const DeviceInterface&                  vkd                                     = context.getDeviceInterface();
+               const DeviceInterface&                  vk                                      = context.getDeviceInterface();
                const VkDevice                                  device                          = context.getDevice();
+               const deUint32                                  queueFamilyIndex        = context.getUniversalQueueFamilyIndex();
 
                const VkImageCreateInfo                 imageCreateInfo         =
                {
@@ -534,14 +491,14 @@ struct Image : public BufferOrImage
                        VK_FALSE,
                };
 
-               m_image                 = createImage(vkd, device, &imageCreateInfo);
+               m_image                 = createImage(vk, device, &imageCreateInfo);
 
-               VkMemoryRequirements                    req                                     = getImageMemoryRequirements(vkd, device, *m_image);
+               VkMemoryRequirements                    req                                     = getImageMemoryRequirements(vk, device, *m_image);
 
                req.size                *= 2;
                m_allocation    = context.getDefaultAllocator().allocate(req, MemoryRequirement::Any);
 
-               VK_CHECK(vkd.bindImageMemory(device, *m_image, m_allocation->getMemory(), m_allocation->getOffset()));
+               VK_CHECK(vk.bindImageMemory(device, *m_image, m_allocation->getMemory(), m_allocation->getOffset()));
 
                const VkImageViewCreateInfo             imageViewCreateInfo     =
                {
@@ -550,24 +507,24 @@ struct Image : public BufferOrImage
                        subresourceRange
                };
 
-               m_imageView             = createImageView(vkd, device, &imageViewCreateInfo);
-               m_sampler               = createSampler(vkd, device, &samplerCreateInfo);
+               m_imageView             = createImageView(vk, device, &imageViewCreateInfo);
+               m_sampler               = createSampler(vk, device, &samplerCreateInfo);
 
                // Transition input image layouts
                {
-                       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(context));
-                       const Unique<VkCommandBuffer>   cmdBuffer                       (makeCommandBuffer(context, *cmdPool));
+                       const Unique<VkCommandPool>             cmdPool                 (makeCommandPool(vk, device, queueFamilyIndex));
+                       const Unique<VkCommandBuffer>   cmdBuffer               (makeCommandBuffer(context, *cmdPool));
 
-                       beginCommandBuffer(vkd, *cmdBuffer);
+                       beginCommandBuffer(vk, *cmdBuffer);
 
-                       const VkImageMemoryBarrier              imageBarrier            = makeImageMemoryBarrier((VkAccessFlags)0u, VK_ACCESS_TRANSFER_WRITE_BIT,
+                       const VkImageMemoryBarrier              imageBarrier    = makeImageMemoryBarrier((VkAccessFlags)0u, VK_ACCESS_TRANSFER_WRITE_BIT,
                                                                                                                                        VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, *m_image, subresourceRange);
 
-                       vkd.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
+                       vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
                                (VkDependencyFlags)0, 0u, (const VkMemoryBarrier*)DE_NULL, 0u, (const VkBufferMemoryBarrier*)DE_NULL, 1u, &imageBarrier);
 
-                       endCommandBuffer(vkd, *cmdBuffer);
-                       submitCommandsAndWait(vkd, device, context.getUniversalQueue(), *cmdBuffer);
+                       endCommandBuffer(vk, *cmdBuffer);
+                       submitCommandsAndWait(vk, device, context.getUniversalQueue(), *cmdBuffer);
                }
        }
 
@@ -1931,7 +1888,7 @@ tcu::TestStatus vkt::subgroups::makeTessellationEvaluationFrameBufferTest (
 
        const Unique<VkDescriptorSetLayout>             descriptorSetLayout             (layoutBuilder.build(vk, device));
 
-       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout(context, *descriptorSetLayout));
+       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout(vk, device, *descriptorSetLayout));
 
        const Unique<VkPipeline>                                pipeline                                (makeGraphicsPipeline(context, *pipelineLayout,
                                                                                                                                        VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT |
@@ -1976,7 +1933,8 @@ tcu::TestStatus vkt::subgroups::makeTessellationEvaluationFrameBufferTest (
        updateBuilder.update(vk, device);
 
        const VkQueue                                                   queue                                   = context.getUniversalQueue();
-       const Unique<VkCommandPool>                             cmdPool                                 (makeCommandPool(context));
+       const deUint32                                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
+       const Unique<VkCommandPool>                             cmdPool                                 (makeCommandPool(vk, device, queueFamilyIndex));
        const deUint32                                                  subgroupSize                    = getSubgroupSize(context);
        const Unique<VkCommandBuffer>                   cmdBuffer                               (makeCommandBuffer(context, *cmdPool));
        const vk::VkDeviceSize                                  vertexBufferSize                = 2ull * maxWidth * sizeof(tcu::Vec4);
@@ -2002,7 +1960,7 @@ tcu::TestStatus vkt::subgroups::makeTessellationEvaluationFrameBufferTest (
                flushAlloc(vk, device, alloc);
        }
 
-       const Unique<VkFramebuffer>     framebuffer                     (makeFramebuffer(context, *renderPass, discardableImage.getImageView(), maxWidth, 1));
+       const Unique<VkFramebuffer>     framebuffer                     (makeFramebuffer(vk, device, *renderPass, discardableImage.getImageView(), maxWidth, 1u));
        const VkViewport                        viewport                        = makeViewport(maxWidth, 1u);
        const VkRect2D                          scissor                         = makeRect2D(maxWidth, 1u);
        const vk::VkDeviceSize          imageResultSize         = tcu::getPixelSize(vk::mapVkFormat(format)) * maxWidth;
@@ -2144,7 +2102,7 @@ tcu::TestStatus vkt::subgroups::makeGeometryFrameBufferTest(
 
        const Unique<VkDescriptorSetLayout>             descriptorSetLayout             (layoutBuilder.build(vk, device));
 
-       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout(context, *descriptorSetLayout));
+       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout(vk, device, *descriptorSetLayout));
 
        const Unique<VkPipeline>                                pipeline                                (makeGraphicsPipeline(context, *pipelineLayout,
                                                                                                                                        VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT | VK_SHADER_STAGE_GEOMETRY_BIT,
@@ -2188,7 +2146,8 @@ tcu::TestStatus vkt::subgroups::makeGeometryFrameBufferTest(
        updateBuilder.update(vk, device);
 
        const VkQueue                                                   queue                                   = context.getUniversalQueue();
-       const Unique<VkCommandPool>                             cmdPool                                 (makeCommandPool(context));
+       const deUint32                                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
+       const Unique<VkCommandPool>                             cmdPool                                 (makeCommandPool(vk, device, queueFamilyIndex));
        const deUint32                                                  subgroupSize                    = getSubgroupSize(context);
        const Unique<VkCommandBuffer>                   cmdBuffer                               (makeCommandBuffer(context, *cmdPool));
        const vk::VkDeviceSize                                  vertexBufferSize                = maxWidth * sizeof(tcu::Vec4);
@@ -2213,7 +2172,7 @@ tcu::TestStatus vkt::subgroups::makeGeometryFrameBufferTest(
                flushAlloc(vk, device, alloc);
        }
 
-       const Unique<VkFramebuffer>     framebuffer                     (makeFramebuffer(context, *renderPass, discardableImage.getImageView(), maxWidth, 1));
+       const Unique<VkFramebuffer>     framebuffer                     (makeFramebuffer(vk, device, *renderPass, discardableImage.getImageView(), maxWidth, 1u));
        const VkViewport                        viewport                        = makeViewport(maxWidth, 1u);
        const VkRect2D                          scissor                         = makeRect2D(maxWidth, 1u);
        const vk::VkDeviceSize          imageResultSize         = tcu::getPixelSize(vk::mapVkFormat(format)) * maxWidth;
@@ -2393,7 +2352,7 @@ tcu::TestStatus vkt::subgroups::allStages(
        const Unique<VkDescriptorSetLayout> descriptorSetLayout(layoutBuilder.build(vk, device));
 
        const Unique<VkPipelineLayout> pipelineLayout(
-               makePipelineLayout(context, *descriptorSetLayout));
+               makePipelineLayout(vk, device, *descriptorSetLayout));
 
        const Unique<VkRenderPass> renderPass(makeRenderPass(context, format));
        const Unique<VkPipeline> pipeline(makeGraphicsPipeline(context, *pipelineLayout,
@@ -2454,13 +2413,14 @@ tcu::TestStatus vkt::subgroups::allStages(
 
        {
                const VkQueue                                   queue                                   = context.getUniversalQueue();
-               const Unique<VkCommandPool>             cmdPool                                 (makeCommandPool(context));
+               const deUint32                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
+               const Unique<VkCommandPool>             cmdPool                                 (makeCommandPool(vk, device, queueFamilyIndex));
                const deUint32                                  subgroupSize                    = getSubgroupSize(context);
                const Unique<VkCommandBuffer>   cmdBuffer                               (makeCommandBuffer(context, *cmdPool));
                unsigned                                                totalIterations                 = 0u;
                unsigned                                                failedIterations                = 0u;
                Image                                                   resultImage                             (context, maxWidth, 1, format, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
-               const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer(context, *renderPass, resultImage.getImageView(), maxWidth, 1));
+               const Unique<VkFramebuffer>             framebuffer                             (makeFramebuffer(vk, device, *renderPass, resultImage.getImageView(), maxWidth, 1u));
                const VkViewport                                viewport                                = makeViewport(maxWidth, 1u);
                const VkRect2D                                  scissor                                 = makeRect2D(maxWidth, 1u);
                const vk::VkDeviceSize                  imageResultSize                 = tcu::getPixelSize(vk::mapVkFormat(format)) * maxWidth;
@@ -2591,6 +2551,7 @@ tcu::TestStatus vkt::subgroups::makeVertexFrameBufferTest(Context& context, vk::
        const VkDevice                                                  device                                  = context.getDevice();
        const VkQueue                                                   queue                                   = context.getUniversalQueue();
        const deUint32                                                  maxWidth                                = getMaxWidth();
+       const deUint32                                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
        vector<de::SharedPtr<BufferOrImage> >   inputBuffers                    (extraDataCount);
        DescriptorSetLayoutBuilder                              layoutBuilder;
        const Unique<VkShaderModule>                    vertexShaderModule              (createShaderModule(vk, device, context.getBinaryCollection().get("vert"), 0u));
@@ -2632,7 +2593,7 @@ tcu::TestStatus vkt::subgroups::makeVertexFrameBufferTest(Context& context, vk::
 
        const Unique<VkDescriptorSetLayout>             descriptorSetLayout             (layoutBuilder.build(vk, device));
 
-       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout(context, *descriptorSetLayout));
+       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout(vk, device, *descriptorSetLayout));
 
        const Unique<VkPipeline>                                pipeline                                (makeGraphicsPipeline(context, *pipelineLayout,
                                                                                                                                                VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT,
@@ -2687,7 +2648,7 @@ tcu::TestStatus vkt::subgroups::makeVertexFrameBufferTest(Context& context, vk::
        }
        updateBuilder.update(vk, device);
 
-       const Unique<VkCommandPool>                             cmdPool                                 (makeCommandPool(context));
+       const Unique<VkCommandPool>                             cmdPool                                 (makeCommandPool(vk, device, queueFamilyIndex));
 
        const deUint32                                                  subgroupSize                    = getSubgroupSize(context);
 
@@ -2717,7 +2678,7 @@ tcu::TestStatus vkt::subgroups::makeVertexFrameBufferTest(Context& context, vk::
                flushAlloc(vk, device, alloc);
        }
 
-       const Unique<VkFramebuffer>     framebuffer                     (makeFramebuffer(context, *renderPass, discardableImage.getImageView(), maxWidth, 1));
+       const Unique<VkFramebuffer>     framebuffer                     (makeFramebuffer(vk, device, *renderPass, discardableImage.getImageView(), maxWidth, 1u));
        const VkViewport                        viewport                        = makeViewport(maxWidth, 1u);
        const VkRect2D                          scissor                         = makeRect2D(maxWidth, 1u);
        const vk::VkDeviceSize          imageResultSize         = tcu::getPixelSize(vk::mapVkFormat(format)) * maxWidth;
@@ -2794,6 +2755,7 @@ tcu::TestStatus vkt::subgroups::makeFragmentFrameBufferTest       (Context& context, V
        const DeviceInterface&                                  vk                                              = context.getDeviceInterface();
        const VkDevice                                                  device                                  = context.getDevice();
        const VkQueue                                                   queue                                   = context.getUniversalQueue();
+       const deUint32                                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
        const Unique<VkShaderModule>                    vertexShaderModule              (createShaderModule
                                                                                                                                                (vk, device, context.getBinaryCollection().get("vert"), 0u));
        const Unique<VkShaderModule>                    fragmentShaderModule    (createShaderModule
@@ -2831,7 +2793,7 @@ tcu::TestStatus vkt::subgroups::makeFragmentFrameBufferTest       (Context& context, V
                layoutBuilder.build(vk, device));
 
        const Unique<VkPipelineLayout> pipelineLayout(
-               makePipelineLayout(context, *descriptorSetLayout));
+               makePipelineLayout(vk, device, *descriptorSetLayout));
 
        const Unique<VkRenderPass> renderPass(makeRenderPass(context, format));
        const Unique<VkPipeline> pipeline(makeGraphicsPipeline(context, *pipelineLayout,
@@ -2888,7 +2850,7 @@ tcu::TestStatus vkt::subgroups::makeFragmentFrameBufferTest       (Context& context, V
        if (extraDatasCount > 0)
                updateBuilder.update(vk, device);
 
-       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(context));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
 
        const deUint32                                  subgroupSize            = getSubgroupSize(context);
 
@@ -2921,8 +2883,7 @@ tcu::TestStatus vkt::subgroups::makeFragmentFrameBufferTest       (Context& context, V
                        Buffer resultBuffer(context, resultImageSizeInBytes,
                                                                VK_IMAGE_USAGE_TRANSFER_DST_BIT);
 
-                       const Unique<VkFramebuffer> framebuffer(makeFramebuffer(context,
-                                                                                                       *renderPass, resultImage.getImageView(), width, height));
+                       const Unique<VkFramebuffer> framebuffer(makeFramebuffer(vk, device, *renderPass, resultImage.getImageView(), width, height));
 
                        beginCommandBuffer(vk, *cmdBuffer);
 
@@ -2996,6 +2957,7 @@ tcu::TestStatus vkt::subgroups::makeComputeTest(
        const DeviceInterface&                                  vk                                              = context.getDeviceInterface();
        const VkDevice                                                  device                                  = context.getDevice();
        const VkQueue                                                   queue                                   = context.getUniversalQueue();
+       const deUint32                                                  queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
        VkDeviceSize                                                    elementSize                             = getFormatSizeInBytes(format);
 
        const VkDeviceSize resultBufferSize = maxSupportedSubgroupSize() *
@@ -3043,7 +3005,7 @@ tcu::TestStatus vkt::subgroups::makeComputeTest(
                createShaderModule(vk, device,
                                                   context.getBinaryCollection().get("comp"), 0u));
        const Unique<VkPipelineLayout> pipelineLayout(
-               makePipelineLayout(context, *descriptorSetLayout));
+               makePipelineLayout(vk, device, *descriptorSetLayout));
 
        DescriptorPoolBuilder poolBuilder;
 
@@ -3098,7 +3060,7 @@ tcu::TestStatus vkt::subgroups::makeComputeTest(
 
        updateBuilder.update(vk, device);
 
-       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(context));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
 
        unsigned totalIterations = 0;
        unsigned failedIterations = 0;
index 6dea788..23fb228 100644 (file)
@@ -371,7 +371,7 @@ TestStatus executeGraphicPipeline (const Context& context, const VkPipeline& pip
                                                                                                                                                makeImageCreateInfo(VK_IMAGE_TYPE_2D, colorImageExtent, colorFormat, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT),
                                                                                                                                                MemoryRequirement::Any));
                Move<VkImageView>                               colorAttachmentView                     = makeImageView(vk, device, **colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange);
-               Move<VkFramebuffer>                             framebuffer                                     = makeFramebuffer(vk, device, renderPass, *colorAttachmentView, colorImageExtent.width, colorImageExtent.height, 1u);
+               Move<VkFramebuffer>                             framebuffer                                     = makeFramebuffer(vk, device, renderPass, *colorAttachmentView, colorImageExtent.width, colorImageExtent.height);
                const Unique<VkCommandPool>             cmdPool                                         (createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
                const Unique<VkCommandBuffer>   cmdBuffer                                       (makeCommandBuffer(vk, device, *cmdPool));
                const VkDescriptorBufferInfo    outputBufferDescriptorInfo      = makeDescriptorBufferInfo(*resultBuffer, 0ull, BUFFER_SIZE);
index 031596b..6935604 100644 (file)
@@ -1002,7 +1002,7 @@ public:
 
                m_colorAttachmentView   = makeImageView         (vk, device, **m_colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, m_colorFormat, m_colorImageSubresourceRange);
                m_renderPass                    = makeRenderPass        (vk, device, m_colorFormat);
-               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_colorImageExtent.width, m_colorImageExtent.height, 1u);
+               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_colorImageExtent.width, m_colorImageExtent.height);
                m_pipelineLayout                = makePipelineLayout(vk, device, descriptorSetLayout);
 
                GraphicsPipelineBuilder pipelineBuilder;
@@ -2316,10 +2316,10 @@ public:
 
                // Pipeline
 
-               m_colorAttachmentView   = makeImageView                                           (vk, device, m_colorImage, VK_IMAGE_VIEW_TYPE_2D, m_colorFormat, m_colorSubresourceRange);
-               m_renderPass                    = makeRenderPass                                          (vk, device, m_colorFormat);
-               m_framebuffer                   = makeFramebuffer                                         (vk, device, *m_renderPass, *m_colorAttachmentView, m_attachmentExtent.width, m_attachmentExtent.height, 1u);
-               m_pipelineLayout                = makePipelineLayoutWithoutDescriptors(vk, device);
+               m_colorAttachmentView   = makeImageView         (vk, device, m_colorImage, VK_IMAGE_VIEW_TYPE_2D, m_colorFormat, m_colorSubresourceRange);
+               m_renderPass                    = makeRenderPass        (vk, device, m_colorFormat);
+               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_attachmentExtent.width, m_attachmentExtent.height);
+               m_pipelineLayout                = makePipelineLayout(vk, device);
 
                GraphicsPipelineBuilder pipelineBuilder;
                pipelineBuilder
@@ -2552,7 +2552,7 @@ public:
                        break;
                }
 
-               m_frameBuffer   = makeFramebuffer(vk, device, *m_renderPass, *m_attachmentView, m_resource.getImage().extent.width, m_resource.getImage().extent.height, 1u);
+               m_frameBuffer   = makeFramebuffer(vk, device, *m_renderPass, *m_attachmentView, m_resource.getImage().extent.width, m_resource.getImage().extent.height);
        }
 
        void recordCommands (const VkCommandBuffer cmdBuffer)
@@ -2698,7 +2698,7 @@ public:
 
                m_colorAttachmentView   = makeImageView         (vk, device, **m_colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, m_colorFormat, m_colorImageSubresourceRange);
                m_renderPass                    = makeRenderPass        (vk, device, m_colorFormat);
-               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_colorImageExtent.width, m_colorImageExtent.height, 1u);
+               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_colorImageExtent.width, m_colorImageExtent.height);
                m_pipelineLayout                = makePipelineLayout(vk, device, descriptorSetLayout);
 
                GraphicsPipelineBuilder pipelineBuilder;
@@ -3162,7 +3162,7 @@ public:
                // Pipeline
                m_colorAttachmentView   = makeImageView         (vk, device, **m_colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, m_colorFormat, m_colorImageSubresourceRange);
                m_renderPass                    = makeRenderPass        (vk, device, m_colorFormat);
-               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_colorImageExtent.width, m_colorImageExtent.height, 1u);
+               m_framebuffer                   = makeFramebuffer       (vk, device, *m_renderPass, *m_colorAttachmentView, m_colorImageExtent.width, m_colorImageExtent.height);
                m_pipelineLayout                = makePipelineLayout(vk, device, *m_descriptorSetLayout);
 
                m_pipeline = GraphicsPipelineBuilder()
index f577d05..b51a316 100644 (file)
@@ -45,39 +45,6 @@ Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevi
        return allocateCommandBuffer(vk, device, &info);
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkPipelineLayout> makePipelineLayoutWithoutDescriptors (const DeviceInterface&            vk,
-                                                                                                                        const VkDevice                         device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&           vk,
                                                                          const VkDevice                                device,
                                                                          const VkPipelineLayout                pipelineLayout,
@@ -165,29 +132,6 @@ void beginRenderPassWithRasterizationDisabled (const DeviceInterface&      vk,
        beginRenderPass(vk, commandBuffer, renderPass, framebuffer, renderArea);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const VkImageView                      colorAttachment,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               1u,                                                                                             // uint32_t                                    attachmentCount;
-               &colorAttachment,                                                               // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 GraphicsPipelineBuilder& GraphicsPipelineBuilder::setShader (const DeviceInterface&                    vk,
                                                                                                                         const VkDevice                                 device,
                                                                                                                         const VkShaderStageFlagBits    stage,
index e0816cd..e6d6086 100644 (file)
@@ -225,10 +225,7 @@ struct ImageResource
 
 vk::VkImageCreateInfo                  makeImageCreateInfo                                                     (const vk::VkImageType imageType, const vk::VkExtent3D& extent, const vk::VkFormat format, const vk::VkImageUsageFlags usage);
 vk::Move<vk::VkCommandBuffer>  makeCommandBuffer                                                       (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkCommandPool commandPool);
-vk::Move<vk::VkPipelineLayout> makePipelineLayout                                                      (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
-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::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::VkBufferImageCopy                  makeBufferImageCopy                                                     (const vk::VkImageSubresourceLayers subresourceLayers, const vk::VkExtent3D extent);
 void                                                   beginRenderPassWithRasterizationDisabled        (const vk::DeviceInterface& vk, const vk::VkCommandBuffer commandBuffer, const vk::VkRenderPass renderPass, const vk::VkFramebuffer framebuffer);
 void                                                   requireFeatures                                                         (const vk::InstanceInterface& vki, const vk::VkPhysicalDevice physDevice, const FeatureFlags flags);
index c8e5723..372127e 100644 (file)
@@ -364,12 +364,12 @@ tcu::TestStatus test (Context& context, const CaseDefinition caseDef)
 
        // Pipeline
 
-       const Unique<VkImageView>          colorAttachmentView  (makeImageView                                           (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
-       const Unique<VkRenderPass>         renderPass                   (makeRenderPass                                          (vk, device, colorFormat));
-       const Unique<VkFramebuffer>        framebuffer                  (makeFramebuffer                                         (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
-       const Unique<VkCommandPool>        cmdPool                              (makeCommandPool                                         (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>  cmdBuffer                        (allocateCommandBuffer                           (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
-       const Unique<VkPipelineLayout> pipelineLayout           (makePipelineLayoutWithoutDescriptors(vk, device));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView                  (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                 (vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer                (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool                (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout             (vk, device));
 
        const int inPatchSize = (caseDef.primitiveType == TESSPRIMITIVETYPE_TRIANGLES ? 3 : 4);
        const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
index 65dbdcc..1c6e5e7 100644 (file)
@@ -531,7 +531,7 @@ tcu::TestStatus TessCoordTestInstance::iterate (void)
        // Pipeline: set up vertex processing without rasterization
 
        const Unique<VkRenderPass>              renderPass              (makeRenderPassWithoutAttachments (vk, device));
-       const Unique<VkFramebuffer>             framebuffer             (makeFramebufferWithoutAttachments(vk, device, *renderPass));
+       const Unique<VkFramebuffer>             framebuffer             (makeFramebuffer(vk, device, *renderPass, 0u, DE_NULL, 1u, 1u));
        const Unique<VkPipelineLayout>  pipelineLayout  (makePipelineLayout(vk, device, *descriptorSetLayout));
        const Unique<VkCommandPool>             cmdPool                 (makeCommandPool(vk, device, queueFamilyIndex));
        const Unique<VkCommandBuffer>   cmdBuffer               (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
index 4c6b9cb..62d30b2 100644 (file)
@@ -558,11 +558,11 @@ tcu::TestStatus test (Context& context, TestParams testParams)
 
        // Pipeline
 
-       const Unique<VkRenderPass>              renderPass        (makeRenderPassWithoutAttachments     (vk, device));
-       const Unique<VkFramebuffer>             framebuffer       (makeFramebufferWithoutAttachments(vk, device, *renderPass));
-       const Unique<VkPipelineLayout>  pipelineLayout(makePipelineLayout                               (vk, device, *descriptorSetLayout));
-       const Unique<VkCommandPool>             cmdPool           (makeCommandPool                                      (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>   cmdBuffer         (allocateCommandBuffer                        (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkRenderPass>              renderPass              (makeRenderPassWithoutAttachments       (vk, device));
+       const Unique<VkFramebuffer>             framebuffer             (makeFramebuffer                                        (vk, device, *renderPass, 0u, DE_NULL, 1u, 1u));
+       const Unique<VkPipelineLayout>  pipelineLayout  (makePipelineLayout                                     (vk, device, *descriptorSetLayout));
+       const Unique<VkCommandPool>             cmdPool                 (makeCommandPool                                        (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer               (allocateCommandBuffer                          (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
                .setShader(vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                      context.getBinaryCollection().get("vert"), DE_NULL)
index c0e8c50..2c38280 100644 (file)
@@ -554,12 +554,12 @@ tcu::TestStatus GridRenderTestInstance::iterate (void)
 
        // Pipeline: no vertex input attributes nor descriptors.
 
-       const Unique<VkImageView>               colorAttachmentView(makeImageView                                               (vk, device, *colorAttachmentImage, colorAttachmentViewType, colorFormat, colorImageAllLayersRange));
-       const Unique<VkRenderPass>              renderPass                 (makeRenderPass                                              (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                (makeFramebuffer                                             (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), m_params.numLayers));
-       const Unique<VkPipelineLayout>  pipelineLayout     (makePipelineLayoutWithoutDescriptors(vk, device));
-       const Unique<VkCommandPool>             cmdPool                    (makeCommandPool                                             (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>   cmdBuffer                  (allocateCommandBuffer                               (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView                  (vk, device, *colorAttachmentImage, colorAttachmentViewType, colorFormat, colorImageAllLayersRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                 (vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer                (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), m_params.numLayers));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout             (vk, device));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool                (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const Unique<VkPipeline> pipeline (GraphicsPipelineBuilder()
                .setRenderSize  (renderSize)
index 888eb2a..b005e6d 100644 (file)
@@ -491,12 +491,12 @@ tcu::TestStatus PassthroughTestInstance::iterate (void)
 
        // Pipeline
 
-       const Unique<VkImageView>               colorAttachmentView(makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
-       const Unique<VkRenderPass>              renderPass                 (makeRenderPass(vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
-       const Unique<VkPipelineLayout>  pipelineLayout     (makePipelineLayout(vk, device, *descriptorSetLayout));
-       const Unique<VkCommandPool>             cmdPool                    (makeCommandPool(vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>   cmdBuffer                  (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass(vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout(vk, device, *descriptorSetLayout));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        // Message explaining the test
        {
index 169562c..5df3ed1 100644 (file)
@@ -329,12 +329,12 @@ tcu::TestStatus test (Context& context, const Flags flags)
 
        // Pipeline
 
-       const Unique<VkImageView>               colorAttachmentView(makeImageView                                               (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
-       const Unique<VkRenderPass>              renderPass                 (makeRenderPass                                              (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                (makeFramebuffer                                             (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
-       const Unique<VkPipelineLayout>  pipelineLayout     (makePipelineLayoutWithoutDescriptors(vk, device));
-       const Unique<VkCommandPool>             cmdPool                    (makeCommandPool                                             (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>   cmdBuffer                  (allocateCommandBuffer                               (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView                  (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                 (vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer                (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout             (vk, device));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool                (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        GraphicsPipelineBuilder                 pipelineBuilder;
 
index 2a5ae56..01cb0ff 100644 (file)
@@ -234,12 +234,12 @@ class VecLexLessThan : public LexCompare<tcu::Vector<float, Size>, Size, std::le
 //! Creates multiple shader programs for combinations of winding and point mode.
 //! mirrorCoords - special mode where some tessellation coordinates are mirrored in tessellation evaluation shader.
 //!                This is used by symmetric outer edge test.
-void addDefaultPrograms (vk::SourceCollections&  programCollection,
-                                                const TessPrimitiveType primitiveType,
-                                                const SpacingMode       spacingMode,
-                                                const WindingUsage      windingUsage,
-                                                const PointModeUsage    pointModeUsage,
-                                                const bool                              mirrorCoords = false)
+void addDefaultPrograms (vk::SourceCollections&                programCollection,
+                                                const TessPrimitiveType        primitiveType,
+                                                const SpacingMode                      spacingMode,
+                                                const WindingUsage                     windingUsage,
+                                                const PointModeUsage           pointModeUsage,
+                                                const bool                                     mirrorCoords = false)
 {
        // Vertex shader
        {
@@ -607,11 +607,11 @@ BaseTestInstance::BaseTestInstance (Context& context, const CaseDefinition caseD
                                                                                        .addType(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)
                                                                                        .build(m_context.getDeviceInterface(), m_context.getDevice(), VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u))
        , m_descriptorSet                                               (makeDescriptorSet(m_context.getDeviceInterface(), m_context.getDevice(), *m_descriptorPool, *m_descriptorSetLayout))
-       , m_renderPass                                                  (makeRenderPassWithoutAttachments (m_context.getDeviceInterface(), m_context.getDevice()))
-       , m_framebuffer                                                 (makeFramebufferWithoutAttachments(m_context.getDeviceInterface(), m_context.getDevice(), *m_renderPass))
-       , m_pipelineLayout                                              (makePipelineLayout               (m_context.getDeviceInterface(), m_context.getDevice(), *m_descriptorSetLayout))
-       , m_cmdPool                                                             (makeCommandPool                  (m_context.getDeviceInterface(), m_context.getDevice(), m_context.getUniversalQueueFamilyIndex()))
-       , m_cmdBuffer                                                   (allocateCommandBuffer            (m_context.getDeviceInterface(), m_context.getDevice(), *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY))
+       , m_renderPass                                                  (makeRenderPassWithoutAttachments       (m_context.getDeviceInterface(), m_context.getDevice()))
+       , m_framebuffer                                                 (makeFramebuffer                                        (m_context.getDeviceInterface(), m_context.getDevice(), *m_renderPass, 0u, DE_NULL, 1u, 1u))
+       , m_pipelineLayout                                              (makePipelineLayout                                     (m_context.getDeviceInterface(), m_context.getDevice(), *m_descriptorSetLayout))
+       , m_cmdPool                                                             (makeCommandPool                                        (m_context.getDeviceInterface(), m_context.getDevice(), m_context.getUniversalQueueFamilyIndex()))
+       , m_cmdBuffer                                                   (allocateCommandBuffer                          (m_context.getDeviceInterface(), m_context.getDevice(), *m_cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY))
 {
        requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(),
                                        FEATURE_TESSELLATION_SHADER | FEATURE_GEOMETRY_SHADER | FEATURE_VERTEX_PIPELINE_STORES_AND_ATOMICS);
@@ -732,8 +732,8 @@ tcu::TestStatus OuterEdgeDivisionTestInstance::iterate (void)
        for (int outerEdgeIndex = 0; outerEdgeIndex < static_cast<int>(m_edgeDescriptions.size()); ++outerEdgeIndex)
        for (int outerEdgeLevelCaseNdx = 0; outerEdgeLevelCaseNdx < DE_LENGTH_OF_ARRAY(m_singleOuterEdgeLevels); ++outerEdgeLevelCaseNdx)
        {
-               const OuterEdgeDescription& edgeDesc        = m_edgeDescriptions[outerEdgeIndex];
-               const std::vector<float>    patchTessLevels = generatePatchTessLevels(m_numPatchesToDraw, outerEdgeIndex, m_singleOuterEdgeLevels[outerEdgeLevelCaseNdx]);
+               const OuterEdgeDescription&     edgeDesc                = m_edgeDescriptions[outerEdgeIndex];
+               const std::vector<float>        patchTessLevels = generatePatchTessLevels(m_numPatchesToDraw, outerEdgeIndex, m_singleOuterEdgeLevels[outerEdgeLevelCaseNdx]);
 
                Vec3Set firstOuterEdgeVertices; // Vertices of the outer edge of the first patch of the first program's draw call; used for comparison with other patches.
 
@@ -743,9 +743,9 @@ tcu::TestStatus OuterEdgeDivisionTestInstance::iterate (void)
                for (int windingNdx = 0; windingNdx < WINDING_LAST; ++windingNdx)
                for (int usePointModeNdx = 0; usePointModeNdx <= 1; ++usePointModeNdx)
                {
-                       const Winding winding        = static_cast<Winding>(windingNdx);
-                       const bool        usePointMode   = (usePointModeNdx != 0);
-                       const bool    isFirstProgram = (windingNdx == 0 && usePointModeNdx == 0);
+                       const Winding   winding                         = static_cast<Winding>(windingNdx);
+                       const bool              usePointMode            = (usePointModeNdx != 0);
+                       const bool              isFirstProgram          = (windingNdx == 0 && usePointModeNdx == 0);
 
                        const DrawResult result = draw(static_cast<deUint32>(patchTessLevels.size()), patchTessLevels, winding, usePointMode);
 
@@ -1360,17 +1360,17 @@ tcu::TestStatus InvarianceTestInstance::iterate (void)
 
        // Vertex input attributes buffer: to pass tessellation levels
 
-       const VkFormat     vertexFormat        = VK_FORMAT_R32_SFLOAT;
-       const deUint32     vertexStride        = tcu::getPixelSize(mapVkFormat(vertexFormat));
-       const VkDeviceSize vertexDataSizeBytes = NUM_TESS_LEVELS * numPatchesPerDrawCall * vertexStride;
-       const Buffer       vertexBuffer        (vk, device, allocator, makeBufferCreateInfo(vertexDataSizeBytes, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), MemoryRequirement::HostVisible);
+       const VkFormat          vertexFormat            = VK_FORMAT_R32_SFLOAT;
+       const deUint32          vertexStride            = tcu::getPixelSize(mapVkFormat(vertexFormat));
+       const VkDeviceSize      vertexDataSizeBytes     = NUM_TESS_LEVELS * numPatchesPerDrawCall * vertexStride;
+       const Buffer            vertexBuffer            (vk, device, allocator, makeBufferCreateInfo(vertexDataSizeBytes, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), MemoryRequirement::HostVisible);
 
        // Output buffer: number of primitives and an array of PerPrimitive structures
 
-       const int                  resultBufferMaxVertices              = numPatchesPerDrawCall * maxNumPrimitivesPerPatch * numVerticesPerPrimitive(m_caseDef.primitiveType, m_caseDef.usePointMode);
-       const int                  resultBufferTessCoordsOffset = (int)sizeof(deInt32) * 4;
-       const VkDeviceSize resultBufferSizeBytes        = resultBufferTessCoordsOffset + resultBufferMaxVertices * sizeof(PerPrimitive);
-       const Buffer       resultBuffer                 (vk, device, allocator, makeBufferCreateInfo(resultBufferSizeBytes, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT), MemoryRequirement::HostVisible);
+       const int                       resultBufferMaxVertices                 = numPatchesPerDrawCall * maxNumPrimitivesPerPatch * numVerticesPerPrimitive(m_caseDef.primitiveType, m_caseDef.usePointMode);
+       const int                       resultBufferTessCoordsOffset    = (int)sizeof(deInt32) * 4;
+       const VkDeviceSize      resultBufferSizeBytes                   = resultBufferTessCoordsOffset + resultBufferMaxVertices * sizeof(PerPrimitive);
+       const Buffer            resultBuffer                                    (vk, device, allocator, makeBufferCreateInfo(resultBufferSizeBytes, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT), MemoryRequirement::HostVisible);
 
        // Descriptors
 
@@ -1389,11 +1389,11 @@ tcu::TestStatus InvarianceTestInstance::iterate (void)
                .writeSingle(*descriptorSet, DescriptorSetUpdateBuilder::Location::binding(0u), VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, &resultBufferInfo)
                .update(vk, device);
 
-       const Unique<VkRenderPass>     renderPass    (makeRenderPassWithoutAttachments (vk, device));
-       const Unique<VkFramebuffer>    framebuffer   (makeFramebufferWithoutAttachments(vk, device, *renderPass));
-       const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout               (vk, device, *descriptorSetLayout));
-       const Unique<VkCommandPool>    cmdPool       (makeCommandPool                  (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>  cmdBuffer     (allocateCommandBuffer            (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkRenderPass>              renderPass              (makeRenderPassWithoutAttachments       (vk, device));
+       const Unique<VkFramebuffer>             framebuffer             (makeFramebuffer                                        (vk, device, *renderPass, 0u, DE_NULL, 1u, 1u));
+       const Unique<VkPipelineLayout>  pipelineLayout  (makePipelineLayout                                     (vk, device, *descriptorSetLayout));
+       const Unique<VkCommandPool>             cmdPool                 (makeCommandPool                                        (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer               (allocateCommandBuffer                          (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        for (int tessLevelCaseNdx = 0; tessLevelCaseNdx < static_cast<int>(tessLevelCases.size()); ++tessLevelCaseNdx)
        {
@@ -1429,13 +1429,13 @@ tcu::TestStatus InvarianceTestInstance::iterate (void)
                        for (std::vector<Winding>::const_iterator windingIter = windingCases.begin(); windingIter != windingCases.end(); ++windingIter)
                        {
                                const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
-                                       .setPatchControlPoints        (NUM_TESS_LEVELS)
-                                       .setVertexInputSingleAttribute(vertexFormat, vertexStride)
-                                       .setShader                    (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                  m_context.getBinaryCollection().get("vert"), DE_NULL)
-                                       .setShader                    (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,    m_context.getBinaryCollection().get("tesc"), DE_NULL)
-                                       .setShader                    (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, m_context.getBinaryCollection().get(getProgramName("tese", *windingIter, m_caseDef.usePointMode)), DE_NULL)
-                                       .setShader                    (vk, device, VK_SHADER_STAGE_GEOMETRY_BIT,                m_context.getBinaryCollection().get(getProgramName("geom", m_caseDef.usePointMode)), DE_NULL)
-                                       .build                        (vk, device, *pipelineLayout, *renderPass));
+                                       .setPatchControlPoints                  (NUM_TESS_LEVELS)
+                                       .setVertexInputSingleAttribute  (vertexFormat, vertexStride)
+                                       .setShader                                              (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                        m_context.getBinaryCollection().get("vert"), DE_NULL)
+                                       .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,          m_context.getBinaryCollection().get("tesc"), DE_NULL)
+                                       .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,       m_context.getBinaryCollection().get(getProgramName("tese", *windingIter, m_caseDef.usePointMode)), DE_NULL)
+                                       .setShader                                              (vk, device, VK_SHADER_STAGE_GEOMETRY_BIT,                                      m_context.getBinaryCollection().get(getProgramName("geom", m_caseDef.usePointMode)), DE_NULL)
+                                       .build                                                  (vk, device, *pipelineLayout, *renderPass));
 
                                {
                                        const Allocation& alloc = resultBuffer.getAllocation();
@@ -1799,8 +1799,8 @@ TestInstance* InvarianceTestCase::createInstance (Context& context) const
 {
        switch (m_caseDef.caseType)
        {
-               case CASETYPE_INVARIANT_PRIMITIVE_SET:                  return new InvariantPrimitiveSetTestInstance    (context, m_caseDef);
-               case CASETYPE_INVARIANT_TRIANGLE_SET:                   return new InvariantTriangleSetTestInstance     (context, m_caseDef);
+               case CASETYPE_INVARIANT_PRIMITIVE_SET:                  return new InvariantPrimitiveSetTestInstance    (context, m_caseDef);
+               case CASETYPE_INVARIANT_TRIANGLE_SET:                   return new InvariantTriangleSetTestInstance             (context, m_caseDef);
                case CASETYPE_INVARIANT_OUTER_TRIANGLE_SET:             return new InvariantOuterTriangleSetTestInstance(context, m_caseDef);
                case CASETYPE_INVARIANT_INNER_TRIANGLE_SET:             return new InvariantInnerTriangleSetTestInstance(context, m_caseDef);
                default:
@@ -2012,18 +2012,18 @@ tcu::TestStatus test (Context& context, const CaseDefinition caseDef)
 
        // Vertex input attributes buffer: to pass tessellation levels
 
-       const VkFormat          vertexFormat        = VK_FORMAT_R32_SFLOAT;
-       const deUint32          vertexStride        = tcu::getPixelSize(mapVkFormat(vertexFormat));
-       const VkDeviceSize      vertexDataSizeBytes = NUM_TESS_LEVELS * vertexStride;
-       const Buffer            vertexBuffer        (vk, device, allocator, makeBufferCreateInfo(vertexDataSizeBytes, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), MemoryRequirement::HostVisible);
+       const VkFormat          vertexFormat            = VK_FORMAT_R32_SFLOAT;
+       const deUint32          vertexStride            = tcu::getPixelSize(mapVkFormat(vertexFormat));
+       const VkDeviceSize      vertexDataSizeBytes     = NUM_TESS_LEVELS * vertexStride;
+       const Buffer            vertexBuffer            (vk, device, allocator, makeBufferCreateInfo(vertexDataSizeBytes, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), MemoryRequirement::HostVisible);
 
        DE_ASSERT(vertexDataSizeBytes == sizeof(TessLevels));
 
        // Output buffer: number of invocations and array of tess coords
 
-       const int                  resultBufferTessCoordsOffset = (int)sizeof(deInt32) * 4;
-       const VkDeviceSize resultBufferSizeBytes        = resultBufferTessCoordsOffset + maxNumVerticesInDrawCall * sizeof(tcu::Vec4);
-       const Buffer       resultBuffer                 (vk, device, allocator, makeBufferCreateInfo(resultBufferSizeBytes, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT), MemoryRequirement::HostVisible);
+       const int                       resultBufferTessCoordsOffset    = (int)sizeof(deInt32) * 4;
+       const VkDeviceSize      resultBufferSizeBytes                   = resultBufferTessCoordsOffset + maxNumVerticesInDrawCall * sizeof(tcu::Vec4);
+       const Buffer            resultBuffer                                    (vk, device, allocator, makeBufferCreateInfo(resultBufferSizeBytes, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT), MemoryRequirement::HostVisible);
 
        // Descriptors
 
@@ -2042,11 +2042,11 @@ tcu::TestStatus test (Context& context, const CaseDefinition caseDef)
                .writeSingle(*descriptorSet, DescriptorSetUpdateBuilder::Location::binding(0u), VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, &resultBufferInfo)
                .update(vk, device);
 
-       const Unique<VkRenderPass>     renderPass    (makeRenderPassWithoutAttachments (vk, device));
-       const Unique<VkFramebuffer>    framebuffer   (makeFramebufferWithoutAttachments(vk, device, *renderPass));
-       const Unique<VkPipelineLayout> pipelineLayout(makePipelineLayout               (vk, device, *descriptorSetLayout));
-       const Unique<VkCommandPool>    cmdPool       (makeCommandPool                  (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>  cmdBuffer     (allocateCommandBuffer            (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkRenderPass>              renderPass              (makeRenderPassWithoutAttachments       (vk, device));
+       const Unique<VkFramebuffer>             framebuffer             (makeFramebuffer                                        (vk, device, *renderPass, 0u, DE_NULL, 1u, 1u));
+       const Unique<VkPipelineLayout>  pipelineLayout  (makePipelineLayout                                     (vk, device, *descriptorSetLayout));
+       const Unique<VkCommandPool>             cmdPool                 (makeCommandPool                                        (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer               (allocateCommandBuffer                          (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
                .setPatchControlPoints        (NUM_TESS_LEVELS)
@@ -2158,7 +2158,7 @@ tcu::TestCaseGroup* createInvarianceTests (tcu::TestContext& testCtx)
 {
        de::MovePtr<tcu::TestCaseGroup> group (new tcu::TestCaseGroup(testCtx, "invariance", "Test tessellation invariance rules"));
 
-       de::MovePtr<tcu::TestCaseGroup> invariantPrimitiveSetGroup              (new tcu::TestCaseGroup(testCtx, "primitive_set",                                       "Test invariance rule #1"));
+       de::MovePtr<tcu::TestCaseGroup> invariantPrimitiveSetGroup                              (new tcu::TestCaseGroup(testCtx, "primitive_set",                                       "Test invariance rule #1"));
        de::MovePtr<tcu::TestCaseGroup> invariantOuterEdgeGroup                                 (new tcu::TestCaseGroup(testCtx, "outer_edge_division",                         "Test invariance rule #2"));
        de::MovePtr<tcu::TestCaseGroup> symmetricOuterEdgeGroup                                 (new tcu::TestCaseGroup(testCtx, "outer_edge_symmetry",                         "Test invariance rule #3"));
        de::MovePtr<tcu::TestCaseGroup> outerEdgeVertexSetIndexIndependenceGroup(new tcu::TestCaseGroup(testCtx, "outer_edge_index_independence",       "Test invariance rule #4"));
@@ -2179,23 +2179,23 @@ tcu::TestCaseGroup* createInvarianceTests (tcu::TestContext& testCtx)
 
                if (triOrQuad)
                {
-                       invariantOuterEdgeGroup->addChild       (    InvariantOuterEdge::makeOuterEdgeDivisionTest        (testCtx, primSpacName, "", primitiveType, spacingMode));
-                       invariantTriangleSetGroup->addChild     (PrimitiveSetInvariance::makeInvariantTriangleSetTest     (testCtx, primSpacName, "", primitiveType, spacingMode));
-                       invariantInnerTriangleSetGroup->addChild(PrimitiveSetInvariance::makeInvariantInnerTriangleSetTest(testCtx, primSpacName, "", primitiveType, spacingMode));
-                       invariantOuterTriangleSetGroup->addChild(PrimitiveSetInvariance::makeInvariantOuterTriangleSetTest(testCtx, primSpacName, "", primitiveType, spacingMode));
+                       invariantOuterEdgeGroup->addChild               (    InvariantOuterEdge::makeOuterEdgeDivisionTest                      (testCtx, primSpacName, "", primitiveType, spacingMode));
+                       invariantTriangleSetGroup->addChild             (PrimitiveSetInvariance::makeInvariantTriangleSetTest           (testCtx, primSpacName, "", primitiveType, spacingMode));
+                       invariantInnerTriangleSetGroup->addChild(PrimitiveSetInvariance::makeInvariantInnerTriangleSetTest      (testCtx, primSpacName, "", primitiveType, spacingMode));
+                       invariantOuterTriangleSetGroup->addChild(PrimitiveSetInvariance::makeInvariantOuterTriangleSetTest      (testCtx, primSpacName, "", primitiveType, spacingMode));
                }
 
                for (int windingNdx = 0; windingNdx < WINDING_LAST; ++windingNdx)
                for (int usePointModeNdx = 0; usePointModeNdx <= 1; ++usePointModeNdx)
                {
-                       const Winding     winding               = static_cast<Winding>(windingNdx);
-                       const bool        usePointMode          = (usePointModeNdx != 0);
-                       const std::string primSpacWindPointName = primSpacName + "_" + getWindingShaderName(winding) + (usePointMode ? "_point_mode" : "");
-
-                       invariantPrimitiveSetGroup->addChild     (PrimitiveSetInvariance::makeInvariantPrimitiveSetTest(testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
-                       tessCoordComponentRangeGroup->addChild   (    TessCoordComponent::makeTessCoordRangeTest       (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
-                       oneMinusTessCoordComponentGroup->addChild(    TessCoordComponent::makeOneMinusTessCoordTest    (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
-                       symmetricOuterEdgeGroup->addChild        (    InvariantOuterEdge::makeSymmetricOuterEdgeTest   (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
+                       const Winding           winding                                 = static_cast<Winding>(windingNdx);
+                       const bool                      usePointMode                    = (usePointModeNdx != 0);
+                       const std::string       primSpacWindPointName   = primSpacName + "_" + getWindingShaderName(winding) + (usePointMode ? "_point_mode" : "");
+
+                       invariantPrimitiveSetGroup->addChild            (PrimitiveSetInvariance::makeInvariantPrimitiveSetTest  (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
+                       tessCoordComponentRangeGroup->addChild          (    TessCoordComponent::makeTessCoordRangeTest                 (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
+                       oneMinusTessCoordComponentGroup->addChild       (    TessCoordComponent::makeOneMinusTessCoordTest              (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
+                       symmetricOuterEdgeGroup->addChild                       (    InvariantOuterEdge::makeSymmetricOuterEdgeTest             (testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
 
                        if (triOrQuad)
                                outerEdgeVertexSetIndexIndependenceGroup->addChild(InvariantOuterEdge::makeOuterEdgeIndexIndependenceTest(testCtx, primSpacWindPointName, "", primitiveType, spacingMode, winding, usePointMode));
index 03f2665..458d6a7 100644 (file)
@@ -200,7 +200,7 @@ tcu::TestStatus runTest (Context& context, const CaseDefinition caseDef)
 
        const Unique<VkImageView>               colorAttachmentView     (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
        const Unique<VkRenderPass>              renderPass                      (makeRenderPass(vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
        const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout(vk, device, *descriptorSetLayout));
        const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
        const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
index 06b08af..1927ea9 100644 (file)
@@ -468,7 +468,7 @@ tcu::TestStatus test (Context& context, const CaseDefinition caseDef)
 
        const Unique<VkImageView>               colorAttachmentView     (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
        const Unique<VkRenderPass>              renderPass                      (makeRenderPass(vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
        const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout(vk, device, *descriptorSetLayout));
        const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
        const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
index cdbc8d5..3a878d7 100644 (file)
@@ -109,12 +109,12 @@ tcu::TestStatus runTest (Context&                                                 context,
 
        // Pipeline
 
-       const Unique<VkImageView>               colorAttachmentView(makeImageView                                               (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
-       const Unique<VkRenderPass>              renderPass                 (makeRenderPass                                              (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer                (makeFramebuffer                                             (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
-       const Unique<VkPipelineLayout>  pipelineLayout     (makePipelineLayoutWithoutDescriptors(vk, device));
-       const Unique<VkCommandPool>             cmdPool                    (makeCommandPool                                             (vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>   cmdBuffer                  (allocateCommandBuffer                               (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView                  (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass                 (vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer                (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout             (vk, device));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool                (vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
                .setRenderSize                            (renderSize)
index 536411a..106ee04 100644 (file)
@@ -830,22 +830,22 @@ tcu::TestStatus UserDefinedIOTestInstance::iterate (void)
 
        // Pipeline
 
-       const Unique<VkImageView>      colorAttachmentView(makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
-       const Unique<VkRenderPass>     renderPass         (makeRenderPass(vk, device, colorFormat));
-       const Unique<VkFramebuffer>    framebuffer        (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
-       const Unique<VkPipelineLayout> pipelineLayout     (makePipelineLayout(vk, device, *descriptorSetLayout));
-       const Unique<VkCommandPool>    cmdPool            (makeCommandPool(vk, device, queueFamilyIndex));
-       const Unique<VkCommandBuffer>  cmdBuffer          (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
-
-       const Unique<VkPipeline> pipeline(GraphicsPipelineBuilder()
-               .setRenderSize                (renderSize)
-               .setPatchControlPoints        (numAttributes)
-               .setVertexInputSingleAttribute(vertexFormat, vertexStride)
-               .setShader                    (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                  m_context.getBinaryCollection().get("vert"), DE_NULL)
-               .setShader                    (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,    m_context.getBinaryCollection().get("tesc"), DE_NULL)
-               .setShader                    (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, m_context.getBinaryCollection().get("tese"), DE_NULL)
-               .setShader                    (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,                                m_context.getBinaryCollection().get("frag"), DE_NULL)
-               .build                        (vk, device, *pipelineLayout, *renderPass));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView(vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass(vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer(vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout(vk, device, *descriptorSetLayout));
+       const Unique<VkCommandPool>             cmdPool                         (makeCommandPool(vk, device, queueFamilyIndex));
+       const Unique<VkCommandBuffer>   cmdBuffer                       (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+       const Unique<VkPipeline> pipeline       (GraphicsPipelineBuilder()
+               .setRenderSize                                  (renderSize)
+               .setPatchControlPoints                  (numAttributes)
+               .setVertexInputSingleAttribute  (vertexFormat, vertexStride)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                        m_context.getBinaryCollection().get("vert"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,          m_context.getBinaryCollection().get("tesc"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,       m_context.getBinaryCollection().get("tese"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,                                      m_context.getBinaryCollection().get("frag"), DE_NULL)
+               .build                                                  (vk, device, *pipelineLayout, *renderPass));
 
        // Begin draw
 
index d1d83ec..4a297ed 100644 (file)
@@ -34,51 +34,6 @@ namespace tessellation
 
 using namespace vk;
 
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
-       const VkCommandPoolCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,                     // VkStructureType                      sType;
-               DE_NULL,                                                                                        // const void*                          pNext;
-               VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,        // VkCommandPoolCreateFlags     flags;
-               queueFamilyIndex,                                                                       // deUint32                                     queueFamilyIndex;
-       };
-       return createCommandPool(vk, device, &info);
-}
-
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkPipelineLayout> makePipelineLayoutWithoutDescriptors (const DeviceInterface&            vk,
-                                                                                                                        const VkDevice                         device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 Move<VkPipeline> makeComputePipeline (const DeviceInterface&           vk,
                                                                          const VkDevice                                device,
                                                                          const VkPipelineLayout                pipelineLayout,
@@ -193,48 +148,6 @@ Move<VkRenderPass> makeRenderPassWithoutAttachments (const DeviceInterface&        vk,
        return createRenderPass(vk, device, &renderPassInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
-                                                                        const VkDevice                         device,
-                                                                        const VkRenderPass                     renderPass,
-                                                                        const VkImageView                      colorAttachment,
-                                                                        const deUint32                         width,
-                                                                        const deUint32                         height,
-                                                                        const deUint32                         layers)
-{
-       const VkFramebufferCreateInfo framebufferInfo = {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              // VkStructureType                             sType;
-               DE_NULL,                                                                                // const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    // VkFramebufferCreateFlags                    flags;
-               renderPass,                                                                             // VkRenderPass                                renderPass;
-               1u,                                                                                             // uint32_t                                    attachmentCount;
-               &colorAttachment,                                                               // const VkImageView*                          pAttachments;
-               width,                                                                                  // uint32_t                                    width;
-               height,                                                                                 // uint32_t                                    height;
-               layers,                                                                                 // uint32_t                                    layers;
-       };
-
-       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;
-               1u,                                                                                             // uint32_t                                    width;
-               1u,                                                                                             // uint32_t                                    height;
-               1u,                                                                                             // uint32_t                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 GraphicsPipelineBuilder& GraphicsPipelineBuilder::setShader (const DeviceInterface&                    vk,
                                                                                                                         const VkDevice                                 device,
                                                                                                                         const VkShaderStageFlagBits    stage,
index c8fedab..05c8520 100644 (file)
@@ -209,13 +209,8 @@ enum FeatureFlagBits
 typedef deUint32 FeatureFlags;
 
 vk::VkImageCreateInfo                  makeImageCreateInfo                                                     (const tcu::IVec2& size, const vk::VkFormat format, const vk::VkImageUsageFlags usage, const deUint32 numArrayLayers);
-vk::Move<vk::VkCommandPool>            makeCommandPool                                                         (const vk::DeviceInterface& vk, const vk::VkDevice device, const deUint32 queueFamilyIndex);
-vk::Move<vk::VkPipelineLayout> makePipelineLayout                                                      (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorSetLayout descriptorSetLayout);
-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);
 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::VkBufferImageCopy                  makeBufferImageCopy                                                     (const vk::VkExtent3D extent, const vk::VkImageSubresourceLayers subresourceLayers);
 void                                                   beginRenderPassWithRasterizationDisabled        (const vk::DeviceInterface& vk, const vk::VkCommandBuffer commandBuffer, const vk::VkRenderPass renderPass, const vk::VkFramebuffer framebuffer);
 void                                                   requireFeatures                                                         (const vk::InstanceInterface& vki, const vk::VkPhysicalDevice physDevice, const FeatureFlags flags);
index eb44714..f1d81b0 100644 (file)
@@ -432,10 +432,10 @@ tcu::TestStatus WindingTestInstance::iterate (void)
 
        // Pipeline
 
-       const Unique<VkImageView>               colorAttachmentView(makeImageView                       (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
-       const Unique<VkRenderPass>              renderPass         (makeRenderPass                      (vk, device, colorFormat));
-       const Unique<VkFramebuffer>             framebuffer        (makeFramebuffer                     (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y(), 1u));
-       const Unique<VkPipelineLayout>  pipelineLayout     (makePipelineLayoutWithoutDescriptors(vk, device));
+       const Unique<VkImageView>               colorAttachmentView     (makeImageView          (vk, device, *colorAttachmentImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorImageSubresourceRange));
+       const Unique<VkRenderPass>              renderPass                      (makeRenderPass         (vk, device, colorFormat));
+       const Unique<VkFramebuffer>             framebuffer                     (makeFramebuffer        (vk, device, *renderPass, *colorAttachmentView, renderSize.x(), renderSize.y()));
+       const Unique<VkPipelineLayout>  pipelineLayout          (makePipelineLayout     (vk, device));
 
        const VkCullModeFlags cullMode = VK_CULL_MODE_BACK_BIT;
 
@@ -444,20 +444,20 @@ tcu::TestStatus WindingTestInstance::iterate (void)
        const Unique<VkPipeline> pipelineCounterClockwise(GraphicsPipelineBuilder()
                .setCullModeFlags                               (cullMode)
                .setFrontFace                                   (VK_FRONT_FACE_COUNTER_CLOCKWISE)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                   m_context.getBinaryCollection().get("vert"), DE_NULL)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,    m_context.getBinaryCollection().get("tesc"), DE_NULL)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, m_context.getBinaryCollection().get("tese"), DE_NULL)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,                                 m_context.getBinaryCollection().get("frag"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                        m_context.getBinaryCollection().get("vert"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,          m_context.getBinaryCollection().get("tesc"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,       m_context.getBinaryCollection().get("tese"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,                                      m_context.getBinaryCollection().get("frag"), DE_NULL)
                .setTessellationDomainOrigin    (m_domainOrigin)
                .build                                                  (vk, device, *pipelineLayout, *renderPass));
 
        const Unique<VkPipeline> pipelineClockwise(GraphicsPipelineBuilder()
                .setCullModeFlags                               (cullMode)
                .setFrontFace                                   (VK_FRONT_FACE_CLOCKWISE)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                   m_context.getBinaryCollection().get("vert"), DE_NULL)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,     m_context.getBinaryCollection().get("tesc"), DE_NULL)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, m_context.getBinaryCollection().get("tese"), DE_NULL)
-               .setShader                                              (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,                                 m_context.getBinaryCollection().get("frag"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_VERTEX_BIT,                                        m_context.getBinaryCollection().get("vert"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,          m_context.getBinaryCollection().get("tesc"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,       m_context.getBinaryCollection().get("tese"), DE_NULL)
+               .setShader                                              (vk, device, VK_SHADER_STAGE_FRAGMENT_BIT,                                      m_context.getBinaryCollection().get("frag"), DE_NULL)
                .setTessellationDomainOrigin    (m_domainOrigin)
                .build                                                  (vk, device, *pipelineLayout, *renderPass));
 
index 1c58a45..a43e816 100644 (file)
@@ -1577,23 +1577,6 @@ VkBufferCreateInfo makeBufferCreateInfo (const VkDeviceSize                      bufferSize,
        return bufferCreateInfo;
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device)
-{
-       const VkPipelineLayoutCreateInfo        pipelineLayoutCreateInfo        =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,  //  VkStructureType                                     sType;
-               DE_NULL,                                                                                //  const void*                                         pNext;
-               (VkPipelineLayoutCreateFlags)0,                                 //  VkPipelineLayoutCreateFlags         flags;
-               0u,                                                                                             //  deUint32                                            setLayoutCount;
-               DE_NULL,                                                                                //  const VkDescriptorSetLayout*        pSetLayouts;
-               0u,                                                                                             //  deUint32                                            pushConstantRangeCount;
-               DE_NULL,                                                                                //  const VkPushConstantRange*          pPushConstantRanges;
-       };
-
-       return createPipelineLayout(vk, device, &pipelineLayoutCreateInfo);
-}
-
 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&          vk,
                                                                           const VkDevice                               device,
                                                                           const VkPipelineLayout               pipelineLayout,
@@ -1632,27 +1615,6 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&            vk,
                                                                &vertexInputStateCreateInfo);           // const VkPipelineVertexInputStateCreateInfo*  vertexInputStateCreateInfo
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
-                                                                        const VkDevice                 device,
-                                                                        const VkRenderPass             renderPass,
-                                                                        const VkExtent2D&      renderSize)
-{
-       const VkFramebufferCreateInfo framebufferInfo   =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              //  VkStructureType                             sType;
-               DE_NULL,                                                                                //  const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    //  VkFramebufferCreateFlags    flags;
-               renderPass,                                                                             //  VkRenderPass                                renderPass;
-               0u,                                                                                             //  deUint32                                    attachmentCount;
-               DE_NULL,                                                                                //  const VkImageView*                  pAttachments;
-               renderSize.width,                                                               //  deUint32                                    width;
-               renderSize.height,                                                              //  deUint32                                    height;
-               1u,                                                                                             //  deUint32                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 // InterfaceBlockCaseInstance
 
 class InterfaceBlockCaseInstance : public vkt::TestInstance
@@ -1787,7 +1749,7 @@ tcu::TestStatus InterfaceBlockCaseInstance::iterate (void)
        const Move<VkShaderModule>              vertModule                      (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
        const Move<VkShaderModule>              geomModule                      (getGeometryShaderModule(vk, device));
        const Move<VkRenderPass>                renderPass                      (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
-       const Move<VkFramebuffer>               framebuffer                     (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D));
+       const Move<VkFramebuffer>               framebuffer                     (makeFramebuffer                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
        const Move<VkPipelineLayout>    pipelineLayout          (makePipelineLayout             (vk, device));
        const Move<VkPipeline>                  pipeline                        (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertModule, *geomModule, m_imageExtent2D));
        const Move<VkCommandPool>               cmdPool                         (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
index f4613ab..2ee5aa0 100644 (file)
@@ -263,28 +263,6 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface&          vk,
        return createRenderPass(vk, device, &renderPassInfo);
 }
 
-Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&    vk,
-                                                                        const VkDevice                 device,
-                                                                        const VkRenderPass             renderPass,
-                                                                        const VkExtent2D&              renderSize,
-                                                                        const VkImageView*             colorAttachment)
-{
-       const VkFramebufferCreateInfo framebufferInfo   =
-       {
-               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,              //  VkStructureType                             sType;
-               DE_NULL,                                                                                //  const void*                                 pNext;
-               (VkFramebufferCreateFlags)0,                                    //  VkFramebufferCreateFlags    flags;
-               renderPass,                                                                             //  VkRenderPass                                renderPass;
-               colorAttachment == DE_NULL ? 0u : 1u,                   //  deUint32                                    attachmentCount;
-               colorAttachment,                                                                //  const VkImageView*                  pAttachments;
-               renderSize.width,                                                               //  deUint32                                    width;
-               renderSize.height,                                                              //  deUint32                                    height;
-               1u,                                                                                             //  deUint32                                    layers;
-       };
-
-       return createFramebuffer(vk, device, &framebufferInfo);
-}
-
 VkImageMemoryBarrier makeImageMemoryBarrier    (const VkAccessFlags                    srcAccessMask,
                                                                                         const VkAccessFlags                    dstAccessMask,
                                                                                         const VkImageLayout                    oldLayout,
@@ -583,13 +561,13 @@ tcu::TestStatus TransformFeedbackBasicTestInstance::iterate (void)
        const VkQueue                                           queue                                   = m_context.getUniversalQueue();
        Allocator&                                                      allocator                               = m_context.getDefaultAllocator();
 
-       const Unique<VkShaderModule>            vertexModule                    (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
-       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
-       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkShaderModule>            vertexModule                    (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                                                 (vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
+       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkBufferCreateInfo                        tfBufCreateInfo                 = makeBufferCreateInfo(m_parameters.bufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
        const Move<VkBuffer>                            tfBuf                                   = createBuffer(vk, device, &tfBufCreateInfo);
@@ -653,14 +631,14 @@ tcu::TestStatus TransformFeedbackResumeTestInstance::iterate (void)
        const VkQueue                                                   queue                                   = m_context.getUniversalQueue();
        Allocator&                                                              allocator                               = m_context.getDefaultAllocator();
 
-       const Unique<VkShaderModule>                    vertexModule                    (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkRenderPass>                              renderPass                              (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
-       const Unique<VkFramebuffer>                             framebuffer                             (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>                  pipelineLayout                  (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                                pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
+       const Unique<VkShaderModule>                    vertexModule                    (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkRenderPass>                              renderPass                              (makeRenderPass                                                 (vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkFramebuffer>                             framebuffer                             (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>                  pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                                pipeline                                (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
 
-       const Unique<VkCommandPool>                             cmdPool                                 (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>                   cmdBuffer                               (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkCommandPool>                             cmdPool                                 (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>                   cmdBuffer                               (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkBufferCreateInfo                                tfBufCreateInfo                 = makeBufferCreateInfo(m_parameters.bufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
        const Move<VkBuffer>                                    tfBuf                                   = createBuffer(vk, device, &tfBufCreateInfo);
@@ -746,13 +724,13 @@ tcu::TestStatus TransformFeedbackTriangleStripWithAdjacencyTestInstance::iterate
        DE_ASSERT(m_parameters.partCount >= 6);
 
        const VkPrimitiveTopology                       topology                                (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY);
-       const Unique<VkShaderModule>            vertexModule                    (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
-       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u, DE_NULL, topology));
-       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkShaderModule>            vertexModule                    (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                                                 (vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u, DE_NULL, topology));
+       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const deUint32                                          numPrimitives                   = m_parameters.partCount / 2u - 2u;
        const deUint32                                          numPoints                               = 3u * numPrimitives;
@@ -877,13 +855,13 @@ tcu::TestStatus TransformFeedbackBuiltinTestInstance::iterate (void)
        const VkQueue                                           queue                                   = m_context.getUniversalQueue();
        Allocator&                                                      allocator                               = m_context.getDefaultAllocator();
 
-       const Unique<VkShaderModule>            vertexModule                    (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
-       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
-       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkShaderModule>            vertexModule                    (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                                                 (vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
+       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkDeviceSize                                      tfBufSize                               = m_parameters.bufferSize * m_parameters.partCount;
        const VkBufferCreateInfo                        tfBufCreateInfo                 = makeBufferCreateInfo(tfBufSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
@@ -1013,16 +991,16 @@ tcu::TestStatus TransformFeedbackMultistreamTestInstance::iterate (void)
        const VkQueue                                           queue                                   = m_context.getUniversalQueue();
        Allocator&                                                      allocator                               = m_context.getDefaultAllocator();
 
-       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                                                 (vk, device, VK_FORMAT_UNDEFINED));
 
-       const Unique<VkShaderModule>            vertexModule                    (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkShaderModule>            geomModule                              (createShaderModule             (vk, device, m_context.getBinaryCollection().get("geom"), 0u));
+       const Unique<VkShaderModule>            vertexModule                    (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkShaderModule>            geomModule                              (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("geom"), 0u));
 
-       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geomModule, DE_NULL, m_imageExtent2D, 0u));
-       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geomModule, DE_NULL, m_imageExtent2D, 0u));
+       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkBufferCreateInfo                        tfBufCreateInfo                 = makeBufferCreateInfo(m_parameters.bufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
        const Move<VkBuffer>                            tfBuf                                   = createBuffer(vk, device, &tfBufCreateInfo);
@@ -1175,17 +1153,17 @@ tcu::TestStatus TransformFeedbackStreamsTestInstance::iterate (void)
        const tcu::RGBA                                         clearColor                      (tcu::RGBA::black());
        const VkImageSubresourceRange           colorSubresRange        (makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u));
        const VkDeviceSize                                      colorBufferSize         (m_imageExtent2D.width * m_imageExtent2D.height * tcu::getPixelSize(mapVkFormat(colorFormat)));
-       const Unique<VkImage>                           colorImage                      (makeImage                              (vk, device, makeImageCreateInfo(0u, VK_IMAGE_TYPE_2D, colorFormat, m_imageExtent2D, 1u, imageUsageFlags)));
-       const UniquePtr<Allocation>                     colorImageAlloc         (bindImage                              (vk, device, allocator, *colorImage, MemoryRequirement::Any));
-       const Unique<VkImageView>                       colorAttachment         (makeImageView                  (vk, device, *colorImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
-       const Unique<VkBuffer>                          colorBuffer                     (makeBuffer                             (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
-       const UniquePtr<Allocation>                     colorBufferAlloc        (bindBuffer                             (vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
-
-       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, &*colorAttachment));
-       const Unique<VkPipelineLayout>          pipelineLayout          (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertModule, *geomModule, *fragModule, m_imageExtent2D, 0u, &m_parameters.streamId));
-       const Unique<VkCommandPool>                     cmdPool                         (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                       (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkImage>                           colorImage                      (makeImage                                                              (vk, device, makeImageCreateInfo(0u, VK_IMAGE_TYPE_2D, colorFormat, m_imageExtent2D, 1u, imageUsageFlags)));
+       const UniquePtr<Allocation>                     colorImageAlloc         (bindImage                                                              (vk, device, allocator, *colorImage, MemoryRequirement::Any));
+       const Unique<VkImageView>                       colorAttachment         (makeImageView                                                  (vk, device, *colorImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+       const Unique<VkBuffer>                          colorBuffer                     (makeBuffer                                                             (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+       const UniquePtr<Allocation>                     colorBufferAlloc        (bindBuffer                                                             (vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
+
+       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                                                (vk, device, *renderPass, *colorAttachment, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout          (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertModule, *geomModule, *fragModule, m_imageExtent2D, 0u, &m_parameters.streamId));
+       const Unique<VkCommandPool>                     cmdPool                         (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                       (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkImageMemoryBarrier                      preCopyBarrier          = makeImageMemoryBarrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
                                                                                                                                                                         VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
@@ -1318,14 +1296,14 @@ tcu::TestStatus TransformFeedbackIndirectDrawTestInstance::iterate (void)
        const deUint32                                          counterBufferValue      = m_parameters.vertexStride * vertexCount;
        const VkDeviceSize                                      counterBufferSize       = sizeof(counterBufferValue);
        const VkBufferUsageFlags                        counterBufferUsage      = VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
-       const Unique<VkBuffer>                          counterBuffer           (makeBuffer                             (vk, device, makeBufferCreateInfo(counterBufferSize, counterBufferUsage)));
-       const UniquePtr<Allocation>                     counterBufferAlloc      (bindBuffer                             (vk, device, allocator, *counterBuffer, MemoryRequirement::HostVisible));
+       const Unique<VkBuffer>                          counterBuffer           (makeBuffer                                                             (vk, device, makeBufferCreateInfo(counterBufferSize, counterBufferUsage)));
+       const UniquePtr<Allocation>                     counterBufferAlloc      (bindBuffer                                                             (vk, device, allocator, *counterBuffer, MemoryRequirement::HostVisible));
 
-       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, &*colorAttachment));
-       const Unique<VkPipelineLayout>          pipelineLayout          (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertModule, DE_NULL, *fragModule, m_imageExtent2D, 0u, DE_NULL, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, true));
-       const Unique<VkCommandPool>                     cmdPool                         (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                       (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                                                (vk, device, *renderPass, *colorAttachment, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout          (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertModule, DE_NULL, *fragModule, m_imageExtent2D, 0u, DE_NULL, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, true));
+       const Unique<VkCommandPool>                     cmdPool                         (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                       (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkImageMemoryBarrier                      preCopyBarrier          = makeImageMemoryBarrier(VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
                                                                                                                                                                         VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
@@ -1399,13 +1377,13 @@ tcu::TestStatus TransformFeedbackBackwardDependencyTestInstance::iterate (void)
        const VkQueue                                           queue                           = m_context.getUniversalQueue();
        Allocator&                                                      allocator                       = m_context.getDefaultAllocator();
 
-       const Unique<VkShaderModule>            vertexModule            (createShaderModule                                     (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkRenderPass>                      renderPass                      (TransformFeedback::makeRenderPass      (vk, device));
-       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                                        (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>          pipelineLayout          (makePipelineLayout                                     (vk, device));
-       const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline                           (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
-       const Unique<VkCommandPool>                     cmdPool                         (createCommandPool                                      (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                       (allocateCommandBuffer                          (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkShaderModule>            vertexModule            (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkRenderPass>                      renderPass                      (TransformFeedback::makeRenderPass              (vk, device));
+       const Unique<VkFramebuffer>                     framebuffer                     (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout          (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                        (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertexModule, DE_NULL, DE_NULL, m_imageExtent2D, 0u));
+       const Unique<VkCommandPool>                     cmdPool                         (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                       (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkBufferCreateInfo                        tfBufCreateInfo         = makeBufferCreateInfo(m_parameters.bufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
        const Move<VkBuffer>                            tfBuf                           = createBuffer(vk, device, &tfBufCreateInfo);
@@ -1527,16 +1505,16 @@ tcu::TestStatus TransformFeedbackQueryTestInstance::iterate (void)
        const deUint32                                          bytesPerVertex                  = static_cast<deUint32>(4 * sizeof(float));
        const deUint32                                          numVerticesInBuffer             = m_parameters.bufferSize / bytesPerVertex;
        const deUint32                                          numVerticesToWrite              = numVerticesInBuffer + overflowVertices;
-       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                 (vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass                                                 (vk, device, VK_FORMAT_UNDEFINED));
 
-       const Unique<VkShaderModule>            vertModule                              (createShaderModule             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
-       const Unique<VkShaderModule>            geomModule                              (createShaderModule             (vk, device, m_context.getBinaryCollection().get("geom"), 0u));
+       const Unique<VkShaderModule>            vertModule                              (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       const Unique<VkShaderModule>            geomModule                              (createShaderModule                                             (vk, device, m_context.getBinaryCollection().get("geom"), 0u));
 
-       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                (vk, device, *renderPass, m_imageExtent2D, DE_NULL));
-       const Unique<VkPipelineLayout>          pipelineLayout                  (makePipelineLayout             (vk, device));
-       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertModule, *geomModule, DE_NULL, m_imageExtent2D, 0u));
-       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
-       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer                                                (vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline                                   (vk, device, *pipelineLayout, *renderPass, *vertModule, *geomModule, DE_NULL, m_imageExtent2D, 0u));
+       const Unique<VkCommandPool>                     cmdPool                                 (createCommandPool                                              (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+       const Unique<VkCommandBuffer>           cmdBuffer                               (allocateCommandBuffer                                  (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
 
        const VkBufferCreateInfo                        tfBufCreateInfo                 = makeBufferCreateInfo(m_parameters.bufferSize, VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
        const Move<VkBuffer>                            tfBuf                                   = createBuffer(vk, device, &tfBufCreateInfo);
index cff8634..36202da 100644 (file)
@@ -85,18 +85,6 @@ rr::PrimitiveType mapVkPrimitiveToRRPrimitive(const vk::VkPrimitiveTopology& pri
        return de::getSizedArrayElement<vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST>(primitiveTypeTable, primitiveTopology);
 }
 
-Move<VkCommandPool> makeCommandPool (const DeviceInterface& vk, const VkDevice device, const deUint32 queueFamilyIndex)
-{
-       const VkCommandPoolCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,                     // VkStructureType                      sType;
-               DE_NULL,                                                                                        // const void*                          pNext;
-               VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,        // VkCommandPoolCreateFlags     flags;
-               queueFamilyIndex,                                                                       // deUint32                                     queueFamilyIndex;
-       };
-       return createCommandPool(vk, device, &info);
-}
-
 Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
 {
        const VkCommandBufferAllocateInfo info =
@@ -110,39 +98,6 @@ Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevi
        return allocateCommandBuffer(vk, device, &info);
 }
 
-Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface&              vk,
-                                                                                  const VkDevice                               device,
-                                                                                  const VkDescriptorSetLayout  descriptorSetLayout)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               1u,                                                                                                     // deUint32                                             setLayoutCount;
-               &descriptorSetLayout,                                                           // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
-Move<VkPipelineLayout> makePipelineLayoutWithoutDescriptors (const DeviceInterface&            vk,
-                                                                                                                        const VkDevice                         device)
-{
-       const VkPipelineLayoutCreateInfo info =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
-               DE_NULL,                                                                                        // const void*                                  pNext;
-               (VkPipelineLayoutCreateFlags)0,                                         // VkPipelineLayoutCreateFlags  flags;
-               0u,                                                                                                     // deUint32                                             setLayoutCount;
-               DE_NULL,                                                                                        // const VkDescriptorSetLayout* pSetLayouts;
-               0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
-               DE_NULL,                                                                                        // const VkPushConstantRange*   pPushConstantRanges;
-       };
-       return createPipelineLayout(vk, device, &info);
-}
-
 VkBufferImageCopy makeBufferImageCopy (const VkImageSubresourceLayers  subresourceLayers,
                                                                           const VkExtent3D                                     extent)
 {
@@ -225,7 +180,7 @@ tcu::ConstPixelBufferAccess ReferenceDrawContext::getColorPixels (void) const
                                                                                m_refImage.getAccess().getDataPtr());
 }
 
-VulkanDrawContext::VulkanDrawContext ( Context&                                context,
+VulkanDrawContext::VulkanDrawContext (Context&                         context,
                                                                          const DrawState&              drawState,
                                                                          const DrawCallData&   drawCallData,
                                                                          const VulkanProgram&  vulkanProgram)
@@ -297,10 +252,7 @@ VulkanDrawContext::VulkanDrawContext ( Context&                            context,
 
        // bind descriptor sets
        {
-               if (!vulkanProgram.descriptorSetLayout)
-                       m_pipelineLayout = makePipelineLayoutWithoutDescriptors(vk, device);
-               else
-                       m_pipelineLayout = makePipelineLayout(vk, device, vulkanProgram.descriptorSetLayout);
+               m_pipelineLayout = makePipelineLayout(vk, device, vulkanProgram.descriptorSetLayout);
        }
 
        // Renderpass
@@ -344,8 +296,8 @@ VulkanDrawContext::VulkanDrawContext ( Context&                             context,
                                VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL        // VkImageLayout        layout
                        },
                        {
-                               VK_ATTACHMENT_UNUSED,                                                           // deUint32         attachment;
-                               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout    layout;
+                               VK_ATTACHMENT_UNUSED,                                                           // deUint32                     attachment;
+                               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout        layout;
                        }
                };