Nebula
Loading...
Searching...
No Matches
vkshader.cc File Reference

Namespaces

namespace  Vulkan
 Vulkan implementation of GPU acceleration structure.
namespace  CoreGraphics
 Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.

Enumerations

enum  Vulkan::ShaderStages {
  Vulkan::VertexShader , Vulkan::HullShader , Vulkan::DomainShader , Vulkan::GeometryShader ,
  Vulkan::PixelShader , Vulkan::ComputeShader , Vulkan::TaskShader , Vulkan::MeshShader ,
  Vulkan::RayGenerationShader , Vulkan::RayAnyHitShader , Vulkan::RayClosestHitShader , Vulkan::RayMissShader ,
  Vulkan::RayIntersectionShader , Vulkan::CallableShader , Vulkan::NumShaders
}

Functions

void Vulkan::UpdateOccupancy (uint32_t *occupancyList, bool &slotUsed, const CoreGraphics::ShaderVisibility vis)
void Vulkan::UpdateValueDescriptorSet (bool &dynamic, uint32_t &num, uint32_t &numDyn, const unsigned set)
CoreGraphics::SamplerFilter Vulkan::SamplerFilterFromGPULang (GPULang::Serialization::Filter filter)
CoreGraphics::SamplerMipMode Vulkan::SamplerMipFilterFromGPULang (GPULang::Serialization::Filter filter)
CoreGraphics::SamplerCompareOperation Vulkan::SamplerCompareOpFromGPULang (GPULang::Serialization::CompareMode mode)
CoreGraphics::SamplerAddressMode Vulkan::SamplerAddressModeFromGPULang (GPULang::Serialization::AddressMode address)
CoreGraphics::SamplerBorderMode Vulkan::SamplerBorderModeFromGPULang (GPULang::Serialization::BorderColor color)
CoreGraphics::ShaderVisibility Vulkan::ShaderVisibilityFromGPULang (const GPULang::ShaderUsage usage)
void Vulkan::ShaderSetup (VkDevice dev, const Util::StringAtom &name, GPULang::Loader *loader, Util::FixedArray< CoreGraphics::ResourcePipelinePushConstantRange > &constantRange, Util::Set< CoreGraphics::SamplerId > &immutableSamplers, Util::FixedArray< Util::Pair< uint32_t, CoreGraphics::ResourceTableLayoutId > > &setLayouts, Util::Dictionary< uint32_t, uint32_t > &setLayoutMap, CoreGraphics::ResourcePipelineId &pipelineLayout, Util::Dictionary< Util::StringAtom, uint32_t > &resourceSlotMapping, Util::Dictionary< Util::StringAtom, IndexT > &constantBindings)
void Vulkan::ShaderCleanup (VkDevice dev, Util::Set< CoreGraphics::SamplerId > &immutableSamplers, Util::FixedArray< Util::Pair< uint32_t, CoreGraphics::ResourceTableLayoutId > > &setLayouts, Util::Dictionary< Util::StringAtom, CoreGraphics::BufferId > &buffers, CoreGraphics::ResourcePipelineId &pipelineLayout)
 cleanup shader
Util::String Vulkan::VkShaderCreateSignature (const VkDescriptorSetLayoutBinding &bind)
 create descriptor layout signature
const VkProgramReflectionInfoVulkan::ShaderGetProgramReflection (const CoreGraphics::ShaderProgramId shaderProgramId)
 Use direct resource ids, not the State, Shader or Variable type ids.
const ShaderId CoreGraphics::CreateShader (const GPULangShaderCreateInfo &info)
 Create new shader.
void CoreGraphics::DeleteShader (const ShaderId id)
void CoreGraphics::DestroyShader (const ShaderId id)
 Destroy shader.
CoreGraphics::ShaderProgramId CoreGraphics::ShaderGetShaderProgram (const CoreGraphics::ShaderId shaderId, const CoreGraphics::ShaderFeature::Mask mask)
const ResourceTableId CoreGraphics::ShaderCreateResourceTable (const ShaderId id, const IndexT group, const uint overallocationSize=1, const char *name=nullptr)
 create resource table from shader
ResourceTableSet CoreGraphics::ShaderCreateResourceTableSet (const ShaderId id, const IndexT group, const uint overallocationSize=1, const char *name=nullptr)
 create resource table set from shader
const bool CoreGraphics::ShaderHasResourceTable (const ShaderId id, const IndexT group)
 Returns true if there is a resource table for the given group in the shader.
