14 #ifndef RV_ShaderProgram_h
15 #define RV_ShaderProgram_h
53 : myName(name), myLocation(location)
54 , myType(type), myVecSize(vec_size)
67 : myDefaultAttributes(0)
104 return myLayout->getInfo().myDescriptorSets.size() - 1;
110 && set_num < myLayout->getInfo().myDescriptorSets.size()
111 && myLayout->getInfo().myDescriptorSets[set_num].isValid();
118 return hasSet(set_num)
119 ? &getLayout().getInfo().myDescriptorSets[set_num]
175 const char* extra_defines =
nullptr);
181 const char*
name =
nullptr);
187 const char*
name =
nullptr);
262 const char* extra_defines =
nullptr);
268 const char*
name =
nullptr);
274 const char*
name =
nullptr);
280 const char*
name =
nullptr);
309 int& out_vec_size)
const;
323 void print()
const override;
375 const char* extra_defines =
nullptr);
402 void print()
const override;
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
UT_Array< const RV_VKDescriptorBinding * > myBindings
UT_Array< RV_ShaderInput > myInputs
RV_ShaderType getShaderType() const override
Type of the shader, Graphics or Compute.
Object that represents drawable geometry. This object holds vertex, instancing and index buffers for ...
int getMaxSetNumber() const
The number of descriptor sets in the shader.
std::tuple< Types...> UT_Tuple
const RV_VKDescriptorSetInfo * getSetInfo(int set_num) const
Query information on set 'set_num'.
UT_ArrayStringMap< int > myInputTable
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
const UT_StringHolder & name() const
Descriptive name of the shader.
bool hasSet(int set_num) const
Query if set 'set_num' is used by the shader.
friend RV_ShaderVariableSet
RAII wrapper class for VkPipeline.
RV_API RV_VKDescriptorBinding loadShaderBlock(RV_Instance *inst, const char *block)
UT_ArrayStringMap< int > myUniformTable
Mapping of uniform names, to indices in myUniforms.
UT_ArrayStringMap< std::pair< int, int > > myBindingTable
mapping of binding name to set + binding number
GLuint const GLchar * name
UT_UniquePtr< const RV_VKPipelineLayout > myLayout
virtual void print() const
Debug print message.
Handle to the main interface of Vulkan.
const RV_ShaderInputState & getInputState() const
The list and state of vertex shader inputs (attributes)
void setName(const UT_StringHolder &name)
Set a descriptive name for the shader.
UT_Array< const RV_Uniform * > myPushConstants
static RV_VKPipelineLayout * loadShaderProgram(RV_Instance *inst, const char *program, const char *extra_defines=nullptr)
UT_ArrayStringMap< int > myPushConstTable
UT_UniquePtr< RV_VKPipeline > myPipeline
const RV_VKPipelineLayout & getLayout() const
The layout of all sets and inputs of the shader.
UT_Array< const RV_Uniform * > myUniforms
GLbitfield GLuint program
static RV_VKPipelineLayout * createShaderProgram(RV_Instance *inst, RV_VKShader &shader, const char *name=nullptr)
const UT_Array< RV_ShaderInput > & getAttributeList() const
The list of vertex shader inputs (attributes)
RV_ShaderType getShaderType() const override
Type of shader - graphics or compute.