Nebula
Loading...
Searching...
No Matches
buffer.h File Reference
#include "config.h"
#include "ids/id.h"
#include "ids/idpool.h"
#include "util/stringatom.h"
#include "coregraphics/commandbuffer.h"
#include "gpubuffertypes.h"
#include "ids/idallocator.h"

Go to the source code of this file.

Classes

struct  CoreGraphics::BufferId
 
struct  CoreGraphics::BufferCreateInfo
 
struct  CoreGraphics::BufferSparsePage
 
struct  CoreGraphics::BufferSet
 Set of buffers which creates a buffer per each buffered frame. More...
 
struct  CoreGraphics::BufferWithStaging
 

Namespaces

namespace  CoreGraphics
 Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
 

Typedefs

typedef uint CoreGraphics::BufferUsageFlags
 
typedef uint CoreGraphics::BufferQueueSupportFlags
 

Enumerations

enum  CoreGraphics::BufferAccessMode { CoreGraphics::DeviceLocal , CoreGraphics::HostLocal , CoreGraphics::HostCached , CoreGraphics::DeviceAndHost }
 
enum  CoreGraphics::BufferUsageFlag {
  CoreGraphics::InvalidBufferUsage = 0x0 , CoreGraphics::TransferBufferSource = 0x1 , CoreGraphics::TransferBufferDestination = 0x2 , CoreGraphics::ConstantBuffer = 0x4 ,
  CoreGraphics::ConstantTexelBuffer = 0x8 , CoreGraphics::ReadWriteBuffer = 0x10 , CoreGraphics::ReadWriteTexelBuffer = 0x20 , CoreGraphics::VertexBuffer = 0x40 ,
  CoreGraphics::IndexBuffer = 0x80 , CoreGraphics::IndirectBuffer = 0x100 , CoreGraphics::ShaderAddress = 0x200 , CoreGraphics::AccelerationStructureData = 0x400 ,
  CoreGraphics::AccelerationStructureScratch = 0x800 , CoreGraphics::AccelerationStructureInput = 0x1000 , CoreGraphics::AccelerationStructureInstances = 0x2000 , CoreGraphics::ShaderTable = 0x4000
}
 
enum  CoreGraphics::BufferQueueSupport { CoreGraphics::AutomaticQueueSupport = 0x0 , CoreGraphics::GraphicsQueueSupport = 0x1 , CoreGraphics::ComputeQueueSupport = 0x2 , CoreGraphics::TransferQueueSupport = 0x4 }
 

Functions

 CoreGraphics::_DECL_ACQUIRE_RELEASE (BufferId)
 
const BufferId CoreGraphics::CreateBuffer (const BufferCreateInfo &info)
 create buffer
 
void CoreGraphics::DestroyBuffer (const BufferId id)
 destroy buffer
 
const BufferUsageFlags CoreGraphics::BufferGetType (const BufferId id)
 get type of buffer
 
const SizeT CoreGraphics::BufferGetSize (const BufferId id)
 get buffer size, which is the number of elements
 
const SizeT CoreGraphics::BufferGetElementSize (const BufferId id)
 get buffer element size, this is the size of a single element, like a vertex or index, and is multiplied with the size
 
const SizeT CoreGraphics::BufferGetByteSize (const BufferId id)
 get buffer total byte size
 
const SizeT CoreGraphics::BufferGetUploadMaxSize ()
 get maximum size of upload for BufferUpload
 
void * CoreGraphics::BufferMap (const BufferId id)
 map memory
 
template<class T >
T * CoreGraphics::BufferMap (const BufferId id)
 map memory and cast to type
 
void CoreGraphics::BufferUnmap (const BufferId id)
 unmap memory
 
void CoreGraphics::BufferUpdate (const BufferId id, const void *data, const uint size, const uint offset=0)
 update buffer data
 
void CoreGraphics::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
 
template<class TYPE >
void CoreGraphics::BufferUpdate (const BufferId id, const TYPE &data, const uint offset=0)
 update buffer data
 
template<class TYPE >
void CoreGraphics::BufferUpdateArray (const BufferId id, const TYPE *data, const uint count, const uint offset=0)
 update buffer data as array
 
template<class TYPE >
void CoreGraphics::BufferUpdateArray (const BufferId id, const Util::Array< TYPE > &data, const uint offset=0)
 Update buffer data as array.
 
template<class TYPE >
void CoreGraphics::BufferUpdateArray (const BufferId id, const Util::FixedArray< TYPE > &data, const uint offset=0)
 Update buffer data as array.
 
template<class TYPE >
void CoreGraphics::BufferUpload (const CoreGraphics::CmdBufferId cmdBuf, const BufferId id, const TYPE *data, const uint count=1, const uint offset=0)
 upload data from pointer directly to buffer through submission context
 
void CoreGraphics::BufferFill (const CoreGraphics::CmdBufferId cmdBuf, const BufferId id, char pattern)
 fill buffer with data much like memset
 
void CoreGraphics::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
 
void CoreGraphics::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
 
void CoreGraphics::BufferSparseEvict (const BufferId id, IndexT pageIndex)
 Evict a page.
 
void CoreGraphics::BufferSparseMakeResident (const BufferId id, IndexT pageIndex)
 Make a page resident.
 
IndexT CoreGraphics::BufferSparseGetPageIndex (const BufferId id, SizeT offset)
 Get the page index given an offset.
 
SizeT CoreGraphics::BufferSparseGetPageSize (const BufferId id)
 Get the buffer page size.
 
void CoreGraphics::BufferSparseCommitChanges (const BufferId id)
 Commit sparse bindings.
 
CoreGraphics::DeviceAddress CoreGraphics::BufferGetDeviceAddress (const BufferId id)
 Get buffer device address.
 
void CoreGraphics::BufferCopyWithStaging (const CoreGraphics::BufferId dest, const uint offset, const void *data, const uint size)
 Shortcut for creating a staging buffer and copy.