14 #ifndef RV_ShaderProgram_h
15 #define RV_ShaderProgram_h
54 : myName(name), myLocation(location)
55 , myType(type), myVecSize(vec_size)
68 : myDefaultAttributes(0)
105 return myLayout->getInfo().myDescriptorSets.size() - 1;
111 && set_num < myLayout->getInfo().myDescriptorSets.size()
112 && myLayout->getInfo().myDescriptorSets[set_num].isValid();
121 return mySetLayoutIds.isValidIndex(set_num) &&
122 other_id == mySetLayoutIds[set_num];
128 return hasSet(set_num)
129 ? &getLayout().getInfo().myDescriptorSets[set_num]
185 const char* extra_defines =
nullptr);
191 const char*
name =
nullptr);
197 const char*
name =
nullptr);
273 const char* extra_defines =
nullptr);
279 const char*
name =
nullptr);
285 const char*
name =
nullptr);
291 const char*
name =
nullptr);
320 int& out_vec_size)
const;
334 void print()
const override;
386 const char* extra_defines =
nullptr);
413 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
static RV_VKPipelineLayoutPtr loadShaderProgram(RV_Instance *inst, const char *program, const char *extra_defines=nullptr)
bool isSetCompatible(const RV_ShaderVariableSet &set) const
Return true if 'set' is compatable with the set layout in this shader.
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
static RV_VKPipelineLayoutPtr createShaderProgram(RV_Instance *inst, RV_VKShader &shader, const char *name=nullptr)
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)
int getSetNumber() const
Return the binding number of the set that this set was created with.
void setName(const UT_StringHolder &name)
Set a descriptive name for the shader.
UT_Array< const RV_Uniform * > myPushConstants
UT_UniquePtr< RV_VKPipelineLayout > RV_VKPipelineLayoutPtr
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_UniquePtr< RV_VKPipeline > RV_VKPipelinePtr
UT_Array< const RV_Uniform * > myUniforms
int getLayoutID() const
Return the layout ID of the set that this set was created with.
UT_Array< exint > mySetLayoutIds
GLbitfield GLuint program
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.