14 #ifndef RV_ShaderVariableSet_h
15 #define RV_ShaderVariableSet_h
54 const char*
name =
nullptr);
61 const char*
name =
nullptr);
69 return myBindingResourceIdx.isValidIndex(binding_num) &&
70 myBindingResourceIdx[binding_num] != -1;
81 VkDescriptorSet getVkDescriptorSet();
84 {
return *myLayout.get(); }
101 bool getBufferBlock(
int binding_num,
const RV_ShaderBlock*& out_block)
112 bool getTexture(
int binding_num,
RV_VKImage*& out_image);
115 bool getTexture(
int binding_num,
const RV_VKImage*& out_image)
const;
125 bool getBufferView(
int binding_num,
RV_VKBuffer*& out_buffer);
128 bool getBufferView(
int binding_num,
const RV_VKBuffer*& out_buffer)
const;
137 bool attachBufferBlock(
145 bool attachBufferBlock(
154 bool attachBufferView(
162 bool attachBufferView(
208 void clearBinding(
int binding_num);
209 void clearBinding(
RV_Render*
r,
int binding_num);
211 void clearExtraBindings();
224 inline bool isDirty()
const;
236 {
return mySetNumber; }
252 bool isValidBinding(uint32_t binding_num,
int index=0)
const;
256 int& out_binding_num,
293 typedef std::pair<RV_ShaderBlock*, exint> BufferBlockResource;
294 typedef std::pair<RV_VKBuffer*, exint> BufferResource;
295 typedef std::tuple<RV_VKImage*, exint, RV_VKSampler*> TextureResource;
303 RV_BINDING_UNKNOWN = 0,
310 struct BindingResource
314 BindingResource(RV_BindingType
type,
325 : myType(RV_BINDING_BLOCK)
330 : myType(RV_BINDING_BUFFER)
335 : myType(RV_BINDING_IMAGE)
340 RV_BindingType myType = RV_BINDING_UNKNOWN;
351 const BindingResource &res);
363 typedef std::tuple<int, int, RV_BindingType> BindingRef;
366 bool myIsSetDirty =
false;
A collection of Vulkan UBO, SSBO, and Image shader bindings (descriptor set)
GLenum GLenum GLsizei void * image
const RV_VKDescriptorSetInfo & getSetInfo() const
The raw Vulkan descritor set create info.
bool isCompatibleToBind(const RV_VKDescriptorSetInfo &other) const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
GLuint const GLchar * name
Handle to the main interface of Vulkan.
bool hasBinding(uint32_t binding_num) const
Returns true if binding exists.
int getSetNumber() const
Return the binding number of the set that this set was created with.
bool isCompatibleToBind(const RV_VKDescriptorSetInfo &pipe_layout) const
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
int getLayoutID() const
Return the layout ID of the set that this set was created with.
bool bindSet(RV_ShaderVariableSet *set, const RV_ShaderProgramBase *shr)
Bind a variable set to the specific shader program.