The Joe Engine
Joe's engine programming playground
JoeEngine::JEVulkanShader Class Referenceabstract

The JEVulkanShader. More...

#include <VulkanShader.h>

Inheritance diagram for JoeEngine::JEVulkanShader:
JoeEngine::JEShader JoeEngine::JEDeferredGeometryShader JoeEngine::JEDeferredShader JoeEngine::JEForwardShader JoeEngine::JEForwardTranslucentShader JoeEngine::JEOITSortShader JoeEngine::JEPointsShader JoeEngine::JEShadowShader

Public Member Functions

 JEVulkanShader ()=delete
 Default constructor (deleted). More...
 
 JEVulkanShader (VkDevice device, const std::string &vertPath, const std::string &fragPath)
 Constructor. More...
 
virtual ~JEVulkanShader ()=default
 Destructor (default) (deleted). More...
 
void Cleanup () override
 Vulkan API-specific cleanup function. More...
 
virtual void UpdateUniformBuffers (VkDevice device, uint32_t currentImage) override
 Default shader data buffer update function. More...
 
VkPipeline GetPipeline () const
 
VkPipelineLayout GetPipelineLayout () const
 
VkDescriptorSetLayout GetDescriptorSetLayout (uint32_t index) const
 Get descriptor set layout object. More...
 
- Public Member Functions inherited from JoeEngine::JEShader
 JEShader ()=delete
 Delete constructor (deleted). More...
 
 JEShader (const std::string &vertPath, const std::string &fragPath)
 Constructor. More...
 
virtual ~JEShader ()=default
 Destructor (default) (virtual). More...
 

Protected Member Functions

virtual void CreateDescriptorSetLayouts (VkDevice device, uint32_t numSourceTextures, uint32_t numUniformBuffers, uint32_t numStorageBuffers)
 Base class version of descriptor set layout creation. More...
 
virtual void CreateGraphicsPipeline (VkDevice device, VkShaderModule vertShaderModule, VkShaderModule fragShaderModule, VkExtent2D frameExtent, VkRenderPass renderPass, const MaterialComponent &materialComponent)=0
 Create graphics pipeline function. More...
 

Protected Attributes

VkPipeline m_graphicsPipeline = VK_NULL_HANDLE
 Graphics pipeline object. More...
 
VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE
 Pipeline layout object. More...
 
std::vector< VkDescriptorSetLayout > m_descriptorSetLayouts
 List of descriptor set layouts (number of elements dependent on the purpose of the derived shader). More...
 
const VkDevice m_device
 Reference to the Vulkan logical device. More...
 
- Protected Attributes inherited from JoeEngine::JEShader
const std::string m_vertPath
 Path to vertex shader source file. More...
 
const std::string m_fragPath
 Path to fragment shader source file. More...
 

Detailed Description

The JEVulkanShader.

Class that directly extends the JEShader class. Meant to be extended by all specific Vulkan shader class. Stores Vulkan API specific data.

Constructor & Destructor Documentation

◆ JEVulkanShader() [1/2]

JoeEngine::JEVulkanShader::JEVulkanShader ( )
delete

Default constructor (deleted).

◆ JEVulkanShader() [2/2]

JoeEngine::JEVulkanShader::JEVulkanShader ( VkDevice  device,
const std::string &  vertPath,
const std::string &  fragPath 
)
inline

Constructor.

◆ ~JEVulkanShader()

virtual JoeEngine::JEVulkanShader::~JEVulkanShader ( )
virtualdefault

Destructor (default) (deleted).

Member Function Documentation

◆ Cleanup()

void JoeEngine::JEVulkanShader::Cleanup ( )
inlineoverridevirtual

Vulkan API-specific cleanup function.

Implements JoeEngine::JEShader.

◆ CreateDescriptorSetLayouts()

virtual void JoeEngine::JEVulkanShader::CreateDescriptorSetLayouts ( VkDevice  device,
uint32_t  numSourceTextures,
uint32_t  numUniformBuffers,
uint32_t  numStorageBuffers 
)
inlineprotectedvirtual

Base class version of descriptor set layout creation.

Parameters
devicethe Vulkan logical device.
numSourceTexturesthe number of uniform sampler textures.
numUniformBuffersthe number of uniform data buffers.
numStorageBuffersthe number of shader storage data buffers.

◆ CreateGraphicsPipeline()

virtual void JoeEngine::JEVulkanShader::CreateGraphicsPipeline ( VkDevice  device,
VkShaderModule  vertShaderModule,
VkShaderModule  fragShaderModule,
VkExtent2D  frameExtent,
VkRenderPass  renderPass,
const MaterialComponent materialComponent 
)
protectedpure virtual

Create graphics pipeline function.

Parameters
devicethe Vulkan logical device.
vertShaderModulethe vertex shader module object.
fragShaderModulethe fragment shader module object.
frameExtentthe window/frame dimensions.
renderPassthe intended Vulkan render pass object for the shader.
materialComponentthe material properties for the shader.

◆ GetDescriptorSetLayout()

VkDescriptorSetLayout JoeEngine::JEVulkanShader::GetDescriptorSetLayout ( uint32_t  index) const
inline

Get descriptor set layout object.

Parameters
indexthe specific descriptor set layout to return.
Returns
the specific descriptor set layout.

◆ GetPipeline()

VkPipeline JoeEngine::JEVulkanShader::GetPipeline ( ) const
inline

Get graphics pipeline object.

Returns
the stored graphics pipeline object.

◆ GetPipelineLayout()

VkPipelineLayout JoeEngine::JEVulkanShader::GetPipelineLayout ( ) const
inline

Get graphics pipeline layout object.

Returns
the stored graphics pipeline layout object.

◆ UpdateUniformBuffers()

virtual void JoeEngine::JEVulkanShader::UpdateUniformBuffers ( VkDevice  device,
uint32_t  currentImage 
)
inlineoverridevirtual

Default shader data buffer update function.

Parameters
devicethe Vulkan logical device.
currentImagethe currently active swap chain image.

Implements JoeEngine::JEShader.

Member Data Documentation

◆ m_descriptorSetLayouts

std::vector<VkDescriptorSetLayout> JoeEngine::JEVulkanShader::m_descriptorSetLayouts
protected

List of descriptor set layouts (number of elements dependent on the purpose of the derived shader).

◆ m_device

const VkDevice JoeEngine::JEVulkanShader::m_device
protected

Reference to the Vulkan logical device.

◆ m_graphicsPipeline

VkPipeline JoeEngine::JEVulkanShader::m_graphicsPipeline = VK_NULL_HANDLE
protected

Graphics pipeline object.

◆ m_pipelineLayout

VkPipelineLayout JoeEngine::JEVulkanShader::m_pipelineLayout = VK_NULL_HANDLE
protected

Pipeline layout object.


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