35#include "api/loader.h"
46struct ShaderRWBufferId;
47struct ResourceTableId;
48struct ResourceTableLayoutId;
49struct ResourcePipelineId;
50struct ResourceTableSet;
93const ShaderId
CreateShader(
const ShaderCreateInfo& info);
95const ShaderId
CreateShader(
const GPULangShaderCreateInfo& info);
99void ReloadShader(
const ShaderId
id,
const AnyFX::ShaderEffect* effect);
uint Mask
a shader feature bit mask
Definition shaderfeature.h:31
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
A StringAtom.
Definition stringatom.h:22
#define ID_32_TYPE(x)
Definition id.h:16
#define ID_24_8_24_8_NAMED_TYPE(x, id24_0_name, id8_0_name, id24_1_name, id8_1_name, combined0_name, combined1_name)
Definition id.h:73
Implements a shader effect (using AnyFX) in Vulkan.
Definition shader.h:38
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
const IndexT ShaderGetConstantBufferResourceGroup(const ShaderId id, const IndexT i)
get group of constant buffer
Definition vkshader.cc:1944
const uint ShaderCalculateConstantBufferIndex(const uint64_t bindingMask, const IndexT slot)
Calculate buffer index using binding mask and slot.
Definition vkshader.cc:1578
const Resources::ResourceName ShaderGetName(const ShaderId id)
Get name of shader.
Definition vkshader.cc:1643
const ResourceTableId ShaderCreateResourceTable(const ShaderId id, const IndexT group, const uint overallocationSize=1, const char *name=nullptr)
create resource table from shader
Definition vkshader.cc:1441
const uint64_t ShaderGetConstantBufferBindingMask(const ShaderId id, const IndexT group)
Get mask of constant buffers.
Definition vkshader.cc:1954
const Util::StringAtom ShaderGetConstantName(const ShaderId id, const IndexT i)
get name of variable by index
Definition vkshader.cc:1863
const IndexT ShaderGetConstantSlot(const ShaderId id, const Util::StringAtom &name)
get binding inside group of the constant buffer the constant lies in
Definition vkshader.cc:1889
void ReloadShader(const ShaderId id, const AnyFX::ShaderEffect *effect)
Reload shader.
Definition vkshader.cc:1349
RayTracingBits ShaderProgramGetRaytracingBits(const ShaderProgramId id)
Definition vkshaderprogram.cc:1139
BufferAccessMode
Definition buffer.h:27
@ HostCached
Definition buffer.h:30
CoreGraphics::ResourcePipelineId ShaderGetResourcePipeline(const ShaderId id)
get pipeline layout for shader
Definition vkshader.cc:1634
const SizeT ShaderGetConstantBufferCount(const ShaderId id)
get the number of constant buffers from shader
Definition vkshader.cc:1905
const Util::StringAtom ShaderGetConstantBlockName(const ShaderId id, const Util::StringAtom &name)
get name of constant buffer wherein constant with name resides
Definition vkshader.cc:1843
const IndexT ShaderGetConstantBinding(const ShaderId id, const Util::StringAtom &name)
get constant buffer binding by name
Definition vkshader.cc:1591
const SizeT ShaderGetConstantCount(const ShaderId id)
get the number of constants from shader
Definition vkshader.cc:1652
const ShaderConstantType ShaderGetConstantType(const ShaderId id, const IndexT i)
get type of variable by index
Definition vkshader.cc:1661
const ShaderId ShaderGet(const Resources::ResourceName &name)
get shader by name
Definition shader.cc:14
const SizeT ShaderGetConstantBindingsCount(const ShaderId id)
get count of constant buffer bindings (for iteration)
Definition vkshader.cc:1613
const BufferId ShaderCreateConstantBuffer(const ShaderId id, const Util::StringAtom &name, BufferAccessMode mode=BufferAccessMode::HostCached)
create constant buffer from shader using name (don't use too frequently)
Definition vkshader.cc:1495
const bool ShaderHasResourceTable(const ShaderId id, const IndexT group)
Returns true if there is a resource table for the given group in the shader.
Definition vkshader.cc:1485
const IndexT ShaderGetConstantGroup(const ShaderId id, const Util::StringAtom &name)
get group to which constant is bound (the constant buffer which it resides in)
Definition vkshader.cc:1873
const Util::StringAtom ShaderGetConstantBufferName(const ShaderId id, const IndexT i)
get name of constant buffer
Definition vkshader.cc:1924
const IndexT ShaderGetConstantBufferResourceSlot(const ShaderId id, const IndexT i)
get binding inside group of constant buffer
Definition vkshader.cc:1934
const ShaderId CreateShader(const ShaderCreateInfo &info)
Create new shader.
Definition vkshader.cc:1040
CoreGraphics::ShaderFeature::Mask ShaderFeatureMask(const Util::String &mask)
Get shader feature mask from string.
Definition shader.cc:23
const CoreGraphics::ShaderProgramId 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
Definition vkshader.cc:2007
const Util::String ConstantTypeToString(const ShaderConstantType &type)
Get constant type as string.
Definition shader.cc:32
void DestroyShader(const ShaderId id)
Destroy shader.
Definition vkshader.cc:1339
const Util::StringAtom ShaderProgramGetName(const ShaderProgramId id)
get name of program
ResourceTableSet ShaderCreateResourceTableSet(const ShaderId id, const IndexT group, const uint overallocationSize=1, const char *name=nullptr)
create resource table set from shader
Definition vkshader.cc:1462
ShaderConstantType
Definition shader.h:70
@ ConstantBufferVariableType
Definition shader.h:80
@ UnknownVariableType
Definition shader.h:71
@ ImageHandleType
Definition shader.h:84
@ SamplerHandleType
Definition shader.h:85
@ BufferReadWriteVariableType
Definition shader.h:82
@ Vector2VariableType
Definition shader.h:75
@ VectorVariableType
Definition shader.h:74
@ ImageReadWriteVariableType
Definition shader.h:81
@ IntVariableType
Definition shader.h:72
@ TextureVariableType
Definition shader.h:78
@ BoolVariableType
Definition shader.h:77
@ FloatVariableType
Definition shader.h:73
@ TextureHandleType
Definition shader.h:83
@ SamplerVariableType
Definition shader.h:79
@ MatrixVariableType
Definition shader.h:76
CoreGraphics::ResourceTableLayoutId ShaderGetResourceTableLayout(const ShaderId id, const IndexT group)
get resource table layout
Definition vkshader.cc:1623
const SizeT ShaderGetConstantBufferSize(const ShaderId id, const IndexT i)
get size of constant buffer
Definition vkshader.cc:1914
const IndexT ShaderGetResourceSlot(const ShaderId id, const Util::StringAtom &name)
get slot of any shader resource
Definition vkshader.cc:1977
const Util::Dictionary< ShaderFeature::Mask, ShaderProgramId > & ShaderGetPrograms(const ShaderId id)
get programs
Definition vkshader.cc:1989
Util::StringAtom ResourceName
Definition resourceid.h:33
#define RESOURCE_ID_TYPE(type)
Definition resourceid.h:41
GPULang::Loader * loader
Definition shader.h:66
Resources::ResourceName name
Definition shader.h:65
Definition resourcetable.h:399
Definition resourcetable.h:25
AnyFX::ShaderEffect * effect
Definition shader.h:60
Resources::ResourceName name
Definition shader.h:59
Nebula's universal string class.
Definition String.cs:8
int SizeT
Definition types.h:42
unsigned int uint
Definition types.h:33
int IndexT
Definition types.h:41
Get shader program raytracing bits.
Definition shader.h:179
bool hasAnyHit
Definition shader.h:184
struct CoreGraphics::RayTracingBits::@237224006073315301152310140070207114272305324306 bitField
uint bits
Definition shader.h:189
bool hasMiss
Definition shader.h:187
bool hasIntersect
Definition shader.h:186
bool hasGen
Definition shader.h:182
bool hasCallable
Definition shader.h:183
bool hasClosestHit
Definition shader.h:185