45 : myInst(inst), myVkView(vk_view), myVkFormat(vk_format)
54 : myInst(other.myInst)
55 , myVkView(other.myVkView)
56 , myVkFormat(other.myVkFormat)
58 other.myInst =
nullptr;
96 const char*
name =
nullptr);
110 return myView ? myView->getVkView()
116 return myView ? myView->getVkFormat()
127 exint entries()
const;
131 int getVectorSize()
const;
140 exint data_offset = 0);
147 exint data_offset = 0);
167 bool isMappedMemory()
const;
171 void* getMappedMemory();
176 exint src_offset = 0,
177 exint dst_offset = 0,
190 { addBarrier(r, myLastUsage, new_usage); }
GLenum GLuint GLenum GLsizei const GLchar * buf
VkFormat getVkFormat() const
VkBuffer getVkBuf()
Get the raw vulkan buffer handle.
VkFlags VkBufferUsageFlags
constexpr span< ElementType, Extent > make_span(span< ElementType, Extent > s) noexcept
UT_UniquePtr< RV_VKBuffer > RV_VKBufferPtr
const RV_VKBufferCreateInfo & getInfo()
Get the create info the buffer was created with.
GLsizei const GLfloat * value
exint getID() const
Return unique ID for buffer object.
VkBufferView getVkView()
Fetch the buffer view assigned to this buffer, if any.
UT_UniquePtr< RV_VKMemory > RV_VKMemoryPtr
bool uploadData(RV_Render *r, VkBufferUsageFlags new_usage, const T &data)
exint getSize() const
Return the size of the buffer, in bytes.
UT_UniquePtr< RV_VKMemory > myMemory
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
bool uploadData(RV_Render *r, const T &data)
Span version of buffer upload.
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.
UT_UniquePtr< RV_VKBufferView > RV_VKBufferViewPtr
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.