VkGraphicsPipelineCreateInfo
has integer member subpass
.
My use case is creating a single pipeline object and use it with multiple subpasses. Each subpass has different color attachment.
Vulkan introduces the concept of sub-passes to subdivide a single render pass into separate logical phases. The benefit of using sub-passes over multiple render passes is that a GPU is able to perform various optimizations.
Vulkan is a new-generation graphics and compute API for high-efficiency, cross-platform access to GPUs. As the industry's only open standard modern GPU API, Vulkan is unique in enabling developers to write applications that are portable to multiple diverse platforms.
No. A pipeline is always built relative to a specific subpass of a specific render pass. It cannot be used in any other subpass:
The subpass index of the current render pass must be equal to the
subpass
member of theVkGraphicsPipelineCreateInfo
structure specified when creating theVkPipeline
currently bound toVK_PIPELINE_BIND_POINT_GRAPHICS
.
You will need to create multiple pipelines, one for each subpass you intend to use it with. The pipeline cache should make this efficient for implementations that don't really care much about this.
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