const BufferId CoreGraphics::ShaderCreateConstantBuffer (const ShaderId id, const Util::StringAtom &name, BufferAccessMode mode=BufferAccessMode::HostCached)
 create constant buffer from shader using name (don't use too frequently)
const BufferId CoreGraphics::ShaderCreateConstantBuffer (const ShaderId id, const IndexT cbIndex, BufferAccessMode mode=BufferAccessMode::HostCached)
 create constant buffer from index
const BufferId CoreGraphics::ShaderCreateConstantBuffer (const ShaderId id, const IndexT group, const IndexT cbIndex, BufferAccessMode mode=BufferAccessMode::HostCached)
 create constant buffer from index
const uint CoreGraphics::ShaderCalculateConstantBufferIndex (const uint64_t bindingMask, const IndexT slot)
 Calculate buffer index using binding mask and slot.
CoreGraphics::ResourceTableLayoutId CoreGraphics::ShaderGetResourceTableLayout (const ShaderId id, const IndexT group)
 get resource table layout
CoreGraphics::ResourcePipelineId CoreGraphics::ShaderGetResourcePipeline (const ShaderId id)
 get pipeline layout for shader
const Resources::ResourceName CoreGraphics::ShaderGetName (const ShaderId id)
 Get name of shader.
const SizeT CoreGraphics::ShaderGetConstantCount (const ShaderId id)
 get the number of constants from shader
const ShaderConstantType CoreGraphics::ShaderGetConstantType (const ShaderId id, const IndexT i)
 get type of variable by index
const ShaderConstantType CoreGraphics::ShaderGetConstantType (const ShaderId id, const Util::StringAtom &name)
 get type of variable by index
const Util::StringAtom CoreGraphics::ShaderGetConstantBlockName (const ShaderId id, const Util::StringAtom &name)
 get name of constant buffer wherein constant with name resides
const Util::StringAtom CoreGraphics::ShaderGetConstantBlockName (const ShaderId id, const IndexT cIndex)
 get name of constant buffer where in constant with index resides
const Util::StringAtom CoreGraphics::ShaderGetConstantName (const ShaderId id, const IndexT i)
 get name of variable by index
const IndexT CoreGraphics::ShaderGetConstantGroup (const ShaderId id, const Util::StringAtom &name)
 get group to which constant is bound (the constant buffer which it resides in)
const IndexT CoreGraphics::ShaderGetConstantSlot (const ShaderId id, const Util::StringAtom &name)
 get binding inside group of the constant buffer the constant lies in
const SizeT CoreGraphics::ShaderGetConstantBufferCount (const ShaderId id)
 get the number of constant buffers from shader
const SizeT CoreGraphics::ShaderGetConstantBufferSize (const ShaderId id, const IndexT i)
 get size of constant buffer
const Util::StringAtom CoreGraphics::ShaderGetConstantBufferName (const ShaderId id, const IndexT i)
 get name of constant buffer
const IndexT CoreGraphics::ShaderGetConstantBufferResourceSlot (const ShaderId id, const IndexT i)
 get binding inside group of constant buffer
const IndexT CoreGraphics::ShaderGetConstantBufferResourceGroup (const ShaderId id, const IndexT i)
 get group of constant buffer
const uint64_t CoreGraphics::ShaderGetConstantBufferBindingMask (const ShaderId id, const IndexT group)
 Get mask of constant buffers.
const uint64_t CoreGraphics::ShaderGetConstantBufferSize (const ShaderId id, const IndexT group, const IndexT i)
 Get size of constant buffer at binding point.
const IndexT CoreGraphics::ShaderGetResourceSlot (const ShaderId id, const Util::StringAtom &name)
 get slot of any shader resource
const Util::Dictionary< ShaderFeature::Mask, ShaderProgramId > & CoreGraphics::ShaderGetPrograms (const ShaderId id)
 get programs
const Util::StringCoreGraphics::ShaderProgramGetName (const ShaderProgramId id)
 get name of program
const CoreGraphics::ShaderProgramId CoreGraphics::ShaderGetProgram (const ShaderId id, const CoreGraphics::ShaderFeature::Mask mask)
 get shader program id from masks, this allows us to apply a shader program directly in the future

Variables

Util::Dictionary< Util::StringAtom, VkDescriptorSetLayout > Vulkan::VkShaderLayoutCache
Util::Dictionary< Util::StringAtom, VkPipelineLayout > Vulkan::VkShaderPipelineCache
Util::Dictionary< Util::StringAtom, VkDescriptorSet > Vulkan::VkShaderDescriptorSetCache
ShaderAllocator Vulkan::shaderAlloc