CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VKShaderProgram Class Referencefinal

#include <CeresEngine/RenderAPI/Vulkan/VKShader.hpp>

Inheritance diagram for CeresEngine::VKShaderProgram:
CeresEngine::GPUShaderProgram CeresEngine::VKObject< VKShaderProgram, GPUShaderProgram > CeresEngine::TDeviceObject< GPUShaderProgramDescriptor > CeresEngine::VKObjectBase CeresEngine::GPUDeviceObject CeresEngine::GPUObject

Public Types

using Allocator = VKObjectAllocator
 An allocator type used to allocate new VKShaderProgram instances from a memory pool.
 
- Public Types inherited from CeresEngine::TDeviceObject< GPUShaderProgramDescriptor >
using Descriptor = GPUShaderProgramDescriptor
 An type-alias to the descriptor struct type.
 

Public Member Functions

 VKShaderProgram (VKDevice &device, const GPUShaderProgramDescriptor &descriptor)
 
 ~VKShaderProgram () final
 
void destroy () noexcept final
 
const Vector< VkPipelineShaderStageCreateInfo, VKAllocator > & getPipelineShaderStageCreateInfo () const
 
GPUPipelineLayoutPtr getPipelineLayout () const final
 The pipeline layout deduced for this shader program.
 
const VKPipelineLayoutPtrgetPipelineLayoutVK () const noexcept
 The pipeline layout for this shader program.
 
- Public Member Functions inherited from CeresEngine::GPUShaderProgram
 GPUShaderProgram (GPUDevice &device, const Descriptor &descriptor, const GPUShaderReflectionDescriptor &reflection)
 Initializes a new ShaderProgram object instance.
 
 GPUShaderProgram (const GPUShaderProgram &)=delete
 Deleted copy constructor.
 
GPUShaderProgramoperator= (const GPUShaderProgram &)=delete
 
 GPUShaderProgram (GPUShaderProgram &&)=delete
 Deleted move constructor.
 
GPUShaderProgramoperator= (GPUShaderProgram &&)=delete
 
const GPUShaderReflectionDescriptorreflect () const
 Extracts reflection information from the shader.
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPUShaderProgramDescriptor >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 

Static Public Member Functions

static AllocatorgetAllocator () noexcept
 Returns the allocator for VKShaderProgram.
 
static voidoperator new (size_t size) noexcept
 Allocates memory for a new instance of VKShaderProgram.
 
static void operator delete (void *p, std::size_t size) noexcept
 Deletes memory for an instance of VKShaderProgram.
 
- Static Public Member Functions inherited from CeresEngine::VKObject< VKShaderProgram, GPUShaderProgram >
static RC< VKShaderProgramcast (const RC< GPUShaderProgram > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static VKShaderProgramcast (GPUShaderProgram &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const VKShaderProgramcast (const GPUShaderProgram &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static VKShaderProgramcast (GPUShaderProgram *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const VKShaderProgramcast (const GPUShaderProgram *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Static Public Member Functions inherited from CeresEngine::VKObjectBase
static voidoperator new (size_t size) noexcept
 
static void operator delete (void *p, std::size_t sz) noexcept
 

Private Attributes

const GPUShaderProgramDescriptor descriptorVK
 A structure that describes the shader program and it's properties.
 
GPUShaderProgramDescriptor mDescriptor
 The shader program descriptor.
 
GPUShaderReflectionDescriptor mReflectionDescriptor
 The shader reflection descriptor.
 
Vector< VkPipelineShaderStageCreateInfo, VKAllocatormStageInfos {gVKAllocator()}
 A vector of VkPipelineShaderStageCreateInfo objects.
 
VKPipelineLayoutPtr mPipelineLayout = nullptr
 The pipeline layout for this shader program.
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::GPUShaderProgram
const GPUShaderReflectionDescriptorreflection
 The shader reflection descriptor.
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUShaderProgramDescriptor >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 

Member Typedef Documentation

◆ Allocator

An allocator type used to allocate new VKShaderProgram instances from a memory pool.

Constructor & Destructor Documentation

◆ VKShaderProgram()

CeresEngine::VKShaderProgram::VKShaderProgram ( VKDevice device,
const GPUShaderProgramDescriptor descriptor 
)
explicit

◆ ~VKShaderProgram()

CeresEngine::VKShaderProgram::~VKShaderProgram ( )
final

Member Function Documentation

◆ destroy()

void CeresEngine::VKShaderProgram::destroy ( )
finalvirtualnoexcept

Reimplemented from CeresEngine::GPUObject.

◆ getAllocator()

static Allocator & CeresEngine::VKShaderProgram::getAllocator ( )
staticnoexcept

Returns the allocator for VKShaderProgram.

◆ getPipelineLayout()

GPUPipelineLayoutPtr CeresEngine::VKShaderProgram::getPipelineLayout ( ) const
inlinefinalvirtual

The pipeline layout deduced for this shader program.

Will be used if the user doesn't provide another when creating a new pipeline.

Can be null if the shader doesn't have any reflection metadata to create a pipeline layout for the program.

Implements CeresEngine::GPUShaderProgram.

◆ getPipelineLayoutVK()

const VKPipelineLayoutPtr & CeresEngine::VKShaderProgram::getPipelineLayoutVK ( ) const
inlinenoexcept

The pipeline layout for this shader program.

Will be used in-case the user doesn't provide another when creating a new pipeline.

◆ getPipelineShaderStageCreateInfo()

const Vector< VkPipelineShaderStageCreateInfo, VKAllocator > & CeresEngine::VKShaderProgram::getPipelineShaderStageCreateInfo ( ) const
inline
Returns
A vector of VkPipelineShaderStageCreateInfo objects.

◆ operator delete()

static void CeresEngine::VKShaderProgram::operator delete ( void p,
std::size_t  size 
)
staticnoexcept

Deletes memory for an instance of VKShaderProgram.

◆ operator new()

static void * CeresEngine::VKShaderProgram::operator new ( size_t  size)
staticnoexcept

Allocates memory for a new instance of VKShaderProgram.

Member Data Documentation

◆ descriptorVK

const GPUShaderProgramDescriptor CeresEngine::VKShaderProgram::descriptorVK
private

A structure that describes the shader program and it's properties.

◆ mDescriptor

GPUShaderProgramDescriptor CeresEngine::VKShaderProgram::mDescriptor
private

The shader program descriptor.

Since Vulkan does not have the concept of a ShaderProgram, we only store a copy of the descriptor and use it when building the pipeline object.

◆ mPipelineLayout

VKPipelineLayoutPtr CeresEngine::VKShaderProgram::mPipelineLayout = nullptr
private

The pipeline layout for this shader program.

Will be used in-case the user doesn't provide another when creating a new pipeline.

◆ mReflectionDescriptor

GPUShaderReflectionDescriptor CeresEngine::VKShaderProgram::mReflectionDescriptor
private

The shader reflection descriptor.

◆ mStageInfos

Vector<VkPipelineShaderStageCreateInfo, VKAllocator> CeresEngine::VKShaderProgram::mStageInfos {gVKAllocator()}
private

A vector of VkPipelineShaderStageCreateInfo objects.


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