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
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
}
// 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
{
#include "vkMemUtil.hpp"
#include "vkDeviceUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuTextureUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkPrograms.hpp"
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 =
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
{
#include "vkPlatform.hpp"
#include "vkStrUtil.hpp"
#include "vkAllocationCallbackUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuVector.hpp"
#include "tcuResultCollector.hpp"
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);
}
};
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 =
{
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,
, 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)
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,
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
{
#include "vkImageUtil.hpp"
#include "vkQueryUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuTestLog.hpp"
#include "tcuVector.hpp"
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,
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,
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,
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,
#include "vkQueryUtil.hpp"
#include "vkMemUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include <string>
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,
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));
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);
}
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,
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);
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 =
{
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[] =
#include "vkRefUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
#include "vkObjUtil.hpp"
#include "tcuImageCompare.hpp"
#include "tcuPlatform.hpp"
}
// 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
{
#include "vkRefUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuImageCompare.hpp"
#include "deUniquePtr.hpp"
#include "deMemory.h"
}
// 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
}
// 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
{
#include "vkMemUtil.hpp"
#include "vkPrograms.hpp"
#include "vkRefUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
namespace vkt
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[] =
{
#include "vkRefUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
#include "vkObjUtil.hpp"
#include "tcuImageCompare.hpp"
#include "deMath.h"
}
// 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
{
}
// 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
{
#include "vkTypeUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
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 =
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
}
// 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
{
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)
#include "vkRefUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuFloat.hpp"
#include "tcuImageCompare.hpp"
#include "deFloat16.h"
}
// 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
{
#include "vkTypeUtil.hpp"
#include "vkDebugReportUtil.hpp"
#include "vkApiVersion.hpp"
+#include "vkObjUtil.hpp"
#include "vkPlatform.hpp"
#include "vktProtectedMemContext.hpp"
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,
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,
#include "vkRefUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
-#include "vkTypeUtil.hpp"
#include "vkObjUtil.hpp"
#include "deMath.h"
#include <iomanip>
}
// 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
{
#include "vkQueryUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuTestLog.hpp"
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,
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,
#include "vkBuilderUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "tcuResultCollector.hpp"
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)
{
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));
#include "vkImageUtil.hpp"
#include "vkBuilderUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "tcuTestLog.hpp"
#include "tcuTextureUtil.hpp"
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);
}
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,
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);
#include "vkTypeUtil.hpp"
#include "vkStrUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
#include "vkBuilderUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "vkBuilderUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "vkTypeUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "vkTypeUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "vkImageUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkStrUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
#include "vkImageUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkStrUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deStringUtil.hpp"
#include "vkBuilderUtil.hpp"
#include "vkTypeUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
#include "deSharedPtr.hpp"
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)
{
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);
#include "vkTypeUtil.hpp"
#include "vkStrUtil.hpp"
#include "vkCmdUtil.hpp"
+#include "vkObjUtil.hpp"
#include "deUniquePtr.hpp"
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
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,
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,