Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Renderer::Backend::Vulkan::CShaderProgram Class Referencefinal

#include <ShaderProgram.h>

Inheritance diagram for Renderer::Backend::Vulkan::CShaderProgram:
Collaboration diagram for Renderer::Backend::Vulkan::CShaderProgram:

Classes

struct  PushConstant
 
struct  Uniform
 

Public Member Functions

 ~CShaderProgram () override
 
IDeviceGetDevice () override
 
int32_t GetBindingSlot (const CStrIntern name) const override
 
std::vector< VfsPathGetFileDependencies () const override
 
uint32_t GetStreamLocation (const VertexAttributeStream stream) const
 
const std::vector< VkPipelineShaderStageCreateInfo > & GetStages () const
 
void Bind ()
 
void Unbind ()
 
void PreDraw (CRingCommandContext &commandContext)
 
void PreDispatch (CRingCommandContext &commandContext)
 
void PostDispatch (CRingCommandContext &commandContext)
 
VkPipelineLayout GetPipelineLayout () const
 
VkPipelineBindPoint GetPipelineBindPoint () const
 
void SetUniform (const int32_t bindingSlot, const float value)
 
void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY)
 
void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY, const float valueZ)
 
void SetUniform (const int32_t bindingSlot, const float valueX, const float valueY, const float valueZ, const float valueW)
 
void SetUniform (const int32_t bindingSlot, PS::span< const float > values)
 
void SetTexture (const int32_t bindingSlot, CTexture *texture)
 
void SetStorageTexture (const int32_t bindingSlot, CTexture *texture)
 
bool IsMaterialConstantsDataOutdated () const
 
void UpdateMaterialConstantsData ()
 
std::byte * GetMaterialConstantsData () const
 
uint32_t GetMaterialConstantsDataSize () const
 
virtual int32_t GetBindingSlot (const CStrIntern name) const =0
 
virtual std::vector< VfsPathGetFileDependencies () const =0
 
- Public Member Functions inherited from Renderer::Backend::IDeviceObject< IShaderProgram >
virtual ~IDeviceObject ()
 
virtual IDeviceGetDevice ()=0
 
TAs ()
 

Private Member Functions

 CShaderProgram ()
 
std::pair< std::byte *, uint32_tGetUniformData (const int32_t bindingSlot, const uint32_t dataSize)
 
void BindOutdatedDescriptorSets (CRingCommandContext &commandContext)
 

Static Private Member Functions

static std::unique_ptr< CShaderProgramCreate (CDevice *device, const CStr &name, const CShaderDefines &defines)
 

Private Attributes

CDevicem_Device = nullptr
 
std::vector< VkShaderModule > m_ShaderModules
 
std::vector< VkPipelineShaderStageCreateInfo > m_Stages
 
VkPipelineLayout m_PipelineLayout = VK_NULL_HANDLE
 
VkPipelineBindPoint m_PipelineBindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM
 
std::vector< VfsPathm_FileDependencies
 
std::unique_ptr< std::byte[]> m_MaterialConstantsData
 
uint32_t m_MaterialConstantsDataSize = 0
 
bool m_MaterialConstantsDataOutdated = false
 
std::array< std::byte, 128 > m_PushConstantData
 
uint32_t m_PushConstantDataMask = 0
 
std::array< VkShaderStageFlags, 32 > m_PushConstantDataFlags
 
std::vector< PushConstantm_PushConstants
 
std::vector< Uniformm_Uniforms
 
std::unordered_map< CStrIntern, uint32_tm_UniformMapping
 
std::unordered_map< CStrIntern, uint32_tm_PushConstantMapping
 
std::optional< CSingleTypeDescriptorSetBinding< CTexture > > m_TextureBinding
 
std::optional< CSingleTypeDescriptorSetBinding< CTexture > > m_StorageImageBinding
 
std::unordered_map< VertexAttributeStream, uint32_tm_StreamLocations
 

Friends

class CDevice
 

Constructor & Destructor Documentation

◆ ~CShaderProgram()

CShaderProgram::~CShaderProgram ( )
override

◆ CShaderProgram()

CShaderProgram::CShaderProgram ( )
privatedefault

Member Function Documentation

◆ Bind()

void CShaderProgram::Bind ( )

◆ BindOutdatedDescriptorSets()

void CShaderProgram::BindOutdatedDescriptorSets ( CRingCommandContext commandContext)
private

◆ Create()

std::unique_ptr< CShaderProgram > CShaderProgram::Create ( CDevice device,
const CStr &  name,
const CShaderDefines defines 
)
staticprivate

◆ GetBindingSlot()

int32_t CShaderProgram::GetBindingSlot ( const CStrIntern  name) const
overridevirtual

◆ GetDevice()

IDevice * CShaderProgram::GetDevice ( )
overridevirtual

◆ GetFileDependencies()

std::vector< VfsPath > CShaderProgram::GetFileDependencies ( ) const
overridevirtual

◆ GetMaterialConstantsData()

std::byte * Renderer::Backend::Vulkan::CShaderProgram::GetMaterialConstantsData ( ) const
inline

◆ GetMaterialConstantsDataSize()

uint32_t Renderer::Backend::Vulkan::CShaderProgram::GetMaterialConstantsDataSize ( ) const
inline

◆ GetPipelineBindPoint()

VkPipelineBindPoint Renderer::Backend::Vulkan::CShaderProgram::GetPipelineBindPoint ( ) const
inline

◆ GetPipelineLayout()

VkPipelineLayout Renderer::Backend::Vulkan::CShaderProgram::GetPipelineLayout ( ) const
inline

