The JEShaderManger class.
More...
#include <ShaderManager.h>
|
| JEShaderManager () |
| Default constructor. More...
|
|
| JEShaderManager (VkDevice device) |
| Primary constructor. More...
|
|
| ~JEShaderManager ()=default |
| Destructor (default). More...
|
|
uint32_t | CreateShader (VkDevice device, VkPhysicalDevice physicalDevice, const JEVulkanSwapChain &swapChain, const MaterialComponent &materialComponent, uint32_t numSourceTextures, VkRenderPass renderPass, const std::string &vertPath, const std::string &fragPath, PipelineType type) |
| Create new shader. More...
|
|
uint32_t | CreateDescriptor (VkDevice device, VkPhysicalDevice physicalDevice, const JEVulkanSwapChain &swapChain, const std::vector< std::vector< VkImageView >> &imageViews, const std::vector< VkSampler > &samplers, const std::vector< uint32_t > &bufferSizes, const std::vector< uint32_t > &ssboSizes, VkDescriptorSetLayout layout, PipelineType type, bool recreate, uint32_t recreateIdx=UINT32_MAX) |
| Create descriptor. More...
|
|
const JEShader * | GetShaderAt (int shaderID) const |
| Get shader object. More...
|
|
const JEVulkanDescriptor & | GetDescriptorAt (int descriptorID) const |
| Get descriptor object. More...
|
|
void | UpdateBuffers (VkDevice device, uint32_t descriptorID, uint32_t imageIndex, const std::vector< const void * > &buffers, const std::vector< uint32_t > &bufferSizes, const std::vector< const void * > &ssboBuffers, const std::vector< uint32_t > &ssboSizes) |
| Update the uniform and shader storage buffers of the specified descriptor. More...
|
|
void | Cleanup () |
| Cleanup all managed shader and descriptor objects. More...
|
|
The JEShaderManger class.
Class that manages all shader resources, including shader pipeline objects and descriptor objects. Provides creation and getter convenience functions.
- See also
- JEShader, JEVulkanDescriptor,
-
JEVulkanRenderer
◆ JEShaderManager() [1/2]
JoeEngine::JEShaderManager::JEShaderManager |
( |
| ) |
|
|
inline |
◆ JEShaderManager() [2/2]
JoeEngine::JEShaderManager::JEShaderManager |
( |
VkDevice |
device | ) |
|
|
inline |
◆ ~JEShaderManager()
JoeEngine::JEShaderManager::~JEShaderManager |
( |
| ) |
|
|
default |
◆ Cleanup()
void JoeEngine::JEShaderManager::Cleanup |
( |
| ) |
|
|
inline |
Cleanup all managed shader and descriptor objects.
◆ CreateDescriptor()
uint32_t JoeEngine::JEShaderManager::CreateDescriptor |
( |
VkDevice |
device, |
|
|
VkPhysicalDevice |
physicalDevice, |
|
|
const JEVulkanSwapChain & |
swapChain, |
|
|
const std::vector< std::vector< VkImageView >> & |
imageViews, |
|
|
const std::vector< VkSampler > & |
samplers, |
|
|
const std::vector< uint32_t > & |
bufferSizes, |
|
|
const std::vector< uint32_t > & |
ssboSizes, |
|
|
VkDescriptorSetLayout |
layout, |
|
|
PipelineType |
type, |
|
|
bool |
recreate, |
|
|
uint32_t |
recreateIdx = UINT32_MAX |
|
) |
| |
|
inline |
Create descriptor.
Creates a new descriptor object given various images and buffers.
- Parameters
-
device | the Vulkan logical device. |
physicalDevice | the Vulkan physical device. |
swapChain | the Vulkan swap chain. |
imageViews | list of Vulkan image view objects. |
samplers | list of Vulkna texture sampler objects. |
bufferSizes | list of sizes of each uniform buffer. |
ssboSizes | list of sizes for each shader storage buffer. |
layout | the Vulkan descriptor set layout for the new descriptor object. |
type | the shader pipeline type that this descriptor will be used with (and must be compatible with). |
recreate | flag indicating whether this function is being called to recreate an existing descriptor object or to create a new one. |
recreateIdx | if we are recreating an existing descriptor object, this is the ID of that descriptor object. |
- Returns
- an ID corresponding to the newly created descriptor.
◆ CreateShader()
uint32_t JoeEngine::JEShaderManager::CreateShader |
( |
VkDevice |
device, |
|
|
VkPhysicalDevice |
physicalDevice, |
|
|
const JEVulkanSwapChain & |
swapChain, |
|
|
const MaterialComponent & |
materialComponent, |
|
|
uint32_t |
numSourceTextures, |
|
|
VkRenderPass |
renderPass, |
|
|
const std::string & |
vertPath, |
|
|
const std::string & |
fragPath, |
|
|
PipelineType |
type |
|
) |
| |
|
inline |
Create new shader.
Creates a new shader given the necessary shader pipeline settings.
- Parameters
-
device | the Vulkan logical device. |
physicalDevice | the Vulkan physical device. |
swapChain | the Vulkan swap chain. |
materialComponent | the material component with shader settings. |
numSourceTextures | the number of source textures for the shader. |
renderPass | the Vulkan render pass object during which the new shader will be used. |
vertPath | the vertex shader file source path. |
fragPath | the fragment shader file source path. |
type | the shader pipeline type enum. |
- Returns
- a shader ID corresponding to the newly created shader object.
◆ GetDescriptorAt()
const JEVulkanDescriptor& JoeEngine::JEShaderManager::GetDescriptorAt |
( |
int |
descriptorID | ) |
const |
|
inline |
Get descriptor object.
- Parameters
-
descriptorID | the ID of the descriptor object to access. |
- Returns
- the descriptor object corresponding to the given ID.
◆ GetShaderAt()
const JEShader* JoeEngine::JEShaderManager::GetShaderAt |
( |
int |
shaderID | ) |
const |
|
inline |
Get shader object.
- Parameters
-
shaderID | the ID of the shader object to access. |
- Returns
- the shader object corresponding to the given ID.
◆ UpdateBuffers()
void JoeEngine::JEShaderManager::UpdateBuffers |
( |
VkDevice |
device, |
|
|
uint32_t |
descriptorID, |
|
|
uint32_t |
imageIndex, |
|
|
const std::vector< const void * > & |
buffers, |
|
|
const std::vector< uint32_t > & |
bufferSizes, |
|
|
const std::vector< const void * > & |
ssboBuffers, |
|
|
const std::vector< uint32_t > & |
ssboSizes |
|
) |
| |
|
inline |
Update the uniform and shader storage buffers of the specified descriptor.
- Parameters
-
device | the Vulkan logical device. |
descriptorID | the ID of the descriptor object to update. |
imageIndex | the currently active swap chain image index. |
buffers | list of uniform data buffers |
bufferSizes | list of uniform data buffer sizes |
ssboBuffers | list of shader storage data buffers |
ssboSizes | list of shader storage data buffer sizes |
The documentation for this class was generated from the following file: