class
buffercontainer class for GPU data.
core::
constructors, destructors, conversion operators
member-functions
Function documentation
core:: data:: buffer:: buffer(core::resource::cache& cache,
const core:: resource:: metadata& metaData,
psl:: meta:: file* metaFile,
core::gfx::memory_usage usage,
core::gfx::memory_property memoryPropertyFlags,
memory:: region&& memory_region) noexcept
Details
will do the minimal setup needed, no allocations happen at this point yet.
Parameters | |
---|---|
cache in | which cache this object has been allocated in |
metaData | |
metaFile | |
usage in | the usage flags that signify how the resource should be used by the GPU |
memoryPropertyFlags in | what are the properties of the memory (i.e. where does it live) |
memory_region in | what is the owning region of this memory. Note that this parameter also will dictate the size and alignment of the resource. |
size_t core:: data:: buffer:: size() const
Returns | the total size in the memory:: |
---|
core::gfx::memory_usage core:: data:: buffer:: usage() const
Returns | the core::gfx::memory_usage of this instance, showing the type of resource this is for the GPU |
---|
core::gfx::memory_property core:: data:: buffer:: memoryPropertyFlags() const
Returns | the core::gfx::memory_property, so you know where the data lives. |
---|
const memory:: region& core:: data:: buffer:: region() const
Details
Returns | the associated memory:: |
---|
const std::vector<memory:: segment>& core:: data:: buffer:: segments() const
Returns | all committed memory::segments in the memory:: |
---|
std::optional<memory:: segment> core:: data:: buffer:: allocate(size_t size)
Details
Will try to allocate a new memory::
Parameters | |
---|---|
size in | the minimum expected size, this will auto-align/grow to the alignment requirements. |
Returns | optionally, a new allocated memory:: |
bool core:: data:: buffer:: deallocate(memory:: segment& segment)
Details
Parameters | |
---|---|
segment in | the target segment to deallocate. |
Returns | true in case the deallocation was successful. |