13#ifndef _CS237_MEMORY_OBJ_HPP_
14#define _CS237_MEMORY_OBJ_HPP_
17#error "cs237/memory.hpp should not be included directly"
34 void copyTo (
const void *src,
size_t offset,
size_t sz)
36 assert (offset + sz <= this->
_sz);
41 auto dst = dev.mapMemory(this->
_mem, offset, this->_sz, {});
53 size_t size ()
const {
return this->
_sz; }
the base class for applications
Definition application.hpp:25
vk::Device _device
the logical device that we are using to render
Definition application.hpp:443
A base class for buffer objects of all kinds.
Definition buffer.hpp:23
wrapper around Vulkan memory objects
Definition memory-obj.hpp:23
Application * _app
the application
Definition memory-obj.hpp:58
size_t size() const
the size of the memory object in bytes
Definition memory-obj.hpp:53
MemoryObj(Application *app, vk::MemoryRequirements const &reqs)
vk::DeviceMemory _mem
the device memory object
Definition memory-obj.hpp:59
size_t _sz
the size of the memory object
Definition memory-obj.hpp:60
void copyTo(const void *src, size_t offset, size_t sz)
Definition memory-obj.hpp:34
vk::DeviceMemory getDeviceMemory()
Definition memory-obj.hpp:55
void copyTo(const void *src)
Definition memory-obj.hpp:50