class GpuMem

Defined at line 19 of file ../../src/ui/lib/escher/vk/gpu_mem.h

Ref-counted wrapper around a vk::DeviceMemory. Supports sub-allocation.

Public Methods

GpuMemPtr AdoptVkMemory (vk::Device device, vk::DeviceMemory mem, vk::DeviceSize size, bool needs_mapped_ptr)

Create a GpuMem that takes ownership of |mem|, which will be destroyed when

the GpuMem dies. Guaranteed to return a non-null result.

Defined at line 18 of file ../../src/ui/lib/escher/vk/gpu_mem.cc

GpuMemPtr Suballocate (vk::DeviceSize size, vk::DeviceSize offset)

Sub-allocate a GpuMem that represents a sub-range of the memory in this

GpuMem. Since these sub-allocations reference the parent GpuMem, the

parent will not be destroyed while outstanding sub-allocations exist.

Returns nullptr if the requested offset/size do not fit within the current

GpuMem.

Note: no bookkeeping ensures that sub-allocations do not overlap!

Defined at line 23 of file ../../src/ui/lib/escher/vk/gpu_mem.cc

vk::DeviceMemory base ()

Defined at line 34 of file ../../src/ui/lib/escher/vk/gpu_mem.h

vk::DeviceSize size ()

Defined at line 35 of file ../../src/ui/lib/escher/vk/gpu_mem.h

vk::DeviceSize offset ()

Defined at line 36 of file ../../src/ui/lib/escher/vk/gpu_mem.h

uint8_t * mapped_ptr ()

Defined at line 37 of file ../../src/ui/lib/escher/vk/gpu_mem.h

Protected Methods

void GpuMem (vk::DeviceMemory base, vk::DeviceSize size, vk::DeviceSize offset, uint8_t * mapped_ptr)

|offset| + |size| must be

<

= the size of |base|. This class does not

takes ownership of |base| by default.

Defined at line 12 of file ../../src/ui/lib/escher/vk/gpu_mem.cc

void ~GpuMem ()

Defined at line 16 of file ../../src/ui/lib/escher/vk/gpu_mem.cc

Friends

class RefCountedThreadSafe