169 return reinterpret_cast<T*
>(
BufferMap(
id));
179 BufferUpdate(
id, (
const void*)&data,
sizeof(TYPE), offset);
189 BufferUpdate(
id, (
const void*)data,
sizeof(TYPE) * count, offset);
217 BufferUpload(cmdBuf,
id, (
const void*)data,
sizeof(TYPE) * count, offset);
Nebula's dynamic array class.
Definition array.h:60
const SizeT ByteSize() const
return the byte size of the array.
Definition array.h:890
Iterator Begin() const
return iterator to beginning of array
Definition array.h:1245
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
Iterator Begin() const
get iterator to first element
Definition fixedarray.h:598
const SizeT ByteSize() const
get total byte size
Definition fixedarray.h:541
A StringAtom.
Definition stringatom.h:22
#define _DECL_ACQUIRE_RELEASE(ty)
Definition idallocator.h:88
#define ID_24_8_TYPE(x)
Definition id.h:132
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
void BufferUpdate(const BufferId id, const void *data, const uint size, const uint offset=0)
update buffer data
Definition vkbuffer.cc:361
void BufferUpdateArray(const BufferId id, const TYPE *data, const uint count, const uint offset=0)
update buffer data as array
Definition buffer.h:187
void * BufferMap(const BufferId id)
map memory
Definition vkbuffer.cc:341
void BufferUpload(const CoreGraphics::CmdBufferId cmdBuf, const BufferId id, const void *data, const uint size, const uint offset)
update buffer directly on command buffer during frame update, asserts if size is too big
Definition vkbuffer.cc:377
void BufferSparseCommitChanges(const BufferId id)
Commit sparse bindings.
Definition vkbuffer.cc:523
BufferAccessMode
Definition buffer.h:27
@ DeviceLocal
Definition buffer.h:28
@ HostCached
Definition buffer.h:30
@ HostLocal
Definition buffer.h:29
@ DeviceAndHost
Definition buffer.h:31
const SizeT BufferGetElementSize(const BufferId id)
get buffer element size, this is the size of a single element, like a vertex or index,...
Definition vkbuffer.cc:314
void BufferSparseMakeResident(const BufferId id, IndexT pageIndex)
Make a page resident.
Definition vkbuffer.cc:465
void BufferCopyWithStaging(const CoreGraphics::BufferId dest, const uint offset, const void *data, const uint size)
Shortcut for creating a staging buffer and copy.
Definition vkbuffer.cc:564
const BufferId CreateBuffer(const BufferCreateInfo &info)
create buffer
Definition vkbuffer.cc:52
void BufferInvalidate(const BufferId id, IndexT offset=0, SizeT size=NEBULA_WHOLE_BUFFER_SIZE)
invalidate buffer CPU side, such that any GPU changes will be made visible
Definition vkbuffer.cc:421
const SizeT BufferGetByteSize(const BufferId id)
get buffer total byte size
Definition vkbuffer.cc:323
uint BufferUsageFlags
Definition buffer.h:53
SizeT BufferSparseGetPageSize(const BufferId id)
Get the buffer page size.
Definition vkbuffer.cc:510
const SizeT BufferGetSize(const BufferId id)
get buffer size, which is the number of elements
Definition vkbuffer.cc:305
BufferUsageFlag
Definition buffer.h:35
@ AccelerationStructureScratch
Definition buffer.h:48
@ ConstantTexelBuffer
Definition buffer.h:40
@ TransferBufferSource
Definition buffer.h:37
@ AccelerationStructureInput
Definition buffer.h:49
@ InvalidBufferUsage
Definition buffer.h:36
@ IndexBuffer
Definition buffer.h:44
@ IndirectBuffer
Definition buffer.h:45
@ ShaderTable
Definition buffer.h:51
@ VertexBuffer
Definition buffer.h:43
@ AccelerationStructureData
Definition buffer.h:47
@ ConstantBuffer
Definition buffer.h:39
@ TransferBufferDestination
Definition buffer.h:38
@ ReadWriteTexelBuffer
Definition buffer.h:42
@ ReadWriteBuffer
Definition buffer.h:41
@ AccelerationStructureInstances
Definition buffer.h:50
@ ShaderAddress
Definition buffer.h:46
const SizeT BufferGetUploadMaxSize()
get maximum size of upload for BufferUpload
Definition vkbuffer.cc:332
BufferQueueSupport
Definition buffer.h:56
@ ComputeQueueSupport
Definition buffer.h:59
@ AutomaticQueueSupport
Definition buffer.h:57
@ TransferQueueSupport
Definition buffer.h:60
@ GraphicsQueueSupport
Definition buffer.h:58
uint BufferQueueSupportFlags
Definition buffer.h:62
void BufferSparseEvict(const BufferId id, IndexT pageIndex)
Evict a page.
Definition vkbuffer.cc:432
void BufferUnmap(const BufferId id)
unmap memory
Definition vkbuffer.cc:352
void BufferFlush(const BufferId id, IndexT offset=0, SizeT size=NEBULA_WHOLE_BUFFER_SIZE)
flush any changes done to the buffer on the CPU side so they are visible on the GPU
Definition vkbuffer.cc:410
void DestroyBuffer(const BufferId id)
destroy buffer
Definition vkbuffer.cc:281
IndexT BufferSparseGetPageIndex(const BufferId id, SizeT offset)
Get the page index given an offset.
Definition vkbuffer.cc:495
CoreGraphics::DeviceAddress BufferGetDeviceAddress(const BufferId id)
Get buffer device address.
Definition vkbuffer.cc:548
const BufferUsageFlags BufferGetType(const BufferId id)
get type of buffer
Definition vkbuffer.cc:296
void BufferFill(const CoreGraphics::CmdBufferId cmdBuf, const BufferId id, char pattern)
fill buffer with data much like memset
Definition vkbuffer.cc:387
Compile time configuration options for the CoreGraphics subsystem.
#define NEBULA_WHOLE_BUFFER_SIZE
Definition config.h:16
BufferAccessMode mode
Definition buffer.h:83
SizeT byteSize
Definition buffer.h:82
bool sparse
Definition buffer.h:86
BufferQueueSupportFlags queueSupport
Definition buffer.h:85
SizeT size
Definition buffer.h:80
SizeT elementSize
Definition buffer.h:81
BufferUsageFlags usageFlags
Definition buffer.h:84
const void * data
Definition buffer.h:87
Util::StringAtom name
Definition buffer.h:79
uint dataSize
Definition buffer.h:88
BufferCreateInfo()
Definition buffer.h:66
Set of buffers which creates a buffer per each buffered frame.
Definition buffer.h:225
Util::FixedArray< CoreGraphics::BufferId > buffers
Definition buffer.h:241
~BufferSet()
Destructor.
Definition buffer.cc:63
const CoreGraphics::BufferId Buffer()
Get current buffer.
Definition buffer.cc:55
void operator=(BufferSet &&rhs)
Move assignment.
Definition buffer.cc:41
BufferSet()
Default constructor.
Definition buffer.h:227
SizeT offset
Definition buffer.h:93
CoreGraphics::Alloc alloc
Definition buffer.h:94
const CoreGraphics::BufferId DeviceBuffer()
Get device buffer.
Definition buffer.cc:116
void Flush(const CoreGraphics::CmdBufferId cmdBuf, SizeT numBytes)
Flush changes on staging buffer to device.
Definition buffer.cc:134
BufferSet hostBuffers
Definition buffer.h:270
~BufferWithStaging()
Destructor.
Definition buffer.cc:145
BufferWithStaging()
Default constructor.
Definition buffer.h:250
const CoreGraphics::BufferId HostBuffer()
Get staging buffer for this frame.
Definition buffer.cc:125
CoreGraphics::BufferId deviceBuffer
Definition buffer.h:269
void operator=(BufferWithStaging &&rhs)
Move assignment.
Definition buffer.cc:104
Definition commandbuffer.h:155
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48