SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::vk::VulkanShaderProgram Class Referencefinal

Vulkan implementation of a ShaderProgram. More...

#include <VulkanShaderProgram.h>

Inheritance diagram for spark::render::vk::VulkanShaderProgram:
spark::render::ShaderProgram< VulkanShaderModule > spark::render::IShaderProgram

Classes

struct  Impl
 

Public Member Functions

 VulkanShaderProgram (const VulkanDevice &device, std::vector< std::unique_ptr< VulkanShaderModule > > &&modules)
 Initializes a new Vulkan shader program with the given modules.
 
 VulkanShaderProgram (const VulkanShaderProgram &other)=delete
 
 VulkanShaderProgram (VulkanShaderProgram &&other) noexcept=delete
 
VulkanShaderProgramoperator= (const VulkanShaderProgram &other)=delete
 
VulkanShaderProgramoperator= (VulkanShaderProgram &&other) noexcept=delete
 
std::vector< const VulkanShaderModule * > shaders () const noexcept override
 Gets all shaders contained in this program.
 
std::shared_ptr< IPipelineLayoutreflectPipelineLayout () const override
 Uses shader reflexion to extract the pipeline layout from this shader program.
 
- Public Member Functions inherited from spark::render::IShaderProgram
std::vector< const IShaderModule * > shaders () const noexcept
 Gets all shaders contained in this program.
 

Additional Inherited Members

- Public Types inherited from spark::render::ShaderProgram< VulkanShaderModule >
using shader_module_type
 

Detailed Description

Vulkan implementation of a ShaderProgram.

Constructor & Destructor Documentation

◆ VulkanShaderProgram()

spark::render::vk::VulkanShaderProgram::VulkanShaderProgram ( const VulkanDevice & device,
std::vector< std::unique_ptr< VulkanShaderModule > > && modules )
explicit

Initializes a new Vulkan shader program with the given modules.

Parameters
deviceThe parent device of this shader program.
modulesThe modules used by this shader program.

Member Function Documentation

◆ reflectPipelineLayout()

std::shared_ptr< IPipelineLayout > spark::render::vk::VulkanShaderProgram::reflectPipelineLayout ( ) const
nodiscardoverridevirtual

Uses shader reflexion to extract the pipeline layout from this shader program.

Returns
The pipeline layout extracted from this shader program.

Shader reflection is not able to restore:

  • Immutable sampler states in Vulkan.
Note
This may not be available on all backends.

Implements spark::render::IShaderProgram.

◆ shaders()

std::vector< const VulkanShaderModule * > spark::render::vk::VulkanShaderProgram::shaders ( ) const
nodiscardoverridevirtualnoexcept

Gets all shaders contained in this program.

Returns
A std::vector of pointers to all shaders contained in this program.

Implements spark::render::ShaderProgram< VulkanShaderModule >.