◆ GetStages()

const std::vector< VkPipelineShaderStageCreateInfo > & Renderer::Backend::Vulkan::CShaderProgram::GetStages ( ) const
inline

◆ GetStreamLocation()

uint32_t CShaderProgram::GetStreamLocation ( const VertexAttributeStream  stream) const

◆ GetUniformData()

std::pair< std::byte *, uint32_t > CShaderProgram::GetUniformData ( const int32_t  bindingSlot,
const uint32_t  dataSize 
)
private

◆ IsMaterialConstantsDataOutdated()

bool Renderer::Backend::Vulkan::CShaderProgram::IsMaterialConstantsDataOutdated ( ) const
inline

◆ PostDispatch()

void CShaderProgram::PostDispatch ( CRingCommandContext commandContext)

◆ PreDispatch()

void CShaderProgram::PreDispatch ( CRingCommandContext commandContext)

◆ PreDraw()

void CShaderProgram::PreDraw ( CRingCommandContext commandContext)

◆ SetStorageTexture()

void CShaderProgram::SetStorageTexture ( const int32_t  bindingSlot,
CTexture texture 
)

◆ SetTexture()

void CShaderProgram::SetTexture ( const int32_t  bindingSlot,
CTexture texture 
)

◆ SetUniform() [1/5]

void CShaderProgram::SetUniform ( const int32_t  bindingSlot,
const float  value 
)

◆ SetUniform() [2/5]

void CShaderProgram::SetUniform ( const int32_t  bindingSlot,
const float  valueX,
const float  valueY 
)

◆ SetUniform() [3/5]

void CShaderProgram::SetUniform ( const int32_t  bindingSlot,
const float  valueX,
const float  valueY,
const float  valueZ 
)

◆ SetUniform() [4/5]

void CShaderProgram::SetUniform ( const int32_t  bindingSlot,
const float  valueX,
const float  valueY,
const float  valueZ,
const float  valueW 
)

◆ SetUniform() [5/5]

void CShaderProgram::SetUniform ( const int32_t  bindingSlot,
PS::span< const float >  values 
)

◆ Unbind()

void CShaderProgram::Unbind ( )

◆ UpdateMaterialConstantsData()

void Renderer::Backend::Vulkan::CShaderProgram::UpdateMaterialConstantsData ( )
inline

Friends And Related Function Documentation

◆ CDevice

friend class CDevice
friend

Member Data Documentation

◆ m_Device

CDevice* Renderer::Backend::Vulkan::CShaderProgram::m_Device = nullptr
private

◆ m_FileDependencies

std::vector<VfsPath> Renderer::Backend::Vulkan::CShaderProgram::m_FileDependencies
private

◆ m_MaterialConstantsData

std::unique_ptr<std::byte[]> Renderer::Backend::Vulkan::CShaderProgram::m_MaterialConstantsData
private

◆ m_MaterialConstantsDataOutdated

bool Renderer::Backend::Vulkan::CShaderProgram::m_MaterialConstantsDataOutdated = false
private

◆ m_MaterialConstantsDataSize

uint32_t Renderer::Backend::Vulkan::CShaderProgram::m_MaterialConstantsDataSize = 0
private

◆ m_PipelineBindPoint

VkPipelineBindPoint Renderer::Backend::Vulkan::CShaderProgram::m_PipelineBindPoint = VK_PIPELINE_BIND_POINT_MAX_ENUM
private

◆ m_PipelineLayout

VkPipelineLayout Renderer::Backend::Vulkan::CShaderProgram::m_PipelineLayout = VK_NULL_HANDLE
private

◆ m_PushConstantData

std::array<std::byte, 128> Renderer::Backend::Vulkan::CShaderProgram::m_PushConstantData
private

◆ m_PushConstantDataFlags

std::array<VkShaderStageFlags, 32> Renderer::Backend::Vulkan::CShaderProgram::m_PushConstantDataFlags
private

◆ m_PushConstantDataMask

uint32_t Renderer::Backend::Vulkan::CShaderProgram::m_PushConstantDataMask = 0
private

◆ m_PushConstantMapping

std::unordered_map<CStrIntern, uint32_t> Renderer::Backend::Vulkan::CShaderProgram::m_PushConstantMapping
private

◆ m_PushConstants

std::vector<PushConstant> Renderer::Backend::Vulkan::CShaderProgram::m_PushConstants
private

◆ m_ShaderModules

std::vector<VkShaderModule> Renderer::Backend::Vulkan::CShaderProgram::m_ShaderModules
private

◆ m_Stages

std::vector<VkPipelineShaderStageCreateInfo> Renderer::Backend::Vulkan::CShaderProgram::m_Stages
private

◆ m_StorageImageBinding

std::optional<CSingleTypeDescriptorSetBinding<CTexture> > Renderer::Backend::Vulkan::CShaderProgram::m_StorageImageBinding
private

◆ m_StreamLocations

std::unordered_map<VertexAttributeStream, uint32_t> Renderer::Backend::Vulkan::CShaderProgram::m_StreamLocations
private

◆ m_TextureBinding

std::optional<CSingleTypeDescriptorSetBinding<CTexture> > Renderer::Backend::Vulkan::CShaderProgram::m_TextureBinding
private

◆ m_UniformMapping

std::unordered_map<CStrIntern, uint32_t> Renderer::Backend::Vulkan::CShaderProgram::m_UniformMapping
private

◆ m_Uniforms

std::vector<Uniform> Renderer::Backend::Vulkan::CShaderProgram::m_Uniforms
private

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