return createCommandPool(vk, device, &info);
}
-Move<VkCommandBuffer> makeCommandBuffer (const DeviceInterface& vk, const VkDevice device, const VkCommandPool commandPool)
-{
- const VkCommandBufferAllocateInfo info =
- {
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- commandPool, // VkCommandPool commandPool;
- VK_COMMAND_BUFFER_LEVEL_PRIMARY, // VkCommandBufferLevel level;
- 1u, // deUint32 commandBufferCount;
- };
- return allocateCommandBuffer(vk, device, &info);
-}
Move<VkDescriptorSet> makeDescriptorSet (const DeviceInterface& vk,
const VkDevice device,
const VkQueue queue,
const VkCommandBuffer commandBuffer)
{
- const VkFenceCreateInfo fenceInfo =
- {
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
- (VkFenceCreateFlags)0, // VkFenceCreateFlags flags;
- };
- const Unique<VkFence> fence(createFence(vk, device, &fenceInfo));
+ const Unique<VkFence> fence(createFence(vk, device));
const VkSubmitInfo submitInfo =
{
renderPass, // VkRenderPass renderPass;
0u, // uint32_t attachmentCount;
DE_NULL, // const VkImageView* pAttachments;
- 0u, // uint32_t width;
- 0u, // uint32_t height;
- 0u, // uint32_t layers;
+ 1u, // uint32_t width;
+ 1u, // uint32_t height;
+ 1u, // uint32_t layers;
};
return createFramebuffer(vk, device, &framebufferInfo);
VK_FALSE, // VkBool32 primitiveRestartEnable;
};
+ const VkPipelineTessellationDomainOriginStateCreateInfoKHR tessellationDomainOriginStateInfo =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR,
+ DE_NULL,
+ (!m_tessellationDomainOrigin ? VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT_KHR : *m_tessellationDomainOrigin)
+ };
const VkPipelineTessellationStateCreateInfo pipelineTessellationStateInfo =
{
VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
+ (!m_tessellationDomainOrigin ? DE_NULL : &tessellationDomainOriginStateInfo),
(VkPipelineTessellationStateCreateFlags)0, // VkPipelineTessellationStateCreateFlags flags;
m_patchControlPoints, // uint32_t patchControlPoints;
};
makeExtent2D(m_renderSize.x(), m_renderSize.y()),
};
+ const bool haveRenderSize = m_renderSize.x() > 0 && m_renderSize.y() > 0;
+
const VkPipelineViewportStateCreateInfo pipelineViewportStateInfo =
{
VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, // VkStructureType sType;
DE_NULL, // const void* pNext;
(VkPipelineViewportStateCreateFlags)0, // VkPipelineViewportStateCreateFlags flags;
1u, // uint32_t viewportCount;
- &viewport, // const VkViewport* pViewports;
+ haveRenderSize ? &viewport : DE_NULL, // const VkViewport* pViewports;
1u, // uint32_t scissorCount;
- &scissor, // const VkRect2D* pScissors;
+ haveRenderSize ? &scissor : DE_NULL, // const VkRect2D* pScissors;
};
const bool isRasterizationDisabled = ((m_shaderStageFlags & VK_SHADER_STAGE_FRAGMENT_BIT) == 0);
{ 0.0f, 0.0f, 0.0f, 0.0f }, // float blendConstants[4];
};
+ std::vector<VkDynamicState> dynamicStates;
+ if (!haveRenderSize)
+ {
+ dynamicStates.push_back(VK_DYNAMIC_STATE_VIEWPORT);
+ dynamicStates.push_back(VK_DYNAMIC_STATE_SCISSOR);
+ }
+
+ const VkPipelineDynamicStateCreateInfo pipelineDynamicStateInfo =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0, // VkPipelineDynamicStateCreateFlags flags;
+ static_cast<deUint32>(dynamicStates.size()), // uint32_t dynamicStateCount;
+ (dynamicStates.empty() ? DE_NULL : &dynamicStates[0]), // const VkDynamicState* pDynamicStates;
+ };
+
const VkGraphicsPipelineCreateInfo graphicsPipelineInfo =
{
VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, // VkStructureType sType;
(isRasterizationDisabled ? DE_NULL : &pipelineMultisampleStateInfo), // const VkPipelineMultisampleStateCreateInfo* pMultisampleState;
(isRasterizationDisabled ? DE_NULL : &pipelineDepthStencilStateInfo), // const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState;
(isRasterizationDisabled ? DE_NULL : &pipelineColorBlendStateInfo), // const VkPipelineColorBlendStateCreateInfo* pColorBlendState;
- DE_NULL, // const VkPipelineDynamicStateCreateInfo* pDynamicState;
+ &pipelineDynamicStateInfo, // const VkPipelineDynamicStateCreateInfo* pDynamicState;
pipelineLayout, // VkPipelineLayout layout;
renderPass, // VkRenderPass renderPass;
0u, // deUint32 subpass;