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;
89 VkFormat vk_format = VK_FORMAT_UNDEFINED,
90 const char*
name =
nullptr,
103 VkFormat vk_format = VK_FORMAT_UNDEFINED,
104 const char*
name =
nullptr,
105 exint alignment = 0);
120 exint gpuMemoryUsage()
const;
133 return myView ? myView->getVkView()
139 return myView ? myView->getVkFormat()
150 exint entries()
const;
154 int getVectorSize()
const;
165 exint data_offset = 0);
172 exint data_offset = 0);
192 bool isMappedMemory()
const;
196 void* getMappedMemory();
200 RV_VKBuffer* dst_buf,
201 exint src_offset = 0,
202 exint dst_offset = 0,
218 { addBarrier(r, myLastUsage, new_usage); }
225 virtual ~RV_VKBuffer();
VkFormat getVkFormat() const
VkBuffer getVkBuf()
Get the raw vulkan buffer handle.
VkFlags VkBufferUsageFlags
constexpr span< ElementType, Extent > make_span(span< ElementType, Extent > s) noexcept
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
UT_UniquePtr< RV_VKBuffer > RV_VKBufferPtr
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.
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
GLint GLint GLsizei GLint GLenum GLenum type
UT_UniquePtr< const RV_VKBufferCreateInfo > myCreateInfo
const UT_StringHolder & getName() const
Return label for buffer object.
bool uploadData(RV_Render *r, const T &data)
Span version of buffer upload.
RV_VKMemory & getMemory()
Get the memory the buffer is backed by.
const RV_ResourceID & getID() const
Return unique ID for buffer object.
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
LeafData & operator=(const LeafData &)=delete
constexpr size_type size_bytes() const noexcept
VkBufferUsageFlags getUsage() const
return the vulkan usage of the buffer when it was created
UT_UniquePtr< RV_VKBufferView > RV_VKBufferViewPtr
RAII wrapper class for VkBufferView.
const RV_VKMemory & getMemory() const
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.