}
std::vector<VkSubpassDescription> subpasses(1u + numSamples);
- std::vector<VkSubpassDependency> subpassDependencies(numSamples);
+ std::vector<VkSubpassDependency> subpassDependencies;
const VkSubpassDescription firstSubpassDesc =
{
0u, // VkDependencyFlags dependencyFlags;
};
- subpassDependencies[sampleNdx] = subpassDependency;
+ subpassDependencies.push_back(subpassDependency);
+ }
+ // now handle the very last sample pass, which must synchronize with all prior subpasses
+ for (deUint32 sampleNdx = 0u; sampleNdx < (numSamples - 1); ++sampleNdx)
+ {
+ const VkSubpassDependency subpassDependency =
+ {
+ 1u + sampleNdx, // uint32_t srcSubpass;
+ numSamples, // uint32_t dstSubpass;
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags srcStageMask;
+ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags dstStageMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, // VkAccessFlags dstAccessMask;
+ 0u, // VkDependencyFlags dependencyFlags;
+ };
+
+ subpassDependencies.push_back(subpassDependency);
}
const VkRenderPassCreateInfo renderPassInfo =
};
subpassDependencies.push_back(copySampleSubpassDependency);
}
+ // the very last sample pass must synchronize with all prior subpasses
+ for (size_t i = 0; i < (m_perSampleImages.size() - 1); ++i)
+ {
+ const VkSubpassDependency storeSubpassDependency =
+ {
+ 1u + static_cast<deUint32>(i), // deUint32 srcSubpass
+ static_cast<deUint32>(m_perSampleImages.size()), // deUint32 dstSubpass
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags srcStageMask
+ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags dstStageMask
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask
+ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, // VkAccessFlags dstAccessMask
+ 0u, // VkDependencyFlags dependencyFlags
+ };
+ subpassDependencies.push_back(storeSubpassDependency);
+ }
}
}
dependencies.push_back(dependency);
}
};
+ // the last subpass must synchronize with all prior subpasses
+ for (deUint32 splitSubpassIndex = 0; splitSubpassIndex < (splitSubpassCount - 1); splitSubpassIndex++)
+ {
+ const SubpassDep dependency // VkSubpassDependency || VkSubpassDependency2KHR
+ (
+ // || VkStructureType sType;
+ DE_NULL, // || const void* pNext;
+ splitSubpassIndex + 1, // deUint32 srcSubpass; || deUint32 srcSubpass;
+ splitSubpassCount, // deUint32 dstSubpass; || deUint32 dstSubpass;
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
+ | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, // VkPipelineStageFlags srcStageMask; || VkPipelineStageFlags srcStageMask;
+ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags dstStageMask; || VkPipelineStageFlags dstStageMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask; || VkAccessFlags srcAccessMask;
+ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, // VkAccessFlags dstAccessMask; || VkAccessFlags dstAccessMask;
+ VK_DEPENDENCY_BY_REGION_BIT, // VkDependencyFlags dependencyFlags; || VkDependencyFlags dependencyFlags;
+ 0u // || deInt32 viewOffset;
+ );
+ dependencies.push_back(dependency);
+ }
const RenderPassCreateInfo renderPassCreator // VkRenderPassCreateInfo || VkRenderPassCreateInfo2KHR
(
// VkStructureType sType; || VkStructureType sType;