14 #ifndef RV_ShaderProgram_h
15 #define RV_ShaderProgram_h
54 : myName(name), myLocation(location)
55 , myType(type), myVecSize(vec_size)
68 : myDefaultAttributes(0)
109 return myLayout->getInfo().myDescriptorSets.size() - 1;
115 && set_num < myLayout->getInfo().myDescriptorSets.size()
116 && myLayout->getInfo().myDescriptorSets[set_num].isValid();
125 return hasSet(set_num)
126 ? &getLayout().getInfo().myDescriptorSets[set_num]
182 const char* extra_defines =
nullptr);
258 const char* extra_defines =
nullptr);
264 const char*
name =
nullptr);
270 const char*
name =
nullptr);
276 const char*
name =
nullptr);
309 int& out_vec_size)
const;
323 void print()
const override;
339 const PipelineCache &cache,
344 PipelineCache &cache,
349 PipelineCache myMainPipelineCache;
350 PipelineCache myThreadedPipelineCache;
382 const char* extra_defines =
nullptr);
410 {
return myLayout->getInfo().myWorkGroupSize; }
413 {
return myLayout->getInfo().myWorkGroupIsSpecConst; }
420 void print()
const override;
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
UT_Array< const RV_VKDescriptorBinding * > myBindings
bool hasWorkGroupSpecializationConst() const
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'.
const UT_Vector3i & getWorkGroupSize() const
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.
GLint GLint GLsizei GLint GLenum GLenum type
friend RV_ShaderVariableSet
static RV_VKPipelineLayoutPtr loadShaderProgram(RV_Instance *inst, const char *program, const char *extra_defines=nullptr)
constexpr auto set(type rhs) -> int
RAII wrapper class for VkPipeline.
const UT_Array< exint > & layoutIds() const
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)
RAII wrapper class for Vk Shader Module.
void setName(const UT_StringHolder &name)
Set a descriptive name for the shader.
UT_Array< const RV_Uniform * > myPushConstants
UT_SmallArray< exint, 8 *sizeof(exint)> mySetLayoutIds
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
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.