Suppose I have two VkPipelines and within a VkCommandBuffer I record...
vkCmdBeginRenderPass(cmd, /*...*/);
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline1);
vkCmdDraw(cmd, /*...*/); // [1]
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline2);
vkCmdDraw(cmd, /*...*/); // [2]
vkCmdEndRenderPass(cmd);
When the command buffer is queued and executed, will it be as-if the rendering operations to the framebuffer attachments of [1] are fully realized before [2] starts executing.
ie Will [2] draw over [1] ?
Most stages in Vulkan execute in an arbitrary order relative to each other. However, rasterization order is respected with regard to framebuffer attachment processes within a subpass (between subpasses, you have to use subpass dependencies, and outside of the renderpass, you'll need either external subpass dependencies or a barrier). Each primitive is ordered relative to each other primitive, and the implementation must respect rasterization order when doing reordering.
The stages that follow rasterization order atomically include depth/stencil test, blending, write masking, and the like, but they do not include the fragment shader itself. That is, FS outputs have to go through rasterization order, but FS side effects (ie: writes via image store or SSBOs) do not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With