TheAtlasEngine
 
Loading...
Searching...
No Matches
atlas::vk::shader_resource_group Class Reference

resource group for loading shader sources that give you back VkShaderModule handles More...

#include <shader_resource_group.hpp>

Public Member Functions

 shader_resource_group (const VkDevice &p_device, const ::vk::shader_resource_info &p_info)
 constructs a new shader_resource_group
 
bool valid () const
 
void vertex_attributes (std::span< const ::vk::vertex_attribute > p_attributes)
 sets the vertex attributes with the shader modules that gets used by ::vk::pipeline (graphics pipeline)
 
std::vector<::vk::shader_handle > handles () const
 this gives you back the shader module handles along with each of their stages they have been compiled with
 
std::span< const VkVertexInputAttributeDescription > vertex_attributes () const
 
std::span< const VkVertexInputBindingDescription > vertex_bind_attributes () const
 
void destroy ()
 explicit cleanup to the VkShaderModule handles created with this particular resource group
 
bool reload_requested () const
 ideally used for requesting for reload
 

Detailed Description

resource group for loading shader sources that give you back VkShaderModule handles

Responsibility is to load stages of shader sources whether that be through precompiler .spv files or through shaderc runtime shader compilation

Responsibility is loading and streaming the amount of bytes from the compiled shader sources into the vulkan shader module handles

resource groups up the creation and management of vulkan shader modules.

Constructor & Destructor Documentation

◆ shader_resource_group()

atlas::vk::shader_resource_group::shader_resource_group ( const VkDevice &  p_device,
const ::vk::shader_resource_info &  p_info 
)

constructs a new shader_resource_group

Parameters
p_deviceis the logical device required to creating the vulkan shader module
p_infohas the properties such as specified shader sources to load/compile

Member Function Documentation

◆ handles()

std::vector<::vk::shader_handle > atlas::vk::shader_resource_group::handles ( ) const
inline

this gives you back the shader module handles along with each of their stages they have been compiled with

Returns the vector to retain the shader modules that are needed by the graphics pipeline.

It is required by vulkan specs the graphics pipeline to contain valid shader modules of the compiled shaders

Returns
vector<::vk::shader_handle>

◆ reload_requested()

bool atlas::vk::shader_resource_group::reload_requested ( ) const
inline

ideally used for requesting for reload

Planning to use this for invalidation when for runtime shader hot-reloading

Note
this is not used at the moment as shader runtime hot reloading is currently not supported.

◆ valid()

bool atlas::vk::shader_resource_group::valid ( ) const
inline
Returns
true if resources are valid, otherwise return false

◆ vertex_attributes() [1/2]

std::span< const VkVertexInputAttributeDescription > atlas::vk::shader_resource_group::vertex_attributes ( ) const
inline
Returns
span<const VkVertexInputAttributeDescription>

◆ vertex_attributes() [2/2]

void atlas::vk::shader_resource_group::vertex_attributes ( std::span< const ::vk::vertex_attribute >  p_attributes)

sets the vertex attributes with the shader modules that gets used by ::vk::pipeline (graphics pipeline)

Parameters
p_attributesis the high-level specifications for setting up vertex attributes that correspond with these shaders

◆ vertex_bind_attributes()

std::span< const VkVertexInputBindingDescription > atlas::vk::shader_resource_group::vertex_bind_attributes ( ) const
inline
Returns
span<const VkVertexInputBindingDescription>

The documentation for this class was generated from the following file: