Manages the compilation, configuration, and execution layout of a graphics pipeline.
More...
#include <VulkanPipeline.hpp>
|
| | VulkanPipeline ()=default |
| | Construct a new Vulkan Pipeline object.
|
| | ~VulkanPipeline () |
| | Destroy the Vulkan Pipeline object and release pipeline structures.
|
| | VulkanPipeline (const VulkanPipeline &)=delete |
| VulkanPipeline & | operator= (const VulkanPipeline &)=delete |
| void | create (VkDevice device, VkExtent2D swapchainExtent, VkRenderPass renderPass, const std::string &vertPath, const std::string &fragPath, const std::vector< VkDescriptorSetLayout > &descriptorSetLayouts={}) |
| | Configures vertex inputs, layouts, rasterization, color blending, and creates graphics pipeline.
|
| void | destroy () |
| | Safely destroys graphics pipeline and layouts.
|
| VkPipeline | get () const |
| | Gets compiled graphics pipeline.
|
| VkPipelineLayout | getLayout () const |
| | Gets layout representing pipeline descriptors and push constants.
|
|
| VkShaderModule | createShaderModule (const std::vector< char > &code) |
| | Wraps raw shader bytecode into a Vulkan module handle.
|
| std::vector< char > | loadFile (const std::string &filename) |
| | Helper to load binary files (SPIR-V shaders).
|
|
| VkDevice | device = VK_NULL_HANDLE |
| | Reference to logical device.
|
| VkPipeline | graphicsPipeline = VK_NULL_HANDLE |
| | Raw Vulkan pipeline object.
|
| VkPipelineLayout | pipelineLayout = VK_NULL_HANDLE |
| | Raw Vulkan pipeline layout object.
|
Manages the compilation, configuration, and execution layout of a graphics pipeline.
◆ VulkanPipeline() [1/2]
| VulkanPipeline::VulkanPipeline |
( |
| ) |
|
|
default |
Construct a new Vulkan Pipeline object.
◆ ~VulkanPipeline()
| VulkanPipeline::~VulkanPipeline |
( |
| ) |
|
Destroy the Vulkan Pipeline object and release pipeline structures.
Destroy the Vulkan Pipeline:: Vulkan Pipeline object.
◆ VulkanPipeline() [2/2]
◆ create()
| void VulkanPipeline::create |
( |
VkDevice | dev, |
|
|
VkExtent2D | swapchainExtent, |
|
|
VkRenderPass | renderPass, |
|
|
const std::string & | vertPath, |
|
|
const std::string & | fragPath, |
|
|
const std::vector< VkDescriptorSetLayout > & | descriptorSetLayouts = {} ) |
Configures vertex inputs, layouts, rasterization, color blending, and creates graphics pipeline.
Compiles shaders, configures pipeline attributes and compiles VkPipeline.
- Parameters
-
| device | Vulkan logical device context. |
| swapchainExtent | Framebuffer resolution dimensions. |
| renderPass | Render pass target context. |
| vertPath | Path to vertex shader bytecode. |
| fragPath | Path to fragment shader bytecode. |
| descriptorSetLayouts | Set layouts bound to pipeline layout. |
| dev | Logical device context. |
| swapchainExtent | Swapchain viewport dimensions. |
| renderPass | Target render pass index. |
| vertPath | Vertex shader path. |
| fragPath | Fragment shader path. |
| descriptorSetLayouts | Binding set layouts list. |
◆ createShaderModule()
| VkShaderModule VulkanPipeline::createShaderModule |
( |
const std::vector< char > & | code | ) |
|
|
private |
Wraps raw shader bytecode into a Vulkan module handle.
Instantiates a Vulkan shader module from bytecode.
- Parameters
-
- Returns
- Shader module handle.
- Parameters
-
- Returns
- VkShaderModule handle.
◆ destroy()
| void VulkanPipeline::destroy |
( |
| ) |
|
Safely destroys graphics pipeline and layouts.
Frees graphics pipeline and pipeline layout resources.
◆ get()
| VkPipeline VulkanPipeline::get |
( |
| ) |
const |
|
inline |
Gets compiled graphics pipeline.
- Returns
- VkPipeline handle.
◆ getLayout()
| VkPipelineLayout VulkanPipeline::getLayout |
( |
| ) |
const |
|
inline |
Gets layout representing pipeline descriptors and push constants.
- Returns
- VkPipelineLayout handle.
◆ loadFile()
| std::vector< char > VulkanPipeline::loadFile |
( |
const std::string & | filename | ) |
|
|
private |
Helper to load binary files (SPIR-V shaders).
Reads shader binary bytecode files.
- Parameters
-
- Returns
- Vector of bytes.
- Parameters
-
| filename | Shader binary file path. |
- Returns
- Byte array.
◆ operator=()
◆ device
| VkDevice VulkanPipeline::device = VK_NULL_HANDLE |
|
private |
Reference to logical device.
◆ graphicsPipeline
| VkPipeline VulkanPipeline::graphicsPipeline = VK_NULL_HANDLE |
|
private |
Raw Vulkan pipeline object.
◆ pipelineLayout
| VkPipelineLayout VulkanPipeline::pipelineLayout = VK_NULL_HANDLE |
|
private |
Raw Vulkan pipeline layout object.
The documentation for this class was generated from the following files: