VkDevice device,
VkFormat srcFormat,
VkFormat dstFormat,
- deUint32 sampleCount)
+ deUint32 sampleCount,
+ RenderPassType renderPassType)
{
const VkSampleCountFlagBits samples (sampleCountBitFromSampleCount(sampleCount));
+ const VkImageAspectFlagBits aspectFlag ((renderPassType == RENDERPASS_TYPE_RENDERPASS2) ? VK_IMAGE_ASPECT_COLOR_BIT :
+ static_cast<VkImageAspectFlagBits>(0u));
const AttachmentRef srcAttachmentRef // VkAttachmentReference || VkAttachmentReference2KHR
(
// || VkStructureType sType;
DE_NULL, // || const void* pNext;
0u, // deUint32 attachment; || deUint32 attachment;
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, // VkImageLayout layout; || VkImageLayout layout;
- 0u // || VkImageAspectFlags aspectMask;
+ aspectFlag // || VkImageAspectFlags aspectMask;
);
const AttachmentRef dstAttachmentRef // VkAttachmentReference || VkAttachmentReference2KHR
(
switch (renderPassType)
{
case RENDERPASS_TYPE_LEGACY:
- return createRenderPass<AttachmentDescription1, AttachmentReference1, SubpassDescription1, SubpassDependency1, RenderPassCreateInfo1>(vkd, device, srcFormat, dstFormat, sampleCount);
+ return createRenderPass<AttachmentDescription1, AttachmentReference1, SubpassDescription1, SubpassDependency1, RenderPassCreateInfo1>(vkd, device, srcFormat, dstFormat, sampleCount, renderPassType);
case RENDERPASS_TYPE_RENDERPASS2:
- return createRenderPass<AttachmentDescription2, AttachmentReference2, SubpassDescription2, SubpassDependency2, RenderPassCreateInfo2>(vkd, device, srcFormat, dstFormat, sampleCount);
+ return createRenderPass<AttachmentDescription2, AttachmentReference2, SubpassDescription2, SubpassDependency2, RenderPassCreateInfo2>(vkd, device, srcFormat, dstFormat, sampleCount, renderPassType);
default:
TCU_THROW(InternalError, "Impossible");
}
lastUseOfAttachment[inputAttachmentIndex] = just(subpassIndex);
- inputAttachmentReferences.push_back(AttachmentReference((deUint32)subpassInputAttachments[inputAttachmentNdx], VK_IMAGE_LAYOUT_GENERAL));
+ VkImageAspectFlags aspect = 0u;
+ if (testConfigExternal.renderPassType == RENDERPASS_TYPE_RENDERPASS2)
+ {
+ bool col = colorAttachments.find(inputAttachmentIndex) != colorAttachments.end();
+ aspect = col ? VK_IMAGE_ASPECT_COLOR_BIT : VK_IMAGE_ASPECT_DEPTH_BIT;
+ }
+ inputAttachmentReferences.push_back(AttachmentReference((deUint32)subpassInputAttachments[inputAttachmentNdx], VK_IMAGE_LAYOUT_GENERAL, aspect));
}
}
for (size_t subpassNdx = 1; subpassNdx < attachmentCount; subpassNdx++)
{
+ const VkImageAspectFlags inputAttachmentAspectMask = (testConfigExternal.renderPassType == RENDERPASS_TYPE_RENDERPASS2) ? VK_IMAGE_ASPECT_COLOR_BIT : static_cast<VkImageAspectFlagBits>(0);
subpasses.push_back(Subpass(VK_PIPELINE_BIND_POINT_GRAPHICS, 0u,
- vector<AttachmentReference>(1, AttachmentReference((deUint32)(subpassNdx - 1), VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)),
+ vector<AttachmentReference>(1, AttachmentReference((deUint32)(subpassNdx - 1), VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, inputAttachmentAspectMask)),
vector<AttachmentReference>(1, AttachmentReference((deUint32)(subpassNdx), rng.choose<VkImageLayout>(DE_ARRAY_BEGIN(subpassLayoutsColor), DE_ARRAY_END(subpassLayoutsColor)))),
vector<AttachmentReference>(),
AttachmentReference(VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_GENERAL),