HDK
|
#include <RV_ShaderProgram.h>
Public Member Functions | |
RV_ShaderProgramBase (RV_Instance *inst, RV_VKPipelineLayoutPtr pipe_layout) | |
virtual | ~RV_ShaderProgramBase () |
void | setName (const UT_StringHolder &name) |
Set a descriptive name for the shader. More... | |
const UT_StringHolder & | name () const |
Descriptive name of the shader. More... | |
virtual RV_ShaderType | getShaderType () const =0 |
Type of shader - graphics or compute. More... | |
int | getMaxSetNumber () const |
The number of descriptor sets in the shader. More... | |
bool | hasSet (int set_num) const |
Query if set 'set_num' is used by the shader. More... | |
bool | isSetCompatible (const RV_ShaderVariableSet &set) const |
Return true if 'set' is compatable with the set layout in this shader. More... | |
const RV_VKDescriptorSetInfo * | getSetInfo (int set_num) const |
Query information on set 'set_num'. More... | |
UT_UniquePtr < RV_ShaderVariableSet > | createSet (RV_Instance *inst, int set_num) const |
Create a shader varaible set (descriptor set) for set 'set_num'. More... | |
const RV_VKPipelineLayout & | getLayout () const |
The layout of all sets and inputs of the shader. More... | |
bool | hasBinding (const UT_StringRef &name) const |
Query if a binding named 'name' exists. More... | |
const RV_VKDescriptorBinding * | getBinding (int set, int binding) const |
Return a binding at index 'binding' for set index 'set'. More... | |
const RV_VKDescriptorBinding * | getBinding (const UT_StringRef &name) const |
Return a binding for 'name'. More... | |
const UT_Array< const RV_VKDescriptorBinding * > & | getBindingList () const |
Return the list of set bindings. More... | |
bool | hasUniform (const UT_StringRef &name) const |
Query if the uniform named 'name' exists. More... | |
const RV_Uniform * | getUniform (const UT_StringRef &name) const |
Return type, size, and offset information about the uniform. More... | |
const UT_Array< const RV_Uniform * > & | getUniformList () const |
Return a list of all uniforms in this shader. More... | |
bool | hasPushConstant (const UT_StringRef &name) const |
Query if push constant with 'name' exists. More... | |
const RV_Uniform * | getPushConstant (const UT_StringRef &name, int *opt_idx) const |
Fetch the push constant 'name' with an optional array index. More... | |
const UT_Array < RV_VKPushConstantRange > & | getPushConstantRanges () const |
virtual void | print () const |
Debug print message. More... | |
Static Protected Member Functions | |
static RV_VKPipelineLayoutPtr | loadShaderProgram (RV_Instance *inst, const char *program, const char *extra_defines=nullptr) |
static RV_VKPipelineLayoutPtr | createShaderProgram (RV_Instance *inst, RV_VKShader &shader, const char *name=nullptr) |
static RV_VKPipelineLayoutPtr | createShaderProgram (RV_Instance *inst, const UT_StringArray &filenames, const char *name=nullptr) |
Protected Attributes | |
UT_Array< RV_ShaderInput > | myInputs |
UT_ArrayStringMap< int > | myInputTable |
UT_UniquePtr< const RV_VKPipelineLayout > | myLayout |
UT_Array< exint > | mySetLayoutIds |
UT_Array< const RV_Uniform * > | myUniforms |
UT_ArrayStringMap< int > | myUniformTable |
Mapping of uniform names, to indices in myUniforms. More... | |
UT_Array< const RV_VKDescriptorBinding * > | myBindings |
UT_ArrayStringMap< std::pair < int, int > > | myBindingTable |
mapping of binding name to set + binding number More... | |
UT_Array< const RV_Uniform * > | myPushConstants |
UT_ArrayStringMap< int > | myPushConstTable |
UT_StringHolder | myName |
friend | RV_Geometry |
friend | RV_ShaderVariableSet |
class for shared functionality between different types of shaders: mainly accessing the the pipeline layout. Other shader types can build on extra functionality, e.g. input attributes for Graphics
Definition at line 85 of file RV_ShaderProgram.h.
RV_ShaderProgramBase::RV_ShaderProgramBase | ( | RV_Instance * | inst, |
RV_VKPipelineLayoutPtr | pipe_layout | ||
) |
|
virtual |
UT_UniquePtr<RV_ShaderVariableSet> RV_ShaderProgramBase::createSet | ( | RV_Instance * | inst, |
int | set_num | ||
) | const |
Create a shader varaible set (descriptor set) for set 'set_num'.
|
staticprotected |
|
staticprotected |
const RV_VKDescriptorBinding* RV_ShaderProgramBase::getBinding | ( | int | set, |
int | binding | ||
) | const |
Return a binding at index 'binding' for set index 'set'.
const RV_VKDescriptorBinding* RV_ShaderProgramBase::getBinding | ( | const UT_StringRef & | name | ) | const |
Return a binding for 'name'.
const UT_Array<const RV_VKDescriptorBinding*>& RV_ShaderProgramBase::getBindingList | ( | ) | const |
Return the list of set bindings.
|
inline |
The layout of all sets and inputs of the shader.
Definition at line 140 of file RV_ShaderProgram.h.
|
inline |
The number of descriptor sets in the shader.
Definition at line 103 of file RV_ShaderProgram.h.
const RV_Uniform* RV_ShaderProgramBase::getPushConstant | ( | const UT_StringRef & | name, |
int * | opt_idx | ||
) | const |
Fetch the push constant 'name' with an optional array index.
const UT_Array<RV_VKPushConstantRange>& RV_ShaderProgramBase::getPushConstantRanges | ( | ) | const |
|
inline |
Query information on set 'set_num'.
Definition at line 126 of file RV_ShaderProgram.h.
|
pure virtual |
Type of shader - graphics or compute.
Implemented in RV_ShaderCompute, and RV_ShaderProgram.
const RV_Uniform* RV_ShaderProgramBase::getUniform | ( | const UT_StringRef & | name | ) | const |
Return type, size, and offset information about the uniform.
const UT_Array<const RV_Uniform*>& RV_ShaderProgramBase::getUniformList | ( | ) | const |
Return a list of all uniforms in this shader.
bool RV_ShaderProgramBase::hasBinding | ( | const UT_StringRef & | name | ) | const |
Query if a binding named 'name' exists.
bool RV_ShaderProgramBase::hasPushConstant | ( | const UT_StringRef & | name | ) | const |
Query if push constant with 'name' exists.
|
inline |
Query if set 'set_num' is used by the shader.
Definition at line 108 of file RV_ShaderProgram.h.
bool RV_ShaderProgramBase::hasUniform | ( | const UT_StringRef & | name | ) | const |
Query if the uniform named 'name' exists.
|
inline |
Return true if 'set' is compatable with the set layout in this shader.
Definition at line 116 of file RV_ShaderProgram.h.
|
staticprotected |
|
inline |
Descriptive name of the shader.
Definition at line 94 of file RV_ShaderProgram.h.
|
inlinevirtual |
Debug print message.
Reimplemented in RV_ShaderCompute, and RV_ShaderProgram.
Definition at line 174 of file RV_ShaderProgram.h.
|
inline |
Set a descriptive name for the shader.
Definition at line 92 of file RV_ShaderProgram.h.
|
protected |
Definition at line 220 of file RV_ShaderProgram.h.
|
protected |
mapping of binding name to set + binding number
Definition at line 222 of file RV_ShaderProgram.h.
|
protected |
Definition at line 202 of file RV_ShaderProgram.h.
|
protected |
Definition at line 204 of file RV_ShaderProgram.h.
|
protected |
Definition at line 209 of file RV_ShaderProgram.h.
|
protected |
Definition at line 229 of file RV_ShaderProgram.h.
|
protected |
Definition at line 226 of file RV_ShaderProgram.h.
|
protected |
Definition at line 227 of file RV_ShaderProgram.h.
Definition at line 210 of file RV_ShaderProgram.h.
|
protected |
Definition at line 214 of file RV_ShaderProgram.h.
|
protected |
Mapping of uniform names, to indices in myUniforms.
Definition at line 216 of file RV_ShaderProgram.h.
|
protected |
Definition at line 231 of file RV_ShaderProgram.h.
|
protected |
Definition at line 232 of file RV_ShaderProgram.h.