Use common utility function for render pass creation
authorAri Suonpaa <ari.suonpaa@siru.fi>
Mon, 9 Apr 2018 05:30:30 +0000 (08:30 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 19 Apr 2018 10:31:13 +0000 (06:31 -0400)
Several tests are creating a simple render pass with only a maximum
of one color and depth/stencil buffer. This task is now done using
an utility function to promote code reusability.

Affects:

dEQP-VK.api.*
dEQP-VK.binding_model.shader_access.*
dEQP-VK.device_group.*
dEQP-VK.draw.shader_viewport_index.*
dEQP-VK.fragment_operations.*
dEQP-VK.geometry.*
dEQP-VK.memory.pipeline_barrier.*
dEQP-VK.pipeline.*
dEQP-VK.protected_memory.*
dEQP-VK.renderpass.sparserendertarget.*
dEQP-VK.robustness.*
dEQP-VK.sparse_resources.*
dEQP-VK.spirv_assembly.instruction.graphics.cross_stage.*
dEQP-VK.synchronization.*
dEQP-VK.tessellation.*
dEQP-VK.ubo.*
dEQP-VK.wsi.*

Components: Vulkan, Framework

VK-GL-CTS issue: 1109

Change-Id: Idc748adf44e0b015b6d0c234d20424f9aec2e9e0

57 files changed:
external/vulkancts/framework/vulkan/vkObjUtil.cpp
external/vulkancts/framework/vulkan/vkObjUtil.hpp
external/vulkancts/modules/vulkan/api/vktApiBufferViewAccessTests.cpp
external/vulkancts/modules/vulkan/api/vktApiCommandBuffersTests.cpp
external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.cpp
external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp
external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp
external/vulkancts/modules/vulkan/binding_model/vktBindingShaderAccessTests.cpp
external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp
external/vulkancts/modules/vulkan/draw/vktDrawShaderViewportIndexTests.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsEarlyFragmentTests.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsScissorMultiViewportTests.cpp
external/vulkancts/modules/vulkan/fragment_ops/vktFragmentOperationsScissorTests.cpp
external/vulkancts/modules/vulkan/geometry/vktGeometryBasicClass.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/memory/vktMemoryPipelineBarrierTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineBlendTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineCacheTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineEarlyDestroyTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineInputAssemblyTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelinePushConstantTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantUtil.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantUtil.hpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineStencilTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineTimestampTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineVertexInputTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemUtils.cpp
external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp
external/vulkancts/modules/vulkan/robustness/vktRobustnessUtil.cpp
external/vulkancts/modules/vulkan/sparse_resources/vktSparseResourcesBufferTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmCrossStageInterfaceTests.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/ubo/vktUniformBlockCase.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiDisplayTimingTests.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiIncrementalPresentTests.cpp

index 283db46..d6da77d 100644 (file)
@@ -283,4 +283,94 @@ Move<VkPipeline> makeGraphicsPipeline(const DeviceInterface&                                               vk,
        return createGraphicsPipeline(vk, device, DE_NULL, &pipelineCreateInfo);
 }
 
+Move<VkRenderPass> makeRenderPass (const DeviceInterface&              vk,
+                                                                  const VkDevice                               device,
+                                                                  const VkFormat                               colorFormat,
+                                                                  const VkFormat                               depthStencilFormat,
+                                                                  const VkAttachmentLoadOp             loadOperation,
+                                                                  const VkImageLayout                  finalLayoutColor,
+                                                                  const VkImageLayout                  finalLayoutDepthStencil,
+                                                                  const VkImageLayout                  subpassLayoutColor,
+                                                                  const VkImageLayout                  subpassLayoutDepthStencil)
+{
+       const bool                                                              hasColor                                                        = colorFormat != VK_FORMAT_UNDEFINED;
+       const bool                                                              hasDepthStencil                                         = depthStencilFormat != VK_FORMAT_UNDEFINED;
+       const VkImageLayout                                             initialLayoutColor                                      = loadOperation == VK_ATTACHMENT_LOAD_OP_LOAD ? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
+       const VkImageLayout                                             initialLayoutDepthStencil                       = loadOperation == VK_ATTACHMENT_LOAD_OP_LOAD ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
+
+       const VkAttachmentDescription                   colorAttachmentDescription                      =
+       {
+               (VkAttachmentDescriptionFlags)0,        // VkAttachmentDescriptionFlags    flags
+               colorFormat,                                            // VkFormat                        format
+               VK_SAMPLE_COUNT_1_BIT,                          // VkSampleCountFlagBits           samples
+               loadOperation,                                          // 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
+               initialLayoutColor,                                     // VkImageLayout                   initialLayout
+               finalLayoutColor                                        // VkImageLayout                   finalLayout
+       };
+
+       const VkAttachmentDescription                   depthStencilAttachmentDescription       =
+       {
+               (VkAttachmentDescriptionFlags)0,        // VkAttachmentDescriptionFlags    flags
+               depthStencilFormat,                                     // VkFormat                        format
+               VK_SAMPLE_COUNT_1_BIT,                          // VkSampleCountFlagBits           samples
+               loadOperation,                                          // VkAttachmentLoadOp              loadOp
+               VK_ATTACHMENT_STORE_OP_STORE,           // VkAttachmentStoreOp             storeOp
+               loadOperation,                                          // VkAttachmentLoadOp              stencilLoadOp
+               VK_ATTACHMENT_STORE_OP_STORE,           // VkAttachmentStoreOp             stencilStoreOp
+               initialLayoutDepthStencil,                      // VkImageLayout                   initialLayout
+               finalLayoutDepthStencil                         // VkImageLayout                   finalLayout
+       };
+
+       std::vector<VkAttachmentDescription>    attachmentDescriptions;
+
+       if (hasColor)
+               attachmentDescriptions.push_back(colorAttachmentDescription);
+       if (hasDepthStencil)
+               attachmentDescriptions.push_back(depthStencilAttachmentDescription);
+
+       const VkAttachmentReference                             colorAttachmentRef                                      =
+       {
+               0u,                                     // deUint32         attachment
+               subpassLayoutColor      // VkImageLayout    layout
+       };
+
+       const VkAttachmentReference                             depthStencilAttachmentRef                       =
+       {
+               hasColor ? 1u : 0u,                     // deUint32         attachment
+               subpassLayoutDepthStencil       // VkImageLayout    layout
+       };
+
+       const VkSubpassDescription                              subpassDescription                                      =
+       {
+               (VkSubpassDescriptionFlags)0,                                                   // VkSubpassDescriptionFlags       flags
+               VK_PIPELINE_BIND_POINT_GRAPHICS,                                                // VkPipelineBindPoint             pipelineBindPoint
+               0u,                                                                                                             // deUint32                        inputAttachmentCount
+               DE_NULL,                                                                                                // const VkAttachmentReference*    pInputAttachments
+               hasColor ? 1u : 0u,                                                                             // deUint32                        colorAttachmentCount
+               hasColor ? &colorAttachmentRef : DE_NULL,                               // const VkAttachmentReference*    pColorAttachments
+               DE_NULL,                                                                                                // const VkAttachmentReference*    pResolveAttachments
+               hasDepthStencil ? &depthStencilAttachmentRef : 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
+               (deUint32)attachmentDescriptions.size(),        // deUint32                          attachmentCount
+               &attachmentDescriptions[0],                                     // const VkAttachmentDescription*    pAttachments
+               1u,                                                                                     // deUint32                          subpassCount
+               &subpassDescription,                                            // const VkSubpassDescription*       pSubpasses
+               0u,                                                                                     // deUint32                          dependencyCount
+               DE_NULL                                                                         // const VkSubpassDependency*        pDependencies
+       };
+
+       return createRenderPass(vk, device, &renderPassInfo);
+}
+
 } // vk
index b0388dd..2aa4b12 100644 (file)
@@ -50,6 +50,16 @@ Move<VkPipeline> makeGraphicsPipeline(const DeviceInterface&                                         vk,
                                                                          const VkPipelineColorBlendStateCreateInfo*    colorBlendStateCreateInfo = DE_NULL,
                                                                          const VkPipelineDynamicStateCreateInfo*               dynamicStateCreateInfo = DE_NULL);
 
+Move<VkRenderPass> makeRenderPass (const DeviceInterface&              vk,
+                                                                  const VkDevice                               device,
+                                                                  const VkFormat                               colorFormat,
+                                                                  const VkFormat                               depthStencilFormat                      = VK_FORMAT_UNDEFINED,
+                                                                  const VkAttachmentLoadOp             loadOperation                           = VK_ATTACHMENT_LOAD_OP_CLEAR,
+                                                                  const VkImageLayout                  finalLayoutColor                        = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+                                                                  const VkImageLayout                  finalLayoutDepthStencil         = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
+                                                                  const VkImageLayout                  subpassLayoutColor                      = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+                                                                  const VkImageLayout                  subpassLayoutDepthStencil       = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL);
+
 } // vk
 
 #endif // _VKOBJUTIL_HPP
index c7088d4..f55e081 100644 (file)
@@ -203,55 +203,7 @@ BufferViewTestInstance::BufferViewTestInstance                                                     (Context&                                       context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription   colorAttachmentDescription              =
-               {
-                       0u,                                                                                                                     // VkAttachmentDescriptionFlags flags;
-                       m_colorFormat,                                                                                          // VkFormat                                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                                                                          // deUint32                                     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_COLOR_ATTACHMENT_OPTIMAL,                                       // VkImageLayout                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                                       // VkImageLayout                        finalLayout;
-               };
-
-               const VkAttachmentReference             colorAttachmentReference                =
-               {
-                       0u,                                                                                                                     // deUint32                                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                                        // VkImageLayout                        layout;
-               };
-
-               const VkSubpassDescription              subpassDescription                              =
-               {
-                       0u,                                                                                                                     // VkSubpassDescriptionFlags flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                                        // VkPipelineBindPoint          pipelineBindPoint;
-                       0u,                                                                                                                     // deUint32                                     inputCount;
-                       DE_NULL,                                                                                                        // const VkAttachmentReference* pInputAttachments;
-                       1u,                                                                                                                     // deUint32                                     colorCount;
-                       &colorAttachmentReference,                                                                      // const VkAttachmentReference* pColorAttachments;
-                       DE_NULL,                                                                                                        // const VkAttachmentReference* pResolveAttachments;
-                       DE_NULL,                                                                                                        // VkAttachmentReference        depthStencilAttachment;
-                       0u,                                                                                                                     // deUint32                                     preserveCount;
-                       DE_NULL                                                                                                         // const VkAttachmentReference* pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo    renderPassParams                                =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                                      // VkStructureType                      sType;
-                       DE_NULL,                                                                                                        // const void*                          pNext;
-                       (VkRenderPassCreateFlags)0,
-                       1u,                                                                                                                     // deUint32                                     attachmentCount;
-                       &colorAttachmentDescription,                                                            // const VkAttachmentDescription* pAttachments;
-                       1u,                                                                                                                     // deUint32                                     subpassCount;
-                       &subpassDescription,                                                                            // const VkSubpassDescription* pSubpasses;
-                       0u,                                                                                                                     // deUint32                                     dependencyCount;
-                       DE_NULL                                                                                                         // const VkSubpassDependency* pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat);
 
        // Create framebuffer
        {
index 1f54c97..f71c337 100644 (file)
@@ -29,6 +29,7 @@
 #include "vkMemUtil.hpp"
 #include "vkDeviceUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 #include "tcuTextureUtil.hpp"
 #include "vkImageUtil.hpp"
 #include "vkPrograms.hpp"
@@ -156,62 +157,7 @@ const VkRect2D                     CommandBufferRenderPassTestEnvironment::DEFAULT_IMAGE_AREA              =
 CommandBufferRenderPassTestEnvironment::CommandBufferRenderPassTestEnvironment(Context& context, VkCommandPoolCreateFlags commandPoolCreateFlags)
        : CommandBufferBareTestEnvironment<1>           (context, commandPoolCreateFlags)
 {
-       {
-               const VkAttachmentDescription                   colorAttDesc                    =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       DEFAULT_IMAGE_FORMAT,                                                           // 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 VkAttachmentDescription                   attachments[1]                  =
-               {
-                       colorAttDesc
-               };
-
-               const VkAttachmentReference                             colorAttRef                             =
-               {
-                       0u,                                                                                                     // deUint32                                                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        layout;
-               };
-
-               const VkSubpassDescription                              subpassDesc[1]                  =
-               {
-                       {
-                               0u,                                                                                             // VkSubpassDescriptionFlags            flags;
-                               VK_PIPELINE_BIND_POINT_GRAPHICS,                                // VkPipelineBindPoint                          pipelineBindPoint;
-                               0u,                                                                                             // deUint32                                                     inputAttachmentCount;
-                               DE_NULL,                                                                                // const VkAttachmentReference*         pInputAttachments;
-                               1u,                                                                                             // deUint32                                                     colorAttachmentCount;
-                               &colorAttRef,                                                                   // const VkAttachmentReference*         pColorAttachments;
-                               DE_NULL,                                                                                // const VkAttachmentReference*         pResolveAttachments;
-                               DE_NULL,                                                                                // const VkAttachmentReference*         depthStencilAttachment;
-                               0u,                                                                                             // deUint32                                                     preserveAttachmentCount;
-                               DE_NULL,                                                                                // const VkAttachmentReference*         pPreserveAttachments;
-                       }
-               };
-
-               const VkRenderPassCreateInfo                    renderPassCreateInfo    =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                                     // deUint32                                                     attachmentCount;
-                       attachments,                                                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       subpassDesc,                                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL,                                                                                        // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(m_vkd, m_device, &renderPassCreateInfo, DE_NULL);
-       }
+       m_renderPass = makeRenderPass(m_vkd, m_device, DEFAULT_IMAGE_FORMAT);
 
        {
                const VkImageCreateInfo                                 imageCreateInfo                 =
index e61f6b8..783e2ca 100644 (file)
@@ -160,55 +160,7 @@ tcu::TestStatus MemoryCommitmentTestInstance::iterate(void)
        colorAttachmentView = createImageView(vkd, device, &colorAttachmentViewParams);
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       VK_FORMAT_R32_UINT,                                                                     // 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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlags    flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                  pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                             inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pInputAttachments;
-                       1u,                                                                                                     // deUint32                                             colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference* pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pResolveAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                             preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference* pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                                     // deUint32                                                     attachmentCount;
-                       &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               renderPass = createRenderPass(vkd, device, &renderPassParams);
-       }
+       renderPass = makeRenderPass(vkd, device, VK_FORMAT_R32_UINT);
 
        // Create framebuffer
        {
index 8245a87..750b645 100644 (file)
@@ -34,6 +34,7 @@
 #include "vkPlatform.hpp"
 #include "vkStrUtil.hpp"
 #include "vkAllocationCallbackUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "tcuVector.hpp"
 #include "tcuResultCollector.hpp"
@@ -1570,72 +1571,7 @@ struct RenderPass
 
        static Move<VkRenderPass> create (const Environment& env, const Resources&, const Parameters&)
        {
-               const VkAttachmentDescription   attachments[]           =
-               {
-                       {
-                               (VkAttachmentDescriptionFlags)0,
-                               VK_FORMAT_R8G8B8A8_UNORM,
-                               VK_SAMPLE_COUNT_1_BIT,
-                               VK_ATTACHMENT_LOAD_OP_CLEAR,
-                               VK_ATTACHMENT_STORE_OP_STORE,
-                               VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-                               VK_ATTACHMENT_STORE_OP_DONT_CARE,
-                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
-                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
-                       },
-                       {
-                               (VkAttachmentDescriptionFlags)0,
-                               VK_FORMAT_D16_UNORM,
-                               VK_SAMPLE_COUNT_1_BIT,
-                               VK_ATTACHMENT_LOAD_OP_CLEAR,
-                               VK_ATTACHMENT_STORE_OP_DONT_CARE,
-                               VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-                               VK_ATTACHMENT_STORE_OP_DONT_CARE,
-                               VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
-                               VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
-                       }
-               };
-               const VkAttachmentReference             colorAttachments[]      =
-               {
-                       {
-                               0u,                                                                                     // attachment
-                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
-                       }
-               };
-               const VkAttachmentReference             dsAttachment            =
-               {
-                       1u,                                                                                     // attachment
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
-               };
-               const VkSubpassDescription              subpasses[]                     =
-               {
-                       {
-                               (VkSubpassDescriptionFlags)0,
-                               VK_PIPELINE_BIND_POINT_GRAPHICS,
-                               0u,                                                                                     // inputAttachmentCount
-                               DE_NULL,                                                                        // pInputAttachments
-                               DE_LENGTH_OF_ARRAY(colorAttachments),
-                               colorAttachments,
-                               DE_NULL,                                                                        // pResolveAttachments
-                               &dsAttachment,
-                               0u,                                                                                     // preserveAttachmentCount
-                               DE_NULL,                                                                        // pPreserveAttachments
-                       }
-               };
-               const VkRenderPassCreateInfo    renderPassInfo          =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
-                       DE_NULL,
-                       (VkRenderPassCreateFlags)0,
-                       DE_LENGTH_OF_ARRAY(attachments),
-                       attachments,
-                       DE_LENGTH_OF_ARRAY(subpasses),
-                       subpasses,
-                       0u,                                                                                             // dependencyCount
-                       DE_NULL                                                                                 // pDependencies
-               };
-
-               return createRenderPass(env.vkd, env.device, &renderPassInfo, env.allocationCallbacks);
+               return makeRenderPass(env.vkd, env.device, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_D16_UNORM);
        }
 };
 
index a2918de..70eaa84 100644 (file)
@@ -404,49 +404,7 @@ tcu::TestStatus renderTriangleTest (Context& context)
 
        VK_CHECK(vk.bindImageMemory(vkDevice, *image, imageMemory->getMemory(), imageMemory->getOffset()));
 
-       const VkAttachmentDescription                   colorAttDesc                    =
-       {
-               0u,                                                                                             // flags
-               VK_FORMAT_R8G8B8A8_UNORM,                                               // format
-               VK_SAMPLE_COUNT_1_BIT,                                                  // samples
-               VK_ATTACHMENT_LOAD_OP_CLEAR,                                    // loadOp
-               VK_ATTACHMENT_STORE_OP_STORE,                                   // storeOp
-               VK_ATTACHMENT_LOAD_OP_DONT_CARE,                                // stencilLoadOp
-               VK_ATTACHMENT_STORE_OP_DONT_CARE,                               // stencilStoreOp
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // initialLayout
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // finalLayout
-       };
-       const VkAttachmentReference                             colorAttRef                             =
-       {
-               0u,                                                                                             // attachment
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // layout
-       };
-       const VkSubpassDescription                              subpassDesc                             =
-       {
-               (VkSubpassDescriptionFlags)0u,                                  // flags
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                // pipelineBindPoint
-               0u,                                                                                             // inputAttachmentCount
-               DE_NULL,                                                                                // pInputAttachments
-               1u,                                                                                             // colorAttachmentCount
-               &colorAttRef,                                                                   // pColorAttachments
-               DE_NULL,                                                                                // pResolveAttachments
-               DE_NULL,                                                                                // depthStencilAttachment
-               0u,                                                                                             // preserveAttachmentCount
-               DE_NULL,                                                                                // pPreserveAttachments
-       };
-       const VkRenderPassCreateInfo                    renderPassParams                =
-       {
-               VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,              // sType
-               DE_NULL,                                                                                // pNext
-               0u,                                                                                             // flags
-               1u,                                                                                             // attachmentCount
-               &colorAttDesc,                                                                  // pAttachments
-               1u,                                                                                             // subpassCount
-               &subpassDesc,                                                                   // pSubpasses
-               0u,                                                                                             // dependencyCount
-               DE_NULL,                                                                                // pDependencies
-       };
-       const Unique<VkRenderPass>                              renderPass                              (createRenderPass(vk, vkDevice, &renderPassParams));
+       const Unique<VkRenderPass>                              renderPass                              (makeRenderPass(vk, vkDevice, VK_FORMAT_R8G8B8A8_UNORM));
 
        const VkImageViewCreateInfo                             colorAttViewParams              =
        {
index c527536..1ce05b6 100644 (file)
@@ -475,10 +475,6 @@ private:
                                                                                                                                                 const tcu::TextureFormat&      format,
                                                                                                                                                 vk::VkImage                            image);
 
-       static vk::Move<vk::VkRenderPass>               createRenderPass                        (const vk::DeviceInterface&     vki,
-                                                                                                                                                vk::VkDevice                           device,
-                                                                                                                                                const tcu::TextureFormat&      format);
-
        static vk::Move<vk::VkFramebuffer>              createFramebuffer                       (const vk::DeviceInterface&     vki,
                                                                                                                                                 vk::VkDevice                           device,
                                                                                                                                                 vk::VkRenderPass                       renderpass,
@@ -528,7 +524,7 @@ SingleTargetRenderInstance::SingleTargetRenderInstance (Context&                                                    context,
        , m_colorAttachmentMemory       (DE_NULL)
        , m_colorAttachmentImage        (createColorAttachment(m_vki, m_device, m_allocator, m_targetFormat, m_targetSize, &m_colorAttachmentMemory))
        , m_colorAttachmentView         (createColorAttachmentView(m_vki, m_device, m_targetFormat, *m_colorAttachmentImage))
-       , m_renderPass                          (createRenderPass(m_vki, m_device, m_targetFormat))
+       , m_renderPass                          (makeRenderPass(m_vki, m_device, vk::mapTextureFormat(m_targetFormat)))
        , m_framebuffer                         (createFramebuffer(m_vki, m_device, *m_renderPass, *m_colorAttachmentView, m_targetSize))
        , m_cmdPool                                     (createCommandPool(m_vki, m_device, context.getUniversalQueueFamilyIndex()))
        , m_firstIteration                      (true)
@@ -594,61 +590,6 @@ vk::Move<vk::VkImageView> SingleTargetRenderInstance::createColorAttachmentView
        return vk::createImageView(vki, device, &createInfo);
 }
 
-vk::Move<vk::VkRenderPass> SingleTargetRenderInstance::createRenderPass (const vk::DeviceInterface&            vki,
-                                                                                                                                                vk::VkDevice                                   device,
-                                                                                                                                                const tcu::TextureFormat&              format)
-{
-       const vk::VkAttachmentDescription       attachmentDescription   =
-       {
-               (vk::VkAttachmentDescriptionFlags)0,
-               vk::mapTextureFormat(format),                                   // format
-               vk::VK_SAMPLE_COUNT_1_BIT,                                              // samples
-               vk::VK_ATTACHMENT_LOAD_OP_CLEAR,                                // loadOp
-               vk::VK_ATTACHMENT_STORE_OP_STORE,                               // storeOp
-               vk::VK_ATTACHMENT_LOAD_OP_DONT_CARE,                    // stencilLoadOp
-               vk::VK_ATTACHMENT_STORE_OP_DONT_CARE,                   // stencilStoreOp
-               vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,   // initialLayout
-               vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,   // finalLayout
-       };
-       const vk::VkAttachmentReference         colorAttachment                 =
-       {
-               0u,                                                                                             // attachment
-               vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL    // layout
-       };
-       const vk::VkAttachmentReference         depthStencilAttachment  =
-       {
-               VK_ATTACHMENT_UNUSED,                                                   // attachment
-               vk::VK_IMAGE_LAYOUT_UNDEFINED                                   // layout
-       };
-       const vk::VkSubpassDescription          subpass                                 =
-       {
-               (vk::VkSubpassDescriptionFlags)0,
-               vk::VK_PIPELINE_BIND_POINT_GRAPHICS,                    // pipelineBindPoint
-               0u,                                                                                             // inputAttachmentCount
-               DE_NULL,                                                                                // pInputAttachments
-               1u,                                                                                             // colorAttachmentCount
-               &colorAttachment,                                                               // pColorAttachments
-               DE_NULL,                                                                                // pResolveAttachments
-               &depthStencilAttachment,                                                // pDepthStencilAttachment
-               0u,                                                                                             // preserveAttachmentCount
-               DE_NULL                                                                                 // pPreserveAttachments
-       };
-       const vk::VkRenderPassCreateInfo        renderPassCreateInfo    =
-       {
-               vk::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
-               DE_NULL,
-               (vk::VkRenderPassCreateFlags)0,
-               1u,                                                                                             // attachmentCount
-               &attachmentDescription,                                                 // pAttachments
-               1u,                                                                                             // subpassCount
-               &subpass,                                                                               // pSubpasses
-               0u,                                                                                             // dependencyCount
-               DE_NULL,                                                                                // pDependencies
-       };
-
-       return vk::createRenderPass(vki, device, &renderPassCreateInfo);
-}
-
 vk::Move<vk::VkFramebuffer> SingleTargetRenderInstance::createFramebuffer (const vk::DeviceInterface&  vki,
                                                                                                                                                   vk::VkDevice                                 device,
                                                                                                                                                   vk::VkRenderPass                             renderpass,
index 84a016c..d0a13a8 100755 (executable)
@@ -916,51 +916,7 @@ tcu::TestStatus DeviceGroupTestInstance::iterate (void)
                VK_CHECK(vk.bindImageMemory(*m_deviceGroup, *readImage, imageMemory.get(), 0));
 
                // Create renderpass
-               {
-                       const VkAttachmentDescription                   colorAttDesc =
-                       {
-                               0u,                                                                                             // flags
-                               colorFormat,                                                                    // format
-                               VK_SAMPLE_COUNT_1_BIT,                                                  // samples
-                               VK_ATTACHMENT_LOAD_OP_CLEAR,                                    // loadOp
-                               VK_ATTACHMENT_STORE_OP_STORE,                                   // storeOp
-                               VK_ATTACHMENT_LOAD_OP_DONT_CARE,                                // stencilLoadOp
-                               VK_ATTACHMENT_STORE_OP_DONT_CARE,                               // stencilStoreOp
-                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // initialLayout
-                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // finalLayout
-                       };
-                       const VkAttachmentReference                             colorAttRef =
-                       {
-                               0u,                                                                                             // attachment
-                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // layout
-                       };
-                       const VkSubpassDescription                              subpassDesc =
-                       {
-                               (VkSubpassDescriptionFlags)0u,                                  // flags
-                               VK_PIPELINE_BIND_POINT_GRAPHICS,                                // pipelineBindPoint
-                               0u,                                                                                             // inputAttachmentCount
-                               DE_NULL,                                                                                // pInputAttachments
-                               1u,                                                                                             // colorAttachmentCount
-                               &colorAttRef,                                                                   // pColorAttachments
-                               DE_NULL,                                                                                // pResolveAttachments
-                               DE_NULL,                                                                                // depthStencilAttachment
-                               0u,                                                                                             // preserveAttachmentCount
-                               DE_NULL,                                                                                // pPreserveAttachments
-                       };
-                       const VkRenderPassCreateInfo                    renderPassParams =
-                       {
-                               VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,              // sType
-                               DE_NULL,                                                                                // pNext
-                               0u,                                                                                             // flags
-                               1u,                                                                                             // attachmentCount
-                               &colorAttDesc,                                                                  // pAttachments
-                               1u,                                                                                             // subpassCount
-                               &subpassDesc,                                                                   // pSubpasses
-                               0u,                                                                                             // dependencyCount
-                               DE_NULL,                                                                                // pDependencies
-                       };
-                       renderPass = createRenderPass(vk, *m_deviceGroup, &renderPassParams);
-               }
+               renderPass = makeRenderPass(vk, *m_deviceGroup, colorFormat);
 
                // Create descriptors
                {
index 0d2b496..0687adb 100644 (file)
@@ -37,6 +37,7 @@
 #include "vkImageUtil.hpp"
 #include "vkQueryUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "tcuTestLog.hpp"
 #include "tcuVector.hpp"
@@ -188,60 +189,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkFormat format, const UVec2& size,
        return imageParams;
 }
 
-//! 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,
index 1640a1d..a3350e1 100644 (file)
@@ -86,82 +86,7 @@ Move<VkRenderPass> makeRenderPass (const DeviceInterface&    vk,
                                                                   const bool                           useDepthStencilAttachment,
                                                                   const VkFormat                       depthStencilFormat)
 {
-       const VkAttachmentDescription attachments[] =
-       {
-               // color
-               {
-                       (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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        finalLayout;
-               },
-               // depth/stencil
-               {
-                       (VkAttachmentDescriptionFlags)0,                                        // VkAttachmentDescriptionFlags         flags;
-                       depthStencilFormat,                                                                     // 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_CLEAR,                                            // VkAttachmentLoadOp                           stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_STORE,                                           // VkAttachmentStoreOp                          stencilStoreOp;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        finalLayout;
-               }
-       };
-
-       const VkAttachmentReference unusedAttachmentReference =
-       {
-               VK_ATTACHMENT_UNUSED,                                                           // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference colorAttachmentReference =
-       {
-               0u,                                                                                                     // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference depthStencilAttachmentReference =
-       {
-               1u,                                                                                                     // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL        // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference* pDepthStencilAttachment = (useDepthStencilAttachment ? &depthStencilAttachmentReference : &unusedAttachmentReference);
-
-       const VkSubpassDescription subpassDescription =
-       {
-               0u,                                                                                                     // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-               1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-               &colorAttachmentReference,                                                      // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-               pDepthStencilAttachment,                                                        // 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;
-               (useDepthStencilAttachment ? 2u : 1u),                          // deUint32                                                     attachmentCount;
-               attachments,                                                                            // const VkAttachmentDescription*       pAttachments;
-               1u,                                                                                                     // deUint32                                                     subpassCount;
-               &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-               0u,                                                                                                     // deUint32                                                     dependencyCount;
-               DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-       };
-
-       return createRenderPass(vk, device, &renderPassInfo);
+       return makeRenderPass(vk, device, colorFormat, useDepthStencilAttachment ? depthStencilFormat : VK_FORMAT_UNDEFINED);
 }
 
 Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
index c03cbc2..580194c 100644 (file)
@@ -93,60 +93,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkFormat format, const IVec2& size,
        return imageParams;
 }
 
-//! 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,
index c0cfab0..07a112c 100644 (file)
@@ -112,60 +112,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkFormat format, const IVec2& size,
        return imageParams;
 }
 
-//! 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,
index a7ef126..2a657f0 100644 (file)
@@ -84,59 +84,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkFormat format, const VkExtent3D s
        return imageParams;
 }
 
-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,
@@ -222,7 +169,7 @@ void draw (Context&                                 context,
        const Unique<VkShaderModule>    geometryModule                  (createShaderModule     (vk, device, context.getBinaryCollection().get("geom"), 0u));
        const Unique<VkShaderModule>    fragmentModule                  (createShaderModule     (vk, device, context.getBinaryCollection().get("frag"), 0u));
 
-       const Unique<VkRenderPass>              renderPass                              (makeRenderPass                 (vk, device, colorFormat));
+       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<VkPipelineLayout>  pipelineLayout                  (makePipelineLayout             (vk, device));
        const Unique<VkPipeline>                pipeline                                (makeGraphicsPipeline   (vk, device, *pipelineLayout, *renderPass, *vertexModule, *geometryModule, *fragmentModule, renderExtent));
index be711e5..f2617a0 100644 (file)
@@ -204,128 +204,11 @@ VkImageCreateInfo makeImageCreateInfo (const VkImageCreateFlags flags, const VkI
 
 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<VkRenderPass> makeRenderPass (const DeviceInterface&      vk,
-                                                                  const VkDevice                       device,
                                                                   const VkFormat                       colorFormat,
                                                                   const VkFormat                       dsFormat,
                                                                   const bool                           useDepthStencil)
 {
-       const VkAttachmentDescription   attachmentDescriptions[]        =
-       {
-               // Color attachment
-               {
-                       (VkAttachmentDescriptionFlags)0,                                        // VkAttachmentDescriptionFlags         flags;
-                       colorFormat,                                                                            // VkFormat                                                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                                                          // VkSampleCountFlagBits                        samples;
-                       VK_ATTACHMENT_LOAD_OP_LOAD,                                                     // 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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        finalLayout;
-               },
-               // Depth/stencil attachment
-               {
-                       (VkAttachmentDescriptionFlags)0,                                        // VkAttachmentDescriptionFlags         flags;
-                       dsFormat,                                                                                       // VkFormat                                                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                                                          // VkSampleCountFlagBits                        samples;
-                       VK_ATTACHMENT_LOAD_OP_LOAD,                                                     // VkAttachmentLoadOp                           loadOp;
-                       VK_ATTACHMENT_STORE_OP_STORE,                                           // VkAttachmentStoreOp                          storeOp;
-                       VK_ATTACHMENT_LOAD_OP_LOAD,                                                     // VkAttachmentLoadOp                           stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_STORE,                                           // VkAttachmentStoreOp                          stencilStoreOp;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        finalLayout;
-               }
-       };
-       const deUint32                                  attachmentDescriptionsCount     = useDepthStencil ? DE_LENGTH_OF_ARRAY(attachmentDescriptions) : 1u;
-       const VkAttachmentReference             colorAttachmentRef                      =
-       {
-               0u,                                                                                                             // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                                // VkImageLayout        layout;
-       };
-       const VkAttachmentReference             dsAttachmentRef                         =
-       {
-               1u,                                                                                                             // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_DEPTH_STENCIL_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;
-               useDepthStencil ? &dsAttachmentRef : 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;
-               attachmentDescriptionsCount,                                                    // deUint32                                                     attachmentCount;
-               attachmentDescriptions,                                                                 // const VkAttachmentDescription*       pAttachments;
-               1u,                                                                                                             // deUint32                                                     subpassCount;
-               &subpassDescription,                                                                    // const VkSubpassDescription*          pSubpasses;
-               0u,                                                                                                             // deUint32                                                     dependencyCount;
-               DE_NULL                                                                                                 // const VkSubpassDependency*           pDependencies;
-       };
-
-       return createRenderPass(vk, device, &renderPassInfo);
+       return vk::makeRenderPass(vk, device, colorFormat, useDepthStencil ? dsFormat : VK_FORMAT_UNDEFINED, VK_ATTACHMENT_LOAD_OP_LOAD);
 }
 
 
index 08bb1b5..f849906 100644 (file)
@@ -434,63 +434,6 @@ Move<VkDescriptorSet> makeDescriptorSet (const DeviceInterface&                    vk,
        return allocateDescriptorSet(vk, device, &info);
 }
 
-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_COLOR_ATTACHMENT_OPTIMAL,               // VkImageLayout                                        initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                // VkImageLayout                                        finalLayout;
-       };
-
-       const VkAttachmentReference colorAttachmentReference =
-       {
-               0u,                                                                                             // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference depthAttachmentReference =
-       {
-               VK_ATTACHMENT_UNUSED,                                                   // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_UNDEFINED                                               // VkImageLayout        layout;
-       };
-
-       const VkSubpassDescription subpassDescription =
-       {
-               (VkSubpassDescriptionFlags)0,                                   // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                             // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                // const VkAttachmentReference*         pInputAttachments;
-               1u,                                                                                             // deUint32                                                     colorAttachmentCount;
-               &colorAttachmentReference,                                              // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                // const VkAttachmentReference*         pResolveAttachments;
-               &depthAttachmentReference,                                              // 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<VkImageView> makeImageView (const DeviceInterface&                        vk,
                                                                 const VkDevice                                 vkDevice,
                                                                 const VkImage                                  image,
index 70ee65b..f48b573 100644 (file)
@@ -169,7 +169,6 @@ std::size_t                                         calcOutputVertices                      (const vk::VkPrimitiveTopology& inputType)
 vk::VkBufferCreateInfo                 makeBufferCreateInfo            (const vk::VkDeviceSize bufferSize, const vk::VkBufferUsageFlags usage);
 vk::VkImageCreateInfo                  makeImageCreateInfo                     (const tcu::IVec2& size, const vk::VkFormat format, const vk::VkImageUsageFlags usage, const deUint32 numArrayLayers = 1u);
 vk::Move<vk::VkDescriptorSet>  makeDescriptorSet                       (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkDescriptorPool descriptorPool, const vk::VkDescriptorSetLayout setLayout);
-vk::Move<vk::VkRenderPass>             makeRenderPass                          (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkFormat colorFormat);
 vk::Move<vk::VkImageView>              makeImageView                           (const vk::DeviceInterface& vk, const vk::VkDevice vkDevice, const vk::VkImage image, const vk::VkImageViewType viewType, const vk::VkFormat format, const vk::VkImageSubresourceRange subresourceRange);
 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);
index 301ae12..559613f 100644 (file)
@@ -4308,40 +4308,6 @@ void SubmitRenderPass::prepare (PrepareContext& context)
        const vk::VkDevice                                              device                  = context.getContext().getDevice();
        const vector<deUint32>&                                 queueFamilies   = context.getContext().getQueueFamilies();
 
-       const vk::VkAttachmentReference colorAttachments[]      =
-       {
-               { 0, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL }
-       };
-       const vk::VkSubpassDescription  subpass                         =
-       {
-               0u,
-               vk::VK_PIPELINE_BIND_POINT_GRAPHICS,
-
-               0u,
-               DE_NULL,
-
-               DE_LENGTH_OF_ARRAY(colorAttachments),
-               colorAttachments,
-               DE_NULL,
-               DE_NULL,
-               0u,
-               DE_NULL
-       };
-       const vk::VkAttachmentDescription attachment =
-       {
-               0u,
-               vk::VK_FORMAT_R8G8B8A8_UNORM,
-               vk::VK_SAMPLE_COUNT_1_BIT,
-
-               vk::VK_ATTACHMENT_LOAD_OP_CLEAR,
-               vk::VK_ATTACHMENT_STORE_OP_STORE,
-
-               vk::VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-               vk::VK_ATTACHMENT_STORE_OP_DONT_CARE,
-
-               vk::VK_IMAGE_LAYOUT_UNDEFINED,
-               vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
-       };
        {
                const vk::VkImageCreateInfo createInfo =
                {
@@ -4395,25 +4361,8 @@ void SubmitRenderPass::prepare (PrepareContext& context)
 
                m_colorTargetView = vk::createImageView(vkd, device, &createInfo);
        }
-       {
-               const vk::VkRenderPassCreateInfo createInfo =
-               {
-                       vk::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
-                       DE_NULL,
-                       0u,
-
-                       1u,
-                       &attachment,
-
-                       1u,
-                       &subpass,
-
-                       0,
-                       DE_NULL
-               };
 
-               m_renderPass = vk::createRenderPass(vkd, device, &createInfo);
-       }
+       m_renderPass = vk::makeRenderPass(vkd, device, vk::VK_FORMAT_R8G8B8A8_UNORM, vk::VK_FORMAT_UNDEFINED, vk::VK_ATTACHMENT_LOAD_OP_CLEAR, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 
        {
                const vk::VkImageView                           imageViews[]    =
index ced1f84..6b683fb 100644 (file)
@@ -39,7 +39,6 @@
 #include "vkRefUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
 #include "vkObjUtil.hpp"
 #include "tcuImageCompare.hpp"
 #include "tcuPlatform.hpp"
@@ -360,55 +359,7 @@ BlendTestInstance::BlendTestInstance (Context&                                                                     context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlag             flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                  pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                             inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pInputAttachments;
-                       1u,                                                                                                     // deUint32                                             colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference* pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pResolveAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                             preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference* pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                                     // deUint32                                                     attachmentCount;
-                       &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat);
 
        // Create framebuffer
        {
index a2eec9e..405b18e 100644 (file)
@@ -37,6 +37,7 @@
 #include "vkRefUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 #include "tcuImageCompare.hpp"
 #include "deUniquePtr.hpp"
 #include "deMemory.h"
@@ -759,80 +760,7 @@ GraphicsCacheTestInstance::GraphicsCacheTestInstance (Context&              cont
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                 // VkAttachmentDescriptionFlags    flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,           // VkImageLayout                   initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,           // VkImageLayout                   finalLayout;
-               };
-
-               const VkAttachmentDescription depthAttachmentDescription =
-               {
-                       0u,                                                 // VkAttachmentDescriptionFlags flags;
-                       m_depthFormat,                                      // VkFormat                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                              // VkSampleCountFlagBits        samples;
-                       VK_ATTACHMENT_LOAD_OP_CLEAR,                        // VkAttachmentLoadOp           loadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                   // VkAttachmentStoreOp          storeOp;
-                       VK_ATTACHMENT_LOAD_OP_DONT_CARE,                    // VkAttachmentLoadOp           stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                   // VkAttachmentStoreOp          stencilStoreOp;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,   // VkImageLayout                initialLayout;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,   // VkImageLayout                finalLayout;
-               };
-
-               const VkAttachmentDescription attachments[2] =
-               {
-                       colorAttachmentDescription,
-                       depthAttachmentDescription
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                 // deUint32         attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL            // VkImageLayout    layout;
-               };
-
-               const VkAttachmentReference depthAttachmentReference =
-               {
-                       1u,                                                 // deUint32         attachment;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL    // VkImageLayout    layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                 // VkSubpassDescriptionFlags        flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                    // VkPipelineBindPoint              pipelineBindPoint;
-                       0u,                                                 // deUint32                         inputAttachmentCount;
-                       DE_NULL,                                            // const VkAttachmentReference*     pInputAttachments;
-                       1u,                                                 // deUint32                         colorAttachmentCount;
-                       &colorAttachmentReference,                          // const VkAttachmentReference*     pColorAttachments;
-                       DE_NULL,                                            // const VkAttachmentReference*     pResolveAttachments;
-                       &depthAttachmentReference,                          // const VkAttachmentReference*     pDepthStencilAttachment;
-                       0u,                                                 // deUint32                         preserveAttachmentCount;
-                       DE_NULL                                             // const VkAttachmentReference*     pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,          // VkStructureType                  sType;
-                       DE_NULL,                                            // const void*                      pNext;
-                       0u,                                                 // VkRenderPassCreateFlags          flags;
-                       2u,                                                 // deUint32                         attachmentCount;
-                       attachments,                                        // const VkAttachmentDescription*   pAttachments;
-                       1u,                                                 // deUint32                         subpassCount;
-                       &subpassDescription,                                // const VkSubpassDescription*      pSubpasses;
-                       0u,                                                 // deUint32                         dependencyCount;
-                       DE_NULL                                             // const VkSubpassDependency*       pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat, m_depthFormat);
 
        const VkComponentMapping    ComponentMappingRGBA = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A};
        // Create color image
index 3c73405..9804c1f 100644 (file)
@@ -381,80 +381,7 @@ DepthTestInstance::DepthTestInstance (Context&                             context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentDescription depthAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_depthFormat,                                                                          // VkFormat                                                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                                                          // VkSampleCountFlagBits                        samples;
-                       VK_ATTACHMENT_LOAD_OP_CLEAR,                                            // VkAttachmentLoadOp                           loadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                                       // VkAttachmentStoreOp                          storeOp;
-                       VK_ATTACHMENT_LOAD_OP_DONT_CARE,                                        // VkAttachmentLoadOp                           stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                                       // VkAttachmentStoreOp                          stencilStoreOp;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentDescription attachments[2] =
-               {
-                       colorAttachmentDescription,
-                       depthAttachmentDescription
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkAttachmentReference depthAttachmentReference =
-               {
-                       1u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlags            flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-                       1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference*         pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-                       &depthAttachmentReference,                                                      // const VkAttachmentReference*         pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                                     preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference*         pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       2u,                                                                                                     // deUint32                                                     attachmentCount;
-                       attachments,                                                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat, m_depthFormat);
 
        // Create framebuffer
        {
index 4195114..ae95fa1 100644 (file)
@@ -29,6 +29,7 @@
 #include "vkMemUtil.hpp"
 #include "vkPrograms.hpp"
 #include "vkRefUtil.hpp"
+#include "vkObjUtil.hpp"
 #include "deUniquePtr.hpp"
 
 namespace vkt
@@ -91,53 +92,7 @@ tcu::TestStatus testEarlyDestroy (Context& context, bool usePipelineCache)
 
        const Unique<VkPipelineLayout>                                  pipelineLayout                                  (createPipelineLayout(vk, vkDevice, &pipelineLayoutCreateInfo, DE_NULL));
 
-       const VkAttachmentDescription                                   attachmentDescription                   =
-       {
-               0u,                                                                                     // VkAttachmentDescriptionFlags    flags;
-               VK_FORMAT_R8G8B8A8_UNORM,                                       // 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                                             color                                                   =
-       {
-               0u,                                                                                     // deUint32         attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL        // VkImageLayout    layout;
-       };
-
-       const VkSubpassDescription                                              subpassDescription                              =
-       {
-               0u,                                                                     // VkSubpassDescriptionFlags       flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,        // VkPipelineBindPoint             pipelineBindPoint;
-               0u,                                                                     // deUint32                        inputAttachmentCount;
-               DE_NULL,                                                        // const VkAttachmentReference*    pInputAttachments;
-               1u,                                                                     // deUint32                        colorAttachmentCount;
-               &color,                                                         // const VkAttachmentReference*    pColorAttachments;
-               DE_NULL,                                                        // const VkAttachmentReference*    pResolveAttachments;
-               DE_NULL,                                                        // const VkAttachmentReference*    pDepthStencilAttachment;
-               0u,                                                                     // deUint32                        preserveAttachmentCount;
-               DE_NULL                                                         // const deUint32*                 pPreserveAttachments;
-       };
-
-       const VkRenderPassCreateInfo                                    renderPassCreateInfo                    =
-       {
-               VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,      // VkStructureType                   sType;
-               DE_NULL,                                                                        // const void*                       pNext;
-               0u,                                                                                     // VkRenderPassCreateFlags           flags;
-               1u,                                                                                     // deUint32                          attachmentCount;
-               &attachmentDescription,                                         // const VkAttachmentDescription*    pAttachments;
-               1u,                                                                                     // deUint32                          subpassCount;
-               &subpassDescription,                                            // const VkSubpassDescription*       pSubpasses;
-               0u,                                                                                     // deUint32                          dependencyCount;
-               DE_NULL                                                                         // const VkSubpassDependency*        pDependencies;
-       };
-
-       const Unique<VkRenderPass>                                              renderPass                                              (createRenderPass(vk, vkDevice, &renderPassCreateInfo, DE_NULL));
+       const Unique<VkRenderPass>                                              renderPass                                              (makeRenderPass(vk, vkDevice, VK_FORMAT_R8G8B8A8_UNORM));
 
        const VkPipelineShaderStageCreateInfo                   stages[]                                                =
        {
index 0036109..ba760e2 100644 (file)
@@ -36,7 +36,6 @@
 #include "vkRefUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
 #include "vkObjUtil.hpp"
 #include "tcuImageCompare.hpp"
 #include "deMath.h"
@@ -993,55 +992,7 @@ InputAssemblyInstance::InputAssemblyInstance (Context&                                                     context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlags    flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                  pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                             inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pInputAttachments;
-                       1u,                                                                                                     // deUint32                                             colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference* pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pResolveAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                             preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference* pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                                     // deUint32                                                     attachmentCount;
-                       &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat);
 
        // Create framebuffer
        {
index c55d8f5..00a2f5f 100644 (file)
@@ -315,66 +315,7 @@ void PushConstantGraphicsTestInstance::init (void)
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_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 VkAttachmentDescription attachments[1] =
-               {
-                       colorAttachmentDescription
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL        // VkImageLayout        layout;
-               };
-
-               const VkAttachmentReference depthAttachmentReference =
-               {
-                       VK_ATTACHMENT_UNUSED,           // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_UNDEFINED       // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                     // VkSubpassDescriptionFlags            flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,        // VkPipelineBindPoint                          pipelineBindPoint;
-                       0u,                                                                     // deUint32                                                     inputAttachmentCount;
-                       DE_NULL,                                                        // const VkAttachmentReference*         pInputAttachments;
-                       1u,                                                                     // deUint32                                                     colorAttachmentCount;
-                       &colorAttachmentReference,                      // const VkAttachmentReference*         pColorAttachments;
-                       DE_NULL,                                                        // const VkAttachmentReference*         pResolveAttachments;
-                       &depthAttachmentReference,                      // const VkAttachmentReference*         pDepthStencilAttachment;
-                       0u,                                                                     // deUint32                                                     preserveAttachmentCount;
-                       DE_NULL                                                         // const VkAttachmentReference*         pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,      // VkStructureType                                      sType;
-                       DE_NULL,                                                                        // const void*                                          pNext;
-                       0u,                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                     // deUint32                                                     attachmentCount;
-                       attachments,                                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat);
 
        // Create framebuffer
        {
index 4f5f194..c7bb7aa 100644 (file)
@@ -38,6 +38,7 @@
 #include "vkTypeUtil.hpp"
 #include "vkImageUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deStringUtil.hpp"
index fc4ac08..4cd6268 100644 (file)
@@ -261,65 +261,6 @@ Move<VkPipeline> GraphicsPipelineBuilder::build (const DeviceInterface&    vk,
        return createGraphicsPipeline(vk, device, DE_NULL, &graphicsPipelineInfo);
 }
 
-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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-       };
-
-       const VkAttachmentReference colorAttachmentReference =
-       {
-               0u,                                                                                                     // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference depthAttachmentReference =
-       {
-               VK_ATTACHMENT_UNUSED,                                                           // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout        layout;
-       };
-
-       const VkSubpassDescription subpassDescription =
-       {
-               (VkSubpassDescriptionFlags)0,                                           // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-               1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-               &colorAttachmentReference,                                                      // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-               &depthAttachmentReference,                                                      // 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);
-}
-
 VkImageCreateInfo makeImageCreateInfo (const tcu::IVec2& size, const VkFormat format, const VkImageUsageFlags usage)
 {
        const VkImageCreateInfo imageInfo =
index f41458d..163e551 100644 (file)
@@ -70,7 +70,6 @@ enum FeatureFlagBits
 typedef deUint32 FeatureFlags;
 
 vk::VkImageCreateInfo                  makeImageCreateInfo             (const tcu::IVec2& size, const vk::VkFormat format, const vk::VkImageUsageFlags usage);
-vk::Move<vk::VkRenderPass>             makeRenderPass                  (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkFormat colorFormat);
 void                                                   requireFeatures                 (const vk::InstanceInterface& vki, const vk::VkPhysicalDevice physDevice, const FeatureFlags flags);
 
 // Ugly, brute-force replacement for the initializer list
index cba49b2..060cc7d 100644 (file)
@@ -419,80 +419,7 @@ StencilTestInstance::StencilTestInstance (Context&                                 context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                finalLayout;
-               };
-
-               const VkAttachmentDescription stencilAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags flags;
-                       m_stencilFormat,                                                                        // VkFormat                                             format;
-                       VK_SAMPLE_COUNT_1_BIT,                                                          // VkSampleCountFlagBits                samples;
-                       VK_ATTACHMENT_LOAD_OP_CLEAR,                                            // VkAttachmentLoadOp                   loadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                                       // VkAttachmentStoreOp                  storeOp;
-                       VK_ATTACHMENT_LOAD_OP_CLEAR,                                            // VkAttachmentLoadOp                   stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                                       // VkAttachmentStoreOp                  stencilStoreOp;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                initialLayout;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,       // VkImageLayout                                finalLayout;
-               };
-
-               const VkAttachmentDescription attachments[2] =
-               {
-                       colorAttachmentDescription,
-                       stencilAttachmentDescription
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkAttachmentReference stencilAttachmentReference =
-               {
-                       1u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlags    flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                  pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                             inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pInputAttachments;
-                       1u,                                                                                                     // deUint32                                             colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference* pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pResolveAttachments;
-                       &stencilAttachmentReference,                                            // const VkAttachmentReference* pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                             preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference* pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       2u,                                                                                                     // deUint32                                                     attachmentCount;
-                       attachments,                                                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat, m_stencilFormat);
 
        // Create framebuffer
        {
index 05f28ed..874515b 100644 (file)
@@ -910,81 +910,7 @@ void BasicGraphicsTestInstance::buildRenderPass(VkFormat colorFormat, VkFormat d
        const VkDevice              vkDevice = m_context.getDevice();
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                 // 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_COLOR_ATTACHMENT_OPTIMAL,           // VkImageLayout                   initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,           // VkImageLayout                   finalLayout;
-               };
-
-               const VkAttachmentDescription depthAttachmentDescription =
-               {
-                       0u,                                                 // VkAttachmentDescriptionFlags flags;
-                       depthFormat,                                        // VkFormat                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                              // VkSampleCountFlagBits        samples;
-                       VK_ATTACHMENT_LOAD_OP_CLEAR,                        // VkAttachmentLoadOp           loadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                   // VkAttachmentStoreOp          storeOp;
-                       VK_ATTACHMENT_LOAD_OP_DONT_CARE,                    // VkAttachmentLoadOp           stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                   // VkAttachmentStoreOp          stencilStoreOp;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,   // VkImageLayout                initialLayout;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,   // VkImageLayout                finalLayout;
-               };
-
-               const VkAttachmentDescription attachments[2] =
-               {
-                       colorAttachmentDescription,
-                       depthAttachmentDescription
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                 // deUint32         attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL            // VkImageLayout    layout;
-               };
-
-               const VkAttachmentReference depthAttachmentReference =
-               {
-                       1u,                                                 // deUint32         attachment;
-                       VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL    // VkImageLayout    layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                 // VkSubpassDescriptionFlags        flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                    // VkPipelineBindPoint              pipelineBindPoint;
-                       0u,                                                 // deUint32                         inputAttachmentCount;
-                       DE_NULL,                                            // const VkAttachmentReference*     pInputAttachments;
-                       1u,                                                 // deUint32                         colorAttachmentCount;
-                       &colorAttachmentReference,                          // const VkAttachmentReference*     pColorAttachments;
-                       DE_NULL,                                            // const VkAttachmentReference*     pResolveAttachments;
-                       &depthAttachmentReference,                          // const VkAttachmentReference*     pDepthStencilAttachment;
-                       0u,                                                 // deUint32                         preserveAttachmentCount;
-                       DE_NULL                                             // const VkAttachmentReference*     pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,          // VkStructureType                  sType;
-                       DE_NULL,                                            // const void*                      pNext;
-                       0u,                                                 // VkRenderPassCreateFlags          flags;
-                       2u,                                                 // deUint32                         attachmentCount;
-                       attachments,                                        // const VkAttachmentDescription*   pAttachments;
-                       1u,                                                 // deUint32                         subpassCount;
-                       &subpassDescription,                                // const VkSubpassDescription*      pSubpasses;
-                       0u,                                                 // deUint32                         dependencyCount;
-                       DE_NULL                                             // const VkSubpassDependency*       pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
-
+       m_renderPass = makeRenderPass(vk, vkDevice, colorFormat, depthFormat);
 }
 
 void BasicGraphicsTestInstance::buildFrameBuffer(tcu::UVec2 renderSize, VkFormat colorFormat, VkFormat depthFormat)
index 7c00678..6457b07 100644 (file)
@@ -38,7 +38,7 @@
 #include "vkRefUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
+#include "vkObjUtil.hpp"
 #include "tcuFloat.hpp"
 #include "tcuImageCompare.hpp"
 #include "deFloat16.h"
@@ -851,55 +851,7 @@ VertexInputInstance::VertexInputInstance (Context&                                                                                         context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlags    flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                  pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                             inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pInputAttachments;
-                       1u,                                                                                                     // deUint32                                             colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference* pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pResolveAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference* pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                             preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference* pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                                     // deUint32                                                     attachmentCount;
-                       &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, vkDevice, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat);
 
        // Create framebuffer
        {
index 8369900..db529f0 100644 (file)
@@ -31,6 +31,7 @@
 #include "vkTypeUtil.hpp"
 #include "vkDebugReportUtil.hpp"
 #include "vkApiVersion.hpp"
+#include "vkObjUtil.hpp"
 
 #include "vkPlatform.hpp"
 #include "vktProtectedMemContext.hpp"
@@ -384,53 +385,7 @@ vk::Move<vk::VkRenderPass> createRenderPass (ProtectedContext& context, vk::VkFo
        const vk::VkDevice                                      vkDevice                                = context.getDevice();
        const vk::DeviceInterface&                      vk                                              = context.getDeviceInterface();
 
-       const vk::VkAttachmentDescription       attachmentDescription   =
-       {
-               0u,                                                                                             // VkAttachmentDescriptorFlags  flags;
-               format,                                                                                 // VkFormat                                             format;
-               vk::VK_SAMPLE_COUNT_1_BIT,                                              // VkSampleCountFlagBits                samples;
-               vk::VK_ATTACHMENT_LOAD_OP_CLEAR,                                // VkAttachmentLoadOp                   loadOp;
-               vk::VK_ATTACHMENT_STORE_OP_STORE,                               // VkAttachmentStoreOp                  storeOp;
-               vk::VK_ATTACHMENT_LOAD_OP_DONT_CARE,                    // VkAttachmentLoadOp                   stencilLoadOp;
-               vk::VK_ATTACHMENT_STORE_OP_DONT_CARE,                   // VkAttachmentStoreOp                  stencilStoreOp;
-               vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,   // VkImageLayout                                initialLayout;
-               vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,   // VkImageLayout                                finalLayout;
-       };
-
-       const vk::VkAttachmentReference         attachmentReference             =
-       {
-               0u,                                                                                             // deUint32                     attachment;
-               vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL    // VkImageLayout        layout;
-       };
-
-       const vk::VkSubpassDescription          subpassDescription              =
-       {
-               0u,                                                                                     // VkSubpassDescriptionFlags    flags;
-               vk::VK_PIPELINE_BIND_POINT_GRAPHICS,            // VkPipelineBindPoint                  pipelineBindPoint;
-               0u,                                                                                     // deUint32                                             inputAttachmentCount;
-               DE_NULL,                                                                        // const VkAttachmentReference* pInputAttachments;
-               1u,                                                                                     // deUint32                                             colorAttachmentCount;
-               &attachmentReference,                                           // const VkAttachmentReference* pColorAttachments;
-               DE_NULL,                                                                        // const VkAttachmentReference* pResolveAttachments;
-               DE_NULL,                                                                        // const VkAttachmentReference* pDepthStencilAttachment;
-               0u,                                                                                     // deUint32                                             preserveAttachmentCount;
-               DE_NULL                                                                         // const VkAttachmentReference* pPreserveAttachments;
-       };
-
-       const vk::VkRenderPassCreateInfo        renderPassParams                =
-       {
-               vk::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,  // VkStructureType                                      sType;
-               DE_NULL,                                                                                // const void*                                          pNext;
-               0u,                                                                                             // VkRenderPassCreateFlags                      flags;
-               1u,                                                                                             // deUint32                                                     attachmentCount;
-               &attachmentDescription,                                                 // const VkAttachmentDescription*       pAttachments;
-               1u,                                                                                             // deUint32                                                     subpassCount;
-               &subpassDescription,                                                    // const VkSubpassDescription*          pSubpasses;
-               0u,                                                                                             // deUint32                                                     dependencyCount;
-               DE_NULL                                                                                 // const VkSubpassDependency*           pDependencies;
-       };
-
-       return vk::createRenderPass(vk, vkDevice, &renderPassParams);
+       return vk::makeRenderPass(vk, vkDevice, format);
 }
 
 vk::Move<vk::VkFramebuffer> createFramebuffer (ProtectedContext& context, deUint32 width, deUint32 height,
index 2d75d91..aa354f2 100644 (file)
@@ -193,62 +193,7 @@ Move<VkRenderPass> createRenderPass (const DeviceInterface&        vkd,
                                                                         VkDevice                               device,
                                                                         VkFormat                               dstFormat)
 {
-       const VkAttachmentReference             dstAttachmentRef        =
-       {
-               0u,
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
-       };
-       const VkAttachmentDescription   dstAttachment           =
-       {
-               0u,
-
-               dstFormat,
-               VK_SAMPLE_COUNT_1_BIT,
-
-               VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-               VK_ATTACHMENT_STORE_OP_STORE,
-
-               VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-               VK_ATTACHMENT_STORE_OP_DONT_CARE,
-
-               VK_IMAGE_LAYOUT_UNDEFINED,
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
-       };
-       const VkSubpassDescription              subpasses[]                     =
-       {
-               {
-                       (VkSubpassDescriptionFlags)0,
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,
-
-                       0u,
-                       DE_NULL,
-
-                       1u,
-                       &dstAttachmentRef,
-                       DE_NULL,
-
-                       DE_NULL,
-                       0u,
-                       DE_NULL
-               }
-       };
-       const VkRenderPassCreateInfo    createInfo                      =
-       {
-               VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
-               DE_NULL,
-               (VkRenderPassCreateFlags)0u,
-
-               1u,
-               &dstAttachment,
-
-               1u,
-               subpasses,
-
-               0u,
-               DE_NULL
-       };
-
-       return createRenderPass(vkd, device, &createInfo);
+       return makeRenderPass(vkd, device, dstFormat, VK_FORMAT_UNDEFINED, VK_ATTACHMENT_LOAD_OP_DONT_CARE);
 }
 
 Move<VkFramebuffer> createFramebuffer (const DeviceInterface&  vkd,
index ba0d03a..991740d 100644 (file)
@@ -30,7 +30,6 @@
 #include "vkRefUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
 #include "vkObjUtil.hpp"
 #include "deMath.h"
 #include <iomanip>
@@ -326,55 +325,7 @@ GraphicsEnvironment::GraphicsEnvironment (Context&                                 context,
        }
 
        // Create render pass
-       {
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
-                       m_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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                                                                                     // deUint32                     attachment;
-                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-               };
-
-               const VkSubpassDescription subpassDescription =
-               {
-                       0u,                                                                                                     // VkSubpassDescriptionFlags            flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-                       0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-                       DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-                       1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-                       &colorAttachmentReference,                                                      // const VkAttachmentReference*         pColorAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-                       DE_NULL,                                                                                        // const VkAttachmentReference*         pDepthStencilAttachment;
-                       0u,                                                                                                     // deUint32                                                     preserveAttachmentCount;
-                       DE_NULL                                                                                         // const VkAttachmentReference*         pPreserveAttachments;
-               };
-
-               const VkRenderPassCreateInfo renderPassParams =
-               {
-                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
-                       DE_NULL,                                                                                        // const void*                                          pNext;
-                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
-                       1u,                                                                                                     // deUint32                                                     attachmentCount;
-                       &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
-                       1u,                                                                                                     // deUint32                                                     subpassCount;
-                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
-                       0u,                                                                                                     // deUint32                                                     dependencyCount;
-                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
-               };
-
-               m_renderPass = createRenderPass(vk, m_device, &renderPassParams);
-       }
+       m_renderPass = makeRenderPass(vk, m_device, m_colorFormat);
 
        // Create framebuffer
        {
index 4e6e6f1..1eee317 100644 (file)
@@ -39,6 +39,7 @@
 #include "vkQueryUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "tcuTestLog.hpp"
 
@@ -270,59 +271,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkFormat format, const IVec2& size,
        return imageParams;
 }
 
-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,
index 6f2ead7..8673c54 100644 (file)
@@ -121,59 +121,6 @@ VkImageCreateInfo makeImageCreateInfo (const VkImageType imageType, const VkExte
        return imageInfo;
 }
 
-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_COLOR_ATTACHMENT_OPTIMAL,                                                       // VkImageLayout                                initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                                                        // VkImageLayout                                finalLayout;
-       };
-
-       const VkAttachmentReference                                     colorAttachmentReference        =
-       {
-               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;
-               &colorAttachmentReference,                                                                                      // 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<VkImageView> makeImageView (const DeviceInterface&                        vk,
                                                                 const VkDevice                                 device,
                                                                 const VkImage                                  image,
index 34a946b..dcd132a 100644 (file)
@@ -32,6 +32,7 @@
 #include "vkBuilderUtil.hpp"
 #include "vkImageUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "tcuResultCollector.hpp"
 
@@ -271,54 +272,6 @@ MovePtr<MultiQueues> createQueues (const Context& context, const VkQueueFlags& q
        return moveQueues;
 }
 
-Move<VkRenderPass>     createRenderPass (const Context& context, const VkDevice& device, const VkFormat& colorFormat)
-{
-       const DeviceInterface&                  vk                                                      = context.getDeviceInterface();
-       const VkAttachmentDescription   colorAttachmentDescription      =
-                                                                                                                               {
-                                                                                                                                       0u,                                                                                     // 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_COLOR_ATTACHMENT_OPTIMAL,       // VkImageLayout                                initialLayout;
-                                                                                                                                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,       // VkImageLayout                                finalLayout;
-                                                                                                                               };
-       const VkAttachmentReference             colorAttachmentReference        =
-                                                                                                                               {
-                                                                                                                                       0u,                                                                                     // deUint32                     attachment;
-                                                                                                                                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL        // VkImageLayout        layout;
-                                                                                                                               };
-       const VkSubpassDescription              subpassDescription                      =
-                                                                                                                               {
-                                                                                                                                       0u,                                                                     // VkSubpassDescriptionFlags    flags;
-                                                                                                                                       VK_PIPELINE_BIND_POINT_GRAPHICS,        // VkPipelineBindPoint                  pipelineBindPoint;
-                                                                                                                                       0u,                                                                     // deUint32                                             inputAttachmentCount;
-                                                                                                                                       DE_NULL,                                                        // const VkAttachmentReference* pInputAttachments;
-                                                                                                                                       1u,                                                                     // deUint32                                             colorAttachmentCount;
-                                                                                                                                       &colorAttachmentReference,                      // const VkAttachmentReference* pColorAttachments;
-                                                                                                                                       DE_NULL,                                                        // const VkAttachmentReference* pResolveAttachments;
-                                                                                                                                       DE_NULL,                                                        // const VkAttachmentReference* pDepthStencilAttachment;
-                                                                                                                                       0u,                                                                     // deUint32                                             preserveAttachmentCount;
-                                                                                                                                       DE_NULL                                                         // const VkAttachmentReference* pPreserveAttachments;
-                                                                                                                               };
-       const VkRenderPassCreateInfo    renderPassParams                        =
-                                                                                                                               {
-                                                                                                                                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,      // VkStructureType                                      sType;
-                                                                                                                                       DE_NULL,                                                                        // const void*                                          pNext;
-                                                                                                                                       0u,                                                                                     // 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, &renderPassParams);
-}
-
 TestStatus executeComputePipeline (const Context& context, const VkPipeline& pipeline, const VkPipelineLayout& pipelineLayout,
                                                                        const VkDescriptorSetLayout& descriptorSetLayout, MultiQueues& queues, const deUint32& shadersExecutions)
 {
@@ -782,7 +735,7 @@ public:
                MovePtr<MultiQueues>                                    queues                                  = createQueues (m_context, VK_QUEUE_GRAPHICS_BIT);
                const VkDevice                                                  device                                  = queues->getDevice();
                VkFormat                                                                colorFormat                             = VK_FORMAT_R8G8B8A8_UNORM;
-               Move<VkRenderPass>                                              renderPass                              = createRenderPass(m_context, device, colorFormat);
+               Move<VkRenderPass>                                              renderPass                              = makeRenderPass(vk, device, colorFormat);
                const Move<VkDescriptorSetLayout>               descriptorSetLayout             (DescriptorSetLayoutBuilder()
                                                                                                                                                        .addSingleBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_VERTEX_BIT)
                                                                                                                                                        .build(vk, device));
index 9997624..ee049b5 100644 (file)
@@ -33,6 +33,7 @@
 #include "vkImageUtil.hpp"
 #include "vkBuilderUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 #include "deUniquePtr.hpp"
 #include "tcuTestLog.hpp"
 #include "tcuTextureUtil.hpp"
@@ -2542,74 +2543,20 @@ public:
 
                m_attachmentView = makeImageView(vk, device, m_resource.getImage().handle, getImageViewType(m_resource.getImage().imageType), m_resource.getImage().format, m_resource.getImage().subresourceRange);
 
-               const VkAttachmentDescription colorAttachmentDescription =
-               {
-                       (VkAttachmentDescriptionFlags)0,        // VkAttachmentDescriptionFlags         flags;
-                       m_resource.getImage().format,           // VkFormat                                                     format;
-                       VK_SAMPLE_COUNT_1_BIT,                          // VkSampleCountFlagBits                        samples;
-                       VK_ATTACHMENT_LOAD_OP_DONT_CARE,        // VkAttachmentLoadOp                           loadOp;
-                       VK_ATTACHMENT_STORE_OP_STORE,           // VkAttachmentStoreOp                          storeOp;
-                       VK_ATTACHMENT_LOAD_OP_DONT_CARE,        // VkAttachmentLoadOp                           stencilLoadOp;
-                       VK_ATTACHMENT_STORE_OP_STORE,           // VkAttachmentStoreOp                          stencilStoreOp;
-                       VK_IMAGE_LAYOUT_UNDEFINED,                      // VkImageLayout                                        initialLayout;
-                       syncInfo.imageLayout                            // VkImageLayout                                        finalLayout;
-               };
-
-               const VkAttachmentReference colorAttachmentReference =
-               {
-                       0u,                                             // deUint32                     attachment;
-                       syncInfo.imageLayout    // VkImageLayout        layout;
-               };
-
-               const VkAttachmentReference depthStencilAttachmentReference =
-               {
-                       0u,                                             // deUint32                     attachment;
-                       syncInfo.imageLayout    // VkImageLayout        layout;
-               };
-
-               VkSubpassDescription subpassDescription =
-               {
-                       (VkSubpassDescriptionFlags)0,           // VkSubpassDescriptionFlags            flags;
-                       VK_PIPELINE_BIND_POINT_GRAPHICS,        // VkPipelineBindPoint                          pipelineBindPoint;
-                       0u,                                                                     // deUint32                                                     inputAttachmentCount;
-                       DE_NULL,                                                        // const VkAttachmentReference*         pInputAttachments;
-                       0u,                                                                     // deUint32                                                     colorAttachmentCount;
-                       DE_NULL,                                                        // const VkAttachmentReference*         pColorAttachments;
-                       DE_NULL,                                                        // const VkAttachmentReference*         pResolveAttachments;
-                       DE_NULL,                                                        // const VkAttachmentReference*         pDepthStencilAttachment;
-                       0u,                                                                     // deUint32                                                     preserveAttachmentCount;
-                       DE_NULL                                                         // const deUint32*                                      pPreserveAttachments;
-               };
-
                switch (m_resource.getImage().subresourceRange.aspectMask)
                {
                        case VK_IMAGE_ASPECT_COLOR_BIT:
-                               subpassDescription.colorAttachmentCount = 1u;
-                               subpassDescription.pColorAttachments    = &colorAttachmentReference;
+                               m_renderPass = makeRenderPass(vk, device, m_resource.getImage().format, VK_FORMAT_UNDEFINED, VK_ATTACHMENT_LOAD_OP_DONT_CARE, syncInfo.imageLayout);
                        break;
                        case VK_IMAGE_ASPECT_STENCIL_BIT:
                        case VK_IMAGE_ASPECT_DEPTH_BIT:
-                               subpassDescription.pDepthStencilAttachment = &depthStencilAttachmentReference;
+                               m_renderPass = makeRenderPass(vk, device, VK_FORMAT_UNDEFINED, m_resource.getImage().format, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, syncInfo.imageLayout);
                        break;
                        default:
                                DE_ASSERT(0);
                        break;
                }
 
-               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;
-               };
-
-               m_renderPass    = createRenderPass(vk, device, &renderPassInfo);
                m_frameBuffer   = makeFramebuffer(vk, device, *m_renderPass, *m_attachmentView, m_resource.getImage().extent.width, m_resource.getImage().extent.height, 1u);
        }
 
index f079aa7..54087af 100644 (file)
@@ -276,65 +276,6 @@ void beginRenderPassWithRasterizationDisabled (const DeviceInterface&      vk,
        beginRenderPass(vk, commandBuffer, renderPass, framebuffer, renderArea);
 }
 
-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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-       };
-
-       const VkAttachmentReference colorAttachmentReference =
-       {
-               0u,                                                                                                     // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference depthAttachmentReference =
-       {
-               VK_ATTACHMENT_UNUSED,                                                           // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout        layout;
-       };
-
-       const VkSubpassDescription subpassDescription =
-       {
-               (VkSubpassDescriptionFlags)0,                                           // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-               1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-               &colorAttachmentReference,                                                      // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-               &depthAttachmentReference,                                                      // 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<VkFramebuffer> makeFramebuffer (const DeviceInterface&            vk,
                                                                         const VkDevice                         device,
                                                                         const VkRenderPass                     renderPass,
index 528130e..7cfa5ae 100644 (file)
@@ -229,7 +229,6 @@ vk::Move<vk::VkDescriptorSet>       makeDescriptorSet                                                       (const vk::DeviceInterface
 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::VkRenderPass>             makeRenderPass                                                          (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkFormat colorFormat);
 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::VkImageView>              makeImageView                                                           (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkImage image, const vk::VkImageViewType viewType, const vk::VkFormat format, const vk::VkImageSubresourceRange subresourceRange);
 vk::VkBufferImageCopy                  makeBufferImageCopy                                                     (const vk::VkImageSubresourceLayers subresourceLayers, const vk::VkExtent3D extent);
index 426f582..3de78d2 100644 (file)
@@ -36,6 +36,7 @@
 #include "vkTypeUtil.hpp"
 #include "vkStrUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deStringUtil.hpp"
index 268c352..ac4729e 100644 (file)
@@ -35,6 +35,7 @@
 #include "vkImageUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deStringUtil.hpp"
index 8fa7c34..b4e55aa 100644 (file)
@@ -38,6 +38,7 @@
 #include "vkTypeUtil.hpp"
 #include "vkStrUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deStringUtil.hpp"
index 9a0ec72..5d83427 100644 (file)
@@ -39,6 +39,7 @@
 #include "vkBuilderUtil.hpp"
 #include "vkTypeUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deSharedPtr.hpp"
index 4d9c648..2cf8f3a 100644 (file)
@@ -253,65 +253,6 @@ void beginRenderPassWithRasterizationDisabled (const DeviceInterface&      vk,
        beginRenderPass(vk, commandBuffer, renderPass, framebuffer, makeRect2D(0, 0, 0u, 0u));
 }
 
-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_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
-       };
-
-       const VkAttachmentReference colorAttachmentReference =
-       {
-               0u,                                                                                                     // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
-       };
-
-       const VkAttachmentReference depthAttachmentReference =
-       {
-               VK_ATTACHMENT_UNUSED,                                                           // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_UNDEFINED                                                       // VkImageLayout        layout;
-       };
-
-       const VkSubpassDescription subpassDescription =
-       {
-               (VkSubpassDescriptionFlags)0,                                           // VkSubpassDescriptionFlags            flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                          pipelineBindPoint;
-               0u,                                                                                                     // deUint32                                                     inputAttachmentCount;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pInputAttachments;
-               1u,                                                                                                     // deUint32                                                     colorAttachmentCount;
-               &colorAttachmentReference,                                                      // const VkAttachmentReference*         pColorAttachments;
-               DE_NULL,                                                                                        // const VkAttachmentReference*         pResolveAttachments;
-               &depthAttachmentReference,                                                      // 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<VkRenderPass> makeRenderPassWithoutAttachments (const DeviceInterface&    vk,
                                                                                                         const VkDevice                 device)
 {
index 452898c..e61ae95 100644 (file)
@@ -214,7 +214,6 @@ vk::Move<vk::VkDescriptorSet>       makeDescriptorSet                                                       (const vk::DeviceInterface
 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>             makeRenderPass                                                          (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkFormat colorFormat);
 vk::Move<vk::VkRenderPass>             makeRenderPassWithoutAttachments                        (const vk::DeviceInterface& vk, const vk::VkDevice device);
 vk::Move<vk::VkFramebuffer>            makeFramebuffer                                                         (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass, const vk::VkImageView colorAttachment, const deUint32 width, const deUint32 height, const deUint32 layers);
 vk::Move<vk::VkFramebuffer>            makeFramebufferWithoutAttachments                       (const vk::DeviceInterface& vk, const vk::VkDevice device, const vk::VkRenderPass renderPass);
index 86c070f..bfde8ca 100644 (file)
@@ -1907,54 +1907,7 @@ vk::Move<VkRenderPass> UniformBlockCaseInstance::createRenderPass (vk::VkFormat
        const VkDevice                                  vkDevice                                = m_context.getDevice();
        const DeviceInterface&                  vk                                              = m_context.getDeviceInterface();
 
-       const VkAttachmentDescription   attachmentDescription   =
-       {
-               0u,                                                                                             // VkAttachmentDescriptorFlags  flags;
-               format,                                                                                 // 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_COLOR_ATTACHMENT_OPTIMAL,               // VkImageLayout                                initialLayout;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,               // VkImageLayout                                finalLayout;
-       };
-
-       const VkAttachmentReference             attachmentReference             =
-       {
-               0u,                                                                                     // deUint32                     attachment;
-               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL        // VkImageLayout        layout;
-       };
-
-
-       const VkSubpassDescription              subpassDescription              =
-       {
-               0u,                                                                                             // VkSubpassDescriptionFlags    flags;
-               VK_PIPELINE_BIND_POINT_GRAPHICS,                                // VkPipelineBindPoint                  pipelineBindPoint;
-               0u,                                                                                             // deUint32                                             inputAttachmentCount;
-               DE_NULL,                                                                                // const VkAttachmentReference* pInputAttachments;
-               1u,                                                                                             // deUint32                                             colorAttachmentCount;
-               &attachmentReference,                                                   // const VkAttachmentReference* pColorAttachments;
-               DE_NULL,                                                                                // const VkAttachmentReference* pResolveAttachments;
-               DE_NULL,                                                                                // const VkAttachmentReference* pDepthStencilAttachment;
-               0u,                                                                                             // deUint32                                             preserveAttachmentCount;
-               DE_NULL                                                                                 // const VkAttachmentReference* pPreserveAttachments;
-       };
-
-       const VkRenderPassCreateInfo    renderPassParams                =
-       {
-               VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,              // VkStructureType                                      sType;
-               DE_NULL,                                                                                // const void*                                          pNext;
-               0u,                                                                                             // VkRenderPassCreateFlags                      flags;
-               1u,                                                                                             // deUint32                                                     attachmentCount;
-               &attachmentDescription,                                                 // const VkAttachmentDescription*       pAttachments;
-               1u,                                                                                             // deUint32                                                     subpassCount;
-               &subpassDescription,                                                    // const VkSubpassDescription*          pSubpasses;
-               0u,                                                                                             // deUint32                                                     dependencyCount;
-               DE_NULL                                                                                 // const VkSubpassDependency*           pDependencies;
-       };
-
-       return vk::createRenderPass(vk, vkDevice, &renderPassParams);
+       return vk::makeRenderPass(vk, vkDevice, format);
 }
 
 vk::Move<VkFramebuffer> UniformBlockCaseInstance::createFramebuffer (vk::VkRenderPass renderPass, vk::VkImageView colorImageView) const
index cf1877c..2a6045c 100644 (file)
@@ -454,65 +454,7 @@ vk::Move<vk::VkRenderPass> createRenderPass (const vk::DeviceInterface&    vkd,
                                                                                         vk::VkDevice                           device,
                                                                                         vk::VkFormat                           format)
 {
-       const vk::VkAttachmentDescription       attachments[]                   =
-       {
-               {
-                       0u,
-                       format,
-                       vk::VK_SAMPLE_COUNT_1_BIT,
-
-                       vk::VK_ATTACHMENT_LOAD_OP_LOAD,
-                       vk::VK_ATTACHMENT_STORE_OP_STORE,
-
-                       vk::VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-                       vk::VK_ATTACHMENT_STORE_OP_DONT_CARE,
-
-                       vk::VK_IMAGE_LAYOUT_UNDEFINED,
-                       vk::VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
-               }
-       };
-       const vk::VkAttachmentReference         colorAttachmentRefs[]   =
-       {
-               {
-                       0u,
-                       vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
-               }
-       };
-       const vk::VkSubpassDescription          subpasses[]                             =
-       {
-               {
-                       0u,
-                       vk::VK_PIPELINE_BIND_POINT_GRAPHICS,
-                       0u,
-                       DE_NULL,
-
-                       DE_LENGTH_OF_ARRAY(colorAttachmentRefs),
-                       colorAttachmentRefs,
-                       DE_NULL,
-
-                       DE_NULL,
-                       0u,
-                       DE_NULL
-               }
-       };
-
-       const vk::VkRenderPassCreateInfo        createInfo                              =
-       {
-               vk::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
-               DE_NULL,
-               0u,
-
-               DE_LENGTH_OF_ARRAY(attachments),
-               attachments,
-
-               DE_LENGTH_OF_ARRAY(subpasses),
-               subpasses,
-
-               0u,
-               DE_NULL
-       };
-
-       return vk::createRenderPass(vkd, device, &createInfo);
+       return vk::makeRenderPass(vkd, device, format, vk::VK_FORMAT_UNDEFINED, vk::VK_ATTACHMENT_LOAD_OP_LOAD, vk::VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
 }
 
 vk::Move<vk::VkPipeline> createPipeline (const vk::DeviceInterface&    vkd,
index ad4c042..48c5bd3 100644 (file)
@@ -566,65 +566,7 @@ vk::Move<vk::VkRenderPass> createRenderPass (const vk::DeviceInterface&    vkd,
                                                                                         vk::VkDevice                           device,
                                                                                         vk::VkFormat                           format)
 {
-       const vk::VkAttachmentDescription       attachments[]                   =
-       {
-               {
-                       0u,
-                       format,
-                       vk::VK_SAMPLE_COUNT_1_BIT,
-
-                       vk::VK_ATTACHMENT_LOAD_OP_LOAD,
-                       vk::VK_ATTACHMENT_STORE_OP_STORE,
-
-                       vk::VK_ATTACHMENT_LOAD_OP_DONT_CARE,
-                       vk::VK_ATTACHMENT_STORE_OP_DONT_CARE,
-
-                       vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
-                       vk::VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
-               }
-       };
-       const vk::VkAttachmentReference         colorAttachmentRefs[]   =
-       {
-               {
-                       0u,
-                       vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
-               }
-       };
-       const vk::VkSubpassDescription          subpasses[]                             =
-       {
-               {
-                       0u,
-                       vk::VK_PIPELINE_BIND_POINT_GRAPHICS,
-                       0u,
-                       DE_NULL,
-
-                       DE_LENGTH_OF_ARRAY(colorAttachmentRefs),
-                       colorAttachmentRefs,
-                       DE_NULL,
-
-                       DE_NULL,
-                       0u,
-                       DE_NULL
-               }
-       };
-
-       const vk::VkRenderPassCreateInfo        createInfo                              =
-       {
-               vk::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
-               DE_NULL,
-               0u,
-
-               DE_LENGTH_OF_ARRAY(attachments),
-               attachments,
-
-               DE_LENGTH_OF_ARRAY(subpasses),
-               subpasses,
-
-               0u,
-               DE_NULL
-       };
-
-       return vk::createRenderPass(vkd, device, &createInfo);
+       return vk::makeRenderPass(vkd, device, format, vk::VK_FORMAT_UNDEFINED, vk::VK_ATTACHMENT_LOAD_OP_LOAD, vk::VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
 }
 
 vk::Move<vk::VkPipeline> createPipeline (const vk::DeviceInterface&    vkd,