vpr::GraphicsPipeline class

The GraphicsPipeline object is an RAII wrapper around a vkGraphicsPipeline object, handling construction and destruction alone.

The GraphicsPipelineInfo structure is, truthfully, much more important and much complex than this class is.

Public static functions

static void CreateMultiple(const VkDevice& device, const VkGraphicsPipelineCreateInfo* infos, const size_t num_infos, VkPipelineCache cache, GraphicsPipeline** dest_array)
In the case of pipelines that are derivatives of each other, or that share a singular pipeline cache, using this method can be more efficient.

Constructors, destructors, conversion operators

GraphicsPipeline(const VkDevice& parent, VkGraphicsPipelineCreateInfo create_info, VkPipeline handle)
One-step initialization constructor for this object.
GraphicsPipeline(const VkDevice& parent)
Two-step initialization constructor for this object.

Public functions

void Init(VkGraphicsPipelineCreateInfo& create_info, const VkPipelineCache& cache = VK_NULL_HANDLE)
Fully initializes the object - attaches a PipelineCache if a handle is provided.
void Destroy()
Will destroy the underlying pipeline, and can't be used again until Init() is called once more.

Function documentation

static void vpr::GraphicsPipeline::CreateMultiple(const VkDevice& device, const VkGraphicsPipelineCreateInfo* infos, const size_t num_infos, VkPipelineCache cache, GraphicsPipeline** dest_array)

In the case of pipelines that are derivatives of each other, or that share a singular pipeline cache, using this method can be more efficient.

Parameters
device
infos Array of pipeline infos to use - if possible, make sure to set the basePipelineIndex bits and the appropriate pipeline derivative flags!
num_infos
cache
dest_array Array of POINTERS that will have values written to by calling "new GraphicsPipeline(dvc, info, handle)"

vpr::GraphicsPipeline::GraphicsPipeline(const VkDevice& parent, VkGraphicsPipelineCreateInfo create_info, VkPipeline handle)

One-step initialization constructor for this object.

Fully ready to use when created with this constructor. Assumes object has been already created, but keeps create_info around in case it might be needed.

vpr::GraphicsPipeline::GraphicsPipeline(const VkDevice& parent)

Two-step initialization constructor for this object.

Requires a further call to Init() to be useable.