Merge pull request #681 from krOoze/triangle_dependencies
Tweak Triangle subpass dependencies
This commit is contained in:
commit
78b25ebd71
3 changed files with 81 additions and 82 deletions
|
|
@ -182,8 +182,7 @@ public:
|
|||
std::string name = "vulkanExample";
|
||||
uint32_t apiVersion = VK_API_VERSION_1_0;
|
||||
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
VkImage image;
|
||||
VkDeviceMemory mem;
|
||||
VkImageView view;
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ public:
|
|||
} vertices;
|
||||
|
||||
// Index buffer
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
VkDeviceMemory memory;
|
||||
VkBuffer buffer;
|
||||
uint32_t count;
|
||||
|
|
@ -756,20 +755,21 @@ public:
|
|||
// Does the transition from final to initial layout
|
||||
dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL; // Producer of the dependency
|
||||
dependencies[0].dstSubpass = 0; // Consumer is our single subpass that will wait for the execution depdendency
|
||||
dependencies[0].srcStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||
dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
dependencies[0].srcAccessMask = VK_ACCESS_MEMORY_READ_BIT;
|
||||
dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
dependencies[0].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; // Match our pWaitDstStageMask when we vkQueueSubmit
|
||||
dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; // is a loadOp stage for color attachments
|
||||
dependencies[0].srcAccessMask = 0; // semaphore wait already does memory dependency for us
|
||||
dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; // is a loadOp CLEAR access mask for color attachments
|
||||
dependencies[0].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
|
||||
|
||||
// Second dependency at the end the renderpass
|
||||
// Does the transition from the initial to the final layout
|
||||
// Technically this is the same as the implicit subpass dependency, but we are gonna state it explicitly here
|
||||
dependencies[1].srcSubpass = 0; // Producer of the dependency is our single subpass
|
||||
dependencies[1].dstSubpass = VK_SUBPASS_EXTERNAL; // Consumer are all commands outside of the renderpass
|
||||
dependencies[1].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
||||
dependencies[1].dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||
dependencies[1].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
|
||||
dependencies[1].dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
|
||||
dependencies[1].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; // is a storeOp stage for color attachments
|
||||
dependencies[1].dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; // Do not block any subsequent work
|
||||
dependencies[1].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; // is a storeOp `STORE` access mask for color attachments
|
||||
dependencies[1].dstAccessMask = 0;
|
||||
dependencies[1].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
|
||||
|
||||
// Create the actual renderpass
|
||||
|
|
@ -873,7 +873,7 @@ public:
|
|||
rasterizationState.lineWidth = 1.0f;
|
||||
|
||||
// Color blend state describes how blend factors are calculated (if used)
|
||||
// We need one blend attachment state per color attachment (even if blending is not used
|
||||
// We need one blend attachment state per color attachment (even if blending is not used)
|
||||
VkPipelineColorBlendAttachmentState blendAttachmentState[1] = {};
|
||||
blendAttachmentState[0].colorWriteMask = 0xf;
|
||||
blendAttachmentState[0].blendEnable = VK_FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue