Nebula
Loading...
Searching...
No Matches
Vulkan::VkShaderCache Class Reference

#include <vkshaderpool.h>

Inherits Resources::ResourceStreamCache.

Classes

struct  BufferMapping
 
struct  DescriptorSetBinding
 
struct  VkReflectionInfo
 
struct  VkShaderRuntimeInfo
 
struct  VkShaderSetupInfo
 

Public Types

typedef Util::Dictionary< CoreGraphics::ShaderFeature::Mask, CoreGraphics::ShaderProgramId > ProgramMap
 

Public Member Functions

 VkShaderCache ()
 constructor
 
virtual ~VkShaderCache ()
 destructor
 
CoreGraphics::ShaderProgramId GetShaderProgram (const CoreGraphics::ShaderId shaderId, const CoreGraphics::ShaderFeature::Mask mask)
 get shader-program id, which can be used to directly access a program in a shader
 
CoreGraphics::ResourceTableId CreateResourceTable (const CoreGraphics::ShaderId id, const IndexT group, const uint overallocationSize)
 create resource table
 
CoreGraphics::BufferId CreateConstantBuffer (const CoreGraphics::ShaderId id, const Util::StringAtom &name, CoreGraphics::BufferAccessMode mode)
 create constant buffer from name
 
CoreGraphics::BufferId CreateConstantBuffer (const CoreGraphics::ShaderId id, const IndexT cbIndex, CoreGraphics::BufferAccessMode mode)
 create constant buffer from id
 
const IndexT GetConstantBinding (const CoreGraphics::ShaderId id, const Util::StringAtom &name) const
 get constant buffer binding from name
 
const IndexT GetConstantBinding (const CoreGraphics::ShaderId id, const IndexT cIndex) const
 get constant buffer binding from index
 
const SizeT GetConstantBindingsCount (const CoreGraphics::ShaderId id) const
 get constant buffer bindings
 
CoreGraphics::ResourceTableLayoutId GetResourceTableLayout (const CoreGraphics::ShaderId id, const IndexT group)
 get the resource table layout
 
CoreGraphics::ResourcePipelineId GetResourcePipeline (const CoreGraphics::ShaderId id)
 get the pipeline layout
 
const SizeT GetConstantCount (const CoreGraphics::ShaderId id) const
 get number of variables for shader
 
const CoreGraphics::ShaderConstantType GetConstantType (const CoreGraphics::ShaderId id, const IndexT i) const
 get type of constant by index
 
const CoreGraphics::ShaderConstantType GetConstantType (const CoreGraphics::ShaderId id, const Util::StringAtom &name) const
 get type of constant by index
 
const Util::StringAtom GetConstantBlockName (const CoreGraphics::ShaderId id, const Util::StringAtom &name)
 get name of constant block wherein the variable resides
 
const Util::StringAtom GetConstantBlockName (const CoreGraphics::ShaderId id, const IndexT cIndex)
 get name of constant block wherein the variable resides
 
const Util::StringAtom GetConstantName (const CoreGraphics::ShaderId id, const IndexT i) const
 get name of constant by index
 
const IndexT GetConstantGroup (const CoreGraphics::ShaderId id, const Util::StringAtom &name) const
 get constant buffer group index of constant
 
const IndexT GetConstantSlot (const CoreGraphics::ShaderId id, const Util::StringAtom &name) const
 get constant buffer slot index of constant
 
const SizeT GetConstantBufferCount (const CoreGraphics::ShaderId id) const
 get number of constant blocks
 
const SizeT GetConstantBufferSize (const CoreGraphics::ShaderId id, const IndexT i) const
 get size of constant buffer
 
const Util::StringAtom GetConstantBufferName (const CoreGraphics::ShaderId id, const IndexT i) const
 get name of constnat buffer
 
const IndexT GetConstantBufferResourceSlot (const CoreGraphics::ShaderId id, const IndexT i) const
 get slot of constant buffer based on index
 
const IndexT GetConstantBufferResourceGroup (const CoreGraphics::ShaderId id, const IndexT i) const
 get group of constant buffer based on index
 
const IndexT GetResourceSlot (const CoreGraphics::ShaderId id, const Util::StringAtom &name) const
 get slot of shader resource
 
const Util::Dictionary< CoreGraphics::ShaderFeature::Mask, CoreGraphics::ShaderProgramId > & GetPrograms (const CoreGraphics::ShaderId id)
 get list all mask-program pairs
 
Util::String GetProgramName (CoreGraphics::ShaderProgramId id)
 get name of program
 

Private Types

enum  { Shader_ReflectionInfo , Shader_SetupInfo , Shader_RuntimeInfo , Shader_ProgramAllocator }
 
typedef Util::Dictionary< Util::StringAtom, CoreGraphics::BufferIdUniformBufferMap
 
typedef Util::Dictionary< uint32_t, Util::Array< CoreGraphics::BufferId > > UniformBufferGroupMap
 

Private Member Functions

 __DeclareClass (VkShaderCache)
 
friend void::CoreGraphics::SetShaderProgram (const CoreGraphics::ShaderProgramId pro, const CoreGraphics::QueueType queue, const bool bindSharedResources)
 
const VkProgramReflectionInfoGetProgram (const CoreGraphics::ShaderProgramId shaderProgramId)
 get shader program
 
LoadStatus LoadFromStream (const Resources::ResourceId id, const Util::StringAtom &tag, const Ptr< IO::Stream > &stream, bool immediate=false) override
 load shader
 
LoadStatus ReloadFromStream (const Resources::ResourceId id, const Ptr< IO::Stream > &stream) override
 reload shader
 
void Unload (const Resources::ResourceId id) override
 unload shader
 
 __ImplementResourceAllocatorTyped (shaderAlloc, CoreGraphics::ShaderIdType)
 

Private Attributes

Ids::IdAllocator< VkReflectionInfo, VkShaderSetupInfo, VkShaderRuntimeInfo, VkShaderProgramAllocator > shaderAlloc
 this member allocates shaders
 
CoreGraphics::ShaderProgramId activeShaderProgram
 
CoreGraphics::ShaderFeature::Mask activeMask
 
Util::Dictionary< Ids::Id24, Ids::Id32slicedStateMap
 

Friends

class VkVertexSignatureCache
 
class VkPipelineDatabase
 

Member Typedef Documentation

◆ ProgramMap

◆ UniformBufferGroupMap

◆ UniformBufferMap

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
Shader_ReflectionInfo 
Shader_SetupInfo 
Shader_RuntimeInfo 
Shader_ProgramAllocator 

Constructor & Destructor Documentation

◆ VkShaderCache()

Vulkan::VkShaderCache::VkShaderCache ( )

constructor

◆ ~VkShaderCache()

Vulkan::VkShaderCache::~VkShaderCache ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Vulkan::VkShaderCache::__DeclareClass ( VkShaderCache )
private

◆ __ImplementResourceAllocatorTyped()

Vulkan::VkShaderCache::__ImplementResourceAllocatorTyped ( shaderAlloc ,
CoreGraphics::ShaderIdType  )
private

◆ CreateConstantBuffer() [1/2]

CoreGraphics::BufferId Vulkan::VkShaderCache::CreateConstantBuffer ( const CoreGraphics::ShaderId id,
const IndexT cbIndex,
CoreGraphics::BufferAccessMode mode )

create constant buffer from id

◆ CreateConstantBuffer() [2/2]

CoreGraphics::BufferId Vulkan::VkShaderCache::CreateConstantBuffer ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name,
CoreGraphics::BufferAccessMode mode )

create constant buffer from name

◆ CreateResourceTable()

CoreGraphics::ResourceTableId Vulkan::VkShaderCache::CreateResourceTable ( const CoreGraphics::ShaderId id,
const IndexT group,
const uint overallocationSize )

create resource table

◆ GetConstantBinding() [1/2]

const IndexT Vulkan::VkShaderCache::GetConstantBinding ( const CoreGraphics::ShaderId id,
const IndexT cIndex ) const

get constant buffer binding from index

◆ GetConstantBinding() [2/2]

const IndexT Vulkan::VkShaderCache::GetConstantBinding ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name ) const

get constant buffer binding from name

◆ GetConstantBindingsCount()

const SizeT Vulkan::VkShaderCache::GetConstantBindingsCount ( const CoreGraphics::ShaderId id) const

get constant buffer bindings

◆ GetConstantBlockName() [1/2]

const Util::StringAtom Vulkan::VkShaderCache::GetConstantBlockName ( const CoreGraphics::ShaderId id,
const IndexT cIndex )

get name of constant block wherein the variable resides

◆ GetConstantBlockName() [2/2]

const Util::StringAtom Vulkan::VkShaderCache::GetConstantBlockName ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name )

get name of constant block wherein the variable resides

◆ GetConstantBufferCount()

const SizeT Vulkan::VkShaderCache::GetConstantBufferCount ( const CoreGraphics::ShaderId id) const

get number of constant blocks

◆ GetConstantBufferName()

const Util::StringAtom Vulkan::VkShaderCache::GetConstantBufferName ( const CoreGraphics::ShaderId id,
const IndexT i ) const

get name of constnat buffer

◆ GetConstantBufferResourceGroup()

const IndexT Vulkan::VkShaderCache::GetConstantBufferResourceGroup ( const CoreGraphics::ShaderId id,
const IndexT i ) const

get group of constant buffer based on index

◆ GetConstantBufferResourceSlot()

const IndexT Vulkan::VkShaderCache::GetConstantBufferResourceSlot ( const CoreGraphics::ShaderId id,
const IndexT i ) const

get slot of constant buffer based on index

◆ GetConstantBufferSize()

const SizeT Vulkan::VkShaderCache::GetConstantBufferSize ( const CoreGraphics::ShaderId id,
const IndexT i ) const

get size of constant buffer

◆ GetConstantCount()

const SizeT Vulkan::VkShaderCache::GetConstantCount ( const CoreGraphics::ShaderId id) const

get number of variables for shader

◆ GetConstantGroup()

const IndexT Vulkan::VkShaderCache::GetConstantGroup ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name ) const

get constant buffer group index of constant

◆ GetConstantName()

const Util::StringAtom Vulkan::VkShaderCache::GetConstantName ( const CoreGraphics::ShaderId id,
const IndexT i ) const

get name of constant by index

◆ GetConstantSlot()

const IndexT Vulkan::VkShaderCache::GetConstantSlot ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name ) const

get constant buffer slot index of constant

◆ GetConstantType() [1/2]

const CoreGraphics::ShaderConstantType Vulkan::VkShaderCache::GetConstantType ( const CoreGraphics::ShaderId id,
const IndexT i ) const

get type of constant by index

◆ GetConstantType() [2/2]

const CoreGraphics::ShaderConstantType Vulkan::VkShaderCache::GetConstantType ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name ) const

get type of constant by index

◆ GetProgram()

const VkProgramReflectionInfo & Vulkan::VkShaderCache::GetProgram ( const CoreGraphics::ShaderProgramId shaderProgramId)
private

get shader program

Use direct resource ids, not the State, Shader or Variable type ids.

◆ GetProgramName()

Util::String Vulkan::VkShaderCache::GetProgramName ( CoreGraphics::ShaderProgramId id)

get name of program

◆ GetPrograms()

const Util::Dictionary< CoreGraphics::ShaderFeature::Mask, CoreGraphics::ShaderProgramId > & Vulkan::VkShaderCache::GetPrograms ( const CoreGraphics::ShaderId id)

get list all mask-program pairs

◆ GetResourcePipeline()

CoreGraphics::ResourcePipelineId Vulkan::VkShaderCache::GetResourcePipeline ( const CoreGraphics::ShaderId id)

get the pipeline layout

◆ GetResourceSlot()

const IndexT Vulkan::VkShaderCache::GetResourceSlot ( const CoreGraphics::ShaderId id,
const Util::StringAtom & name ) const

get slot of shader resource

◆ GetResourceTableLayout()

CoreGraphics::ResourceTableLayoutId Vulkan::VkShaderCache::GetResourceTableLayout ( const CoreGraphics::ShaderId id,
const IndexT group )

get the resource table layout

◆ GetShaderProgram()

CoreGraphics::ShaderProgramId Vulkan::VkShaderCache::GetShaderProgram ( const CoreGraphics::ShaderId shaderId,
const CoreGraphics::ShaderFeature::Mask mask )

get shader-program id, which can be used to directly access a program in a shader

◆ LoadFromStream()

Resources::ResourceCache::LoadStatus Vulkan::VkShaderCache::LoadFromStream ( const Resources::ResourceId id,
const Util::StringAtom & tag,
const Ptr< IO::Stream > & stream,
bool immediate = false )
overrideprivate

load shader

◆ ReloadFromStream()

Resources::ResourceStreamCache::LoadStatus Vulkan::VkShaderCache::ReloadFromStream ( const Resources::ResourceId id,
const Ptr< IO::Stream > & stream )
overrideprivate

reload shader

◆ Unload()

void Vulkan::VkShaderCache::Unload ( const Resources::ResourceId id)
overrideprivate

unload shader

◆ void::CoreGraphics::SetShaderProgram()

Vulkan::VkShaderCache::void::CoreGraphics::SetShaderProgram ( const CoreGraphics::ShaderProgramId pro,
const CoreGraphics::QueueType queue,
const bool bindSharedResources )
private

Friends And Related Symbol Documentation

◆ VkPipelineDatabase

friend class VkPipelineDatabase
friend

◆ VkVertexSignatureCache

friend class VkVertexSignatureCache
friend

Member Data Documentation

◆ activeMask

CoreGraphics::ShaderFeature::Mask Vulkan::VkShaderCache::activeMask
private

◆ activeShaderProgram

CoreGraphics::ShaderProgramId Vulkan::VkShaderCache::activeShaderProgram
private

◆ shaderAlloc

Ids::IdAllocator< VkReflectionInfo, VkShaderSetupInfo, VkShaderRuntimeInfo, VkShaderProgramAllocator > Vulkan::VkShaderCache::shaderAlloc
private

this member allocates shaders

◆ slicedStateMap

Util::Dictionary<Ids::Id24, Ids::Id32> Vulkan::VkShaderCache::slicedStateMap
private

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