44 : myInst(inst), myVkView(vk_view), myVkFormat(vk_format)
53 : myInst(other.myInst)
54 , myVkView(other.myVkView)
55 , myVkFormat(other.myVkFormat)
57 other.myInst =
nullptr;
95 const char*
name =
nullptr);
107 return myView ? myView->getVkView()
113 return myView ? myView->getVkFormat()
124 exint entries()
const;
128 int getVectorSize()
const;
137 exint data_offset = 0);
144 exint data_offset = 0);
165 { addBarrier(r, myLastUsage, new_usage); }
VkFormat getVkFormat() const
VkBuffer getVkBuf()
Get the raw vulkan buffer handle.
VkFlags VkBufferUsageFlags
constexpr span< ElementType, Extent > make_span(span< ElementType, Extent > s) noexcept
const RV_VKBufferCreateInfo & getInfo()
Get the create info the buffer was created with.
GLsizei const GLfloat * value
VkBufferView getVkView()
Fetch the buffer view assigned to this buffer, if any.
exint getSize() const
Return the size of the buffer, in bytes.
UT_UniquePtr< RV_VKMemory > myMemory
bool uploadData(RV_Render *r, const T &data, exint offset=0)
Span version of buffer upload.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
VkBufferUsageFlags myLastUsage
UT_UniquePtr< RV_VKBufferView > myView
UT_UniquePtr< const RV_VKBufferCreateInfo > myCreateInfo
RV_VKMemory & getMemory()
Get the memory the buffer is backed by.
GLuint const GLchar * name
Handle to the main interface of Vulkan.
RV_VKBufferView(RV_VKBufferView &&other) noexcept
VkBufferUsageFlags getLastUsage() const
return the current usage of this buffer
VkFormat getVkFormat() const
Return the vulkan format of the buffer.
GLsizeiptr const void GLenum usage
VKAPI_ATTR void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks *pAllocator)
constexpr size_type size_bytes() const noexcept
VkBufferUsageFlags getUsage() const
return the vulkan usage of the buffer when it was created
VkDevice getDevice()
Get the raw vulkan device assocated with this instance.
RAII wrapper class for VkBufferView.
RV_VKBufferView & operator=(RV_VKBufferView &)=delete
VkBufferCreateInfo RV_VKBufferCreateInfo
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
constexpr pointer data() const noexcept
RV_VKBufferView(RV_Instance *inst, VkBufferView vk_view, VkFormat vk_format)
void addBarrier(RV_Render *r, VkBufferUsageFlags new_usage)
Add a barrier for using the buffer in the future.