105 const bool operator==(
const std::nullptr_t)
const;
107 const bool operator!=(
const std::nullptr_t)
const;
112 uint64_t timelineIndex;
166#ifdef NEBULA_ENABLE_PROFILING
221 ,
const char* name =
nullptr
342#if NEBULA_ENABLE_PROFILING
348SizeT GetNumDrawCalls();
351#if NEBULA_GRAPHICS_DEBUG
353template<
typename OBJECT_ID_TYPE>
void ObjectSetName(
const OBJECT_ID_TYPE
id,
const char* name);
369 const uint uploadSize =
sizeof(TYPE);
382 const uint uploadSize =
sizeof(TYPE) * numElements;
415 const uint uploadSize =
sizeof(TYPE);
417 if (buffer != CoreGraphics::InvalidBufferId)
429 const uint uploadSize =
sizeof(TYPE) * numElements;
431 if (buffer != CoreGraphics::InvalidBufferId)
443 const uint uploadSize =
sizeof(TYPE);
454 const uint uploadSize =
sizeof(TYPE) * numElements;
466 if (buffer != CoreGraphics::InvalidBufferId)
Code
index types enum
Definition indextype.h:22
Defines a group of primitives as a subset of a vertex buffer and index buffer plus the primitive topo...
Definition primitivegroup.h:20
Code
enumeration
Definition primitivetopology.h:23
Render events are sent by the RenderDevice to registered render event handlers.
Definition renderevent.h:19
A 2d rectangle class.
Definition rectangle.h:20
Allocates memory ranges using the TLSF method, with extended handling of padding to better suit GPUs.
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
A collection of unique values with quick lookup.
Definition set.h:34
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
uint MaxResourceTableReadWriteBuffers
Definition vkgraphicsdevice.cc:738
uint MaxPushConstantSize
Definition vkgraphicsdevice.cc:726
uint64 MaxConstantBufferSize
Definition vkgraphicsdevice.cc:725
void DelayedDeleteBuffer(const CoreGraphics::BufferId id)
Add buffer to delete queue.
Definition vkgraphicsdevice.cc:1941
CoreGraphics::ImageFileFormat::Code SaveScreenshot(CoreGraphics::ImageFileFormat::Code fmt, const Ptr< IO::Stream > &outStream)
save a screenshot to the provided stream
Definition vkgraphicsdevice.cc:2391
void DelayedDeletePass(const CoreGraphics::PassId id)
Add a pass to delayed delete.
Definition vkgraphicsdevice.cc:2023
bool GetRenderWireframe()
get the render as wireframe flag
Definition vkgraphicsdevice.cc:2427
bool PollSubmissionIndex(const CoreGraphics::QueueType queue, uint64 index)
Poll a submission for completion.
Definition vkgraphicsdevice.cc:1645
ConstantBufferOffset AllocateConstantBufferMemory(uint size)
Reserve range of constant buffer memory and return offset.
Definition vkgraphicsdevice.cc:1819
void DelayedDeleteCommandBuffer(const CoreGraphics::CmdBufferId id)
Add command buffer to late deletion.
Definition vkgraphicsdevice.cc:1981
void UnlockGraphicsSetupCommandBuffer(CoreGraphics::CmdBufferId cmdBuf)
Release lock on immediate graphics command buffer.
Definition vkgraphicsdevice.cc:1600
void SubmitImmediateCommandBuffers()
Submit immediate command buffers.
Definition vkgraphicsdevice.cc:1712
IndexT GetQueueIndex(const QueueType queue)
Get queue index.
Definition vkgraphicsdevice.cc:2094
uint TimestampPeriod
Definition vkgraphicsdevice.cc:746
void WaitAndClearPendingCommands()
wait for all queues to finish
Definition vkgraphicsdevice.cc:1916
const Util::Set< uint32_t > & GetQueueIndices()
Get queue indices.
Definition vkgraphicsdevice.cc:2103
uint ReadWriteBufferAlignment
Definition vkgraphicsdevice.cc:723
const CoreGraphics::BufferId GetVertexBuffer()
Get vertex buffer.
Definition vkgraphicsdevice.cc:2152
bool VariableRateShadingSupported
Definition vkgraphicsdevice.cc:720
QueryType
Definition config.h:52
void RemoveBackBufferTexture(const CoreGraphics::TextureId tex)
remove a render texture
Definition vkgraphicsdevice.cc:1538
const CoreGraphics::CmdBufferId LockGraphicsSetupCommandBuffer(const char *name=nullptr)
Lock immediate graphics command buffer.
Definition vkgraphicsdevice.cc:1581
bool NotifyEventHandlers(const CoreGraphics::RenderEvent &e)
notify event handlers about an event
Definition vkgraphicsdevice.cc:1511
Util::Pair< Memory::RangeAllocation, CoreGraphics::BufferId > AllocateUpload(const SizeT numBytes, const SizeT alignment=1)
Allocate upload memory.
Definition vkgraphicsdevice.cc:2210
void ReloadShaderProgram(const CoreGraphics::ShaderProgramId &pro)
trigger reloading a shader
Definition vkgraphicsdevice.cc:1855
void DelayedDeleteTextureView(const CoreGraphics::TextureViewId id)
Add texture view to delete queue.
Definition vkgraphicsdevice.cc:1969
Util::Pair< Memory::RangeAllocation, CoreGraphics::BufferId > Upload(const TYPE &data, const SizeT alignment=1)
Upload single item to GPU source buffer.
Definition graphicsdevice.h:413
bool DynamicVertexInputSupported
Definition vkgraphicsdevice.cc:718
void AddBackBufferTexture(const CoreGraphics::TextureId tex)
add a render texture used by the back buffer
Definition vkgraphicsdevice.cc:1529
QueueType
Definition config.h:40
void RemoveEventHandler(const Ptr< CoreGraphics::RenderEventHandler > &h)
remove a render event handler
Definition vkgraphicsdevice.cc:1497
bool MeshShadersSupported
Definition vkgraphicsdevice.cc:719
uint AccelerationStructureScratchAlignment
Raytracing properties.
Definition vkgraphicsdevice.cc:748
void FreeUploads(const Util::Array< Memory::RangeAllocation > &allocations)
Free upload allocations directly.
Definition vkgraphicsdevice.cc:2241
void FlushUploads(const Util::Array< Memory::RangeAllocation > &allocations)
Flush upload allocations directly.
Definition vkgraphicsdevice.cc:2254
void FinishFrame(IndexT frameIndex)
Finish current frame.
Definition vkgraphicsdevice.cc:1864
IndexT GetBufferedFrameIndex()
get current frame index, which is between 0 and GetNumBufferedFrames
Definition vkgraphicsdevice.cc:1475
CoreGraphics::BufferId GetConstantBuffer(IndexT i)
return id to global graphics constant buffer
Definition vkgraphicsdevice.cc:1846
uint MaxResourceTableSamplers
Definition vkgraphicsdevice.cc:742
@ NumMemoryPoolTypes
Memory which is visible on both device and host side.
Definition memory.h:37
void DelayedDeleteBlas(const CoreGraphics::BlasId id)
Add a blas for delayed delete.
Definition vkgraphicsdevice.cc:2036
uint MaxResourceTableConstantBuffers
Definition vkgraphicsdevice.cc:736
CmdPipelineBuildBits
Definition commandbuffer.h:54
uint ConstantBufferOffset
Definition config.h:21
bool NvidiaCheckpointsSupported
Definition vkgraphicsdevice.cc:721
void FinishQueries(const CoreGraphics::CmdBufferId cmdBuf, const CoreGraphics::QueryType type, IndexT *starts, SizeT *counts, SizeT numCopies)
Copy query results to buffer.
Definition vkgraphicsdevice.cc:2076
uint64 SparseAddressSize
Definition vkgraphicsdevice.cc:727
void EnqueueUploadsFlushAndFree(const Util::Array< Memory::RangeAllocation > &allocations)
Queue uploads to flush and free at immediate submit.
Definition vkgraphicsdevice.cc:2281
uint MemoryRangeGranularity
Definition vkgraphicsdevice.cc:745
SizeT GetNumBufferedFrames()
get number of buffered frames
Definition vkgraphicsdevice.cc:1466
const CoreGraphics::BufferId GetIndexBuffer()
Get index buffer.
Definition vkgraphicsdevice.cc:2200
void DelayedDeleteTexture(const CoreGraphics::TextureId id)
Add texture to delete queue.
Definition vkgraphicsdevice.cc:1955
uint MaxPerStageConstantBuffers
Definition vkgraphicsdevice.cc:729
void UnlockTransferHandoverSetupCommandBuffer(CoreGraphics::CmdBufferId cmdBuf)
Release lock on handover command buffer.
Definition vkgraphicsdevice.cc:1632
void SetVisualizeMipMaps(bool val)
set visualization of mipmaps flag
Definition vkgraphicsdevice.cc:2418
const CoreGraphics::CmdBufferId LockTransferSetupCommandBuffer()
Lock resource command buffer.
Definition vkgraphicsdevice.cc:1549
uint AllocateQueries(const CoreGraphics::QueryType type, uint numQueries)
Allocate a range of queries.
Definition vkgraphicsdevice.cc:2060
void DestroyGraphicsDevice()
destroy graphics device
Definition vkgraphicsdevice.cc:1391
uint MaxPerStageInputAttachments
Definition vkgraphicsdevice.cc:734
SubmissionWaitEvent SubmitCommandBuffers(const Util::Array< CoreGraphics::CmdBufferId, 8 > &cmds, CoreGraphics::QueueType type, Util::Array< CoreGraphics::SubmissionWaitEvent, 8 > waitEvents=nullptr)
Submit a command buffer, but doesn't necessarily execute it immediately.
Definition vkgraphicsdevice.cc:1663
uint MaxPerStageReadWriteBuffers
Definition vkgraphicsdevice.cc:730
uint ShaderGroupAlignment
Definition vkgraphicsdevice.cc:749
uint MaxResourceTableSampledImages
Definition vkgraphicsdevice.cc:740
void UnlockConstantUpdates()
Unlock constants.
Definition vkgraphicsdevice.cc:1789
void DeallocateIndices(const VertexAlloc &alloc)
Deallocate indices.
Definition vkgraphicsdevice.cc:2189
void DeallocateVertices(const VertexAlloc &alloc)
Deallocate vertices.
Definition vkgraphicsdevice.cc:2141
void SetConstantsInternal(ConstantBufferOffset offset, const void *data, SizeT size)
Use pre-allocated range of memory to update graphics constants.
Definition vkgraphicsdevice.cc:1810
void DelayedDeleteTlas(const CoreGraphics::TlasId id)
Add a tlas for delayed delete.
Definition vkgraphicsdevice.cc:2048
void AttachEventHandler(const Ptr< CoreGraphics::RenderEventHandler > &h)
attach a render event handler
Definition vkgraphicsdevice.cc:1484
bool GetVisualizeMipMaps()
get visualization of mipmaps flag
Definition vkgraphicsdevice.cc:2409
uint MaxPerStageReadWriteImages
Definition vkgraphicsdevice.cc:732
bool RayTracingSupported
Definition vkgraphicsdevice.cc:717
void DelayedDeleteDescriptorSet(const CoreGraphics::ResourceTableId id)
Add a descriptor set to delete queue.
Definition vkgraphicsdevice.cc:2007
uint MaxResourceTableInputAttachments
Definition vkgraphicsdevice.cc:743
uint MaxResourceTableDynamicOffsetConstantBuffers
Definition vkgraphicsdevice.cc:737
const CoreGraphics::CmdBufferId LockTransferHandoverSetupCommandBuffer()
Lock handover transfer command buffer.
Definition vkgraphicsdevice.cc:1613
void DelayedFreeMemory(const CoreGraphics::Alloc alloc)
Add memory allocation to delete queue.
Definition vkgraphicsdevice.cc:1997
uint MaxRecursionDepth
Definition vkgraphicsdevice.cc:751
bool CreateGraphicsDevice(const GraphicsDeviceCreateInfo &info)
create graphics device
Definition vkgraphicsdevice.cc:768
void NewFrame()
Progress to next frame.
Definition vkgraphicsdevice.cc:2309
const VertexAlloc AllocateVertices(const SizeT numVertices, const SizeT vertexSize)
Allocate vertices from the global vertex pool.
Definition vkgraphicsdevice.cc:2114
void SetRenderWireframe(bool b)
set the render as wireframe flag
Definition vkgraphicsdevice.cc:2436
Util::Pair< Memory::RangeAllocation, CoreGraphics::BufferId > UploadArray(const TYPE *data, SizeT elements, const SizeT alignment=1)
Upload array of items to GPU source buffer.
Definition graphicsdevice.h:427
uint MaxResourceTableReadWriteImages
Definition vkgraphicsdevice.cc:741
uint MaxPerStageSamplers
Definition vkgraphicsdevice.cc:733
PipelineStage
Definition config.h:191
uint64 ShaderGroupSize
Definition vkgraphicsdevice.cc:750
void UploadInternal(const CoreGraphics::BufferId buffer, uint offset, const void *data, SizeT size)
Upload memory to upload buffer with given offset, return offset.
Definition vkgraphicsdevice.cc:2231
void WaitForQueue(CoreGraphics::QueueType queue)
wait for an individual queue to finish
Definition vkgraphicsdevice.cc:1907
void LockConstantUpdates()
Lock constant updates.
Definition vkgraphicsdevice.cc:1799
const VertexAlloc AllocateIndices(const SizeT numIndices, const IndexType::Code indexType)
Allocate indices from the global index pool.
Definition vkgraphicsdevice.cc:2161
uint ConstantBufferAlignment
Definition vkgraphicsdevice.cc:724
uint SetConstants(const TYPE &data)
Allocate range of memory and set data, return offset (thread safe)
Definition graphicsdevice.h:367
uint MaxPerStageSampledImages
Definition vkgraphicsdevice.cc:731
uint MaxResourceTableDynamicOffsetReadWriteBuffers
Definition vkgraphicsdevice.cc:739
void UnlockTransferSetupCommandBuffer(CoreGraphics::CmdBufferId cmdBuf)
Release lock on resource command buffer.
Definition vkgraphicsdevice.cc:1568
constexpr Pair< A, B > MakePair(const A &a, const B &b)
Definition tupleutility.h:54
std::pair< A, B > Pair
Wrap std::pair.
Definition tupleutility.h:47
#define NEBULA_GRAPHICS_DEBUG
Definition config.h:322
Graphics memory interface.
A resource table declares a list of resources (ResourceTable in DX12, DescriptorSet in Vulkan)
Definition accelerationstructure.h:48
Definition commandbuffer.h:155
Definition commandbuffer.h:101
Definition graphicsdevice.h:95
CoreGraphics::CmdBufferId buf
Definition graphicsdevice.h:96
Threading::Event * event
Definition graphicsdevice.h:97
Definition graphicsdevice.h:76
bool enableRayTracing
Definition graphicsdevice.h:77
bool enableGPUCrashAnalytics
Definition graphicsdevice.h:80
bool enableVariableRateShading
Definition graphicsdevice.h:79
bool enableMeshShaders
Definition graphicsdevice.h:78
Definition graphicsdevice.h:66
uint64 maxTimestampQueries
Definition graphicsdevice.h:72
uint64 maxOcclusionQueries
Definition graphicsdevice.h:72
uint64 globalIndexBufferMemorySize
Definition graphicsdevice.h:69
uint64 memoryHeaps[NumMemoryPoolTypes]
Definition graphicsdevice.h:71
uint64 globalVertexBufferMemorySize
Definition graphicsdevice.h:68
struct CoreGraphics::GraphicsDeviceCreateInfo::Features features
uint64 globalUploadMemorySize
Definition graphicsdevice.h:70
bool enableValidation
Definition graphicsdevice.h:74
uint64 maxStatisticsQueries
Definition graphicsdevice.h:72
uint64 globalConstantBufferMemorySize
Definition graphicsdevice.h:67
byte numBufferedFrames
Definition graphicsdevice.h:73
Definition graphicsdevice.h:118
Util::FixedArray< CoreGraphics::FenceId > presentFences
Definition graphicsdevice.h:127
Util::Array< Ptr< CoreGraphics::RenderEventHandler > > eventHandlers
Definition graphicsdevice.h:138
bool enableValidation
Definition graphicsdevice.h:156
Util::FixedArray< CoreGraphics::BufferId > globalConstantBuffer
Definition graphicsdevice.h:131
Util::Array< CoreGraphics::CmdBufferId > setupGraphicsCommandBuffers
Definition graphicsdevice.h:125
Util::Array< CoreGraphics::CmdBufferId > setupTransferCommandBuffers
Definition graphicsdevice.h:122
bool isOpen
Definition graphicsdevice.h:152
uint maxNumBufferedFrames
Definition graphicsdevice.h:149
Util::Array< CoreGraphics::TextureId > backBuffers
Definition graphicsdevice.h:119
_declare_counter(NumBufferBytesAllocated)
CoreGraphics::ResourceTableId tickResourceTableCompute
Definition graphicsdevice.h:134
CoreGraphics::CmdBufferPoolId setupGraphicsCommandBufferPool
Definition graphicsdevice.h:124
CoreGraphics::ResourceTableId tickResourceTableGraphics
Definition graphicsdevice.h:133
Memory::RangeAllocator uploadAllocator
Definition graphicsdevice.h:146
bool renderWireframe
Definition graphicsdevice.h:154
bool visualizeMipMaps
Definition graphicsdevice.h:155
CoreGraphics::BufferId vertexBuffer
Definition graphicsdevice.h:141
CoreGraphics::ResourceTableId frameResourceTableGraphics
Definition graphicsdevice.h:135
_declare_counter(NumImageBytesAllocated)
uint32_t currentBufferedFrameIndex
Definition graphicsdevice.h:150
bool inNotifyEventHandlers
Definition graphicsdevice.h:153
_declare_counter(GraphicsDeviceNumDrawCalls)
CoreGraphics::BufferId indexBuffer
Definition graphicsdevice.h:144
_declare_counter(GraphicsDeviceNumComputes)
Memory::RangeAllocator indexAllocator
Definition graphicsdevice.h:143
Util::FixedArray< CoreGraphics::SemaphoreId > renderingFinishedSemaphores
Definition graphicsdevice.h:128
Util::Array< CoreGraphics::CmdBufferId > handoverTransferCommandBuffers
Definition graphicsdevice.h:123
Memory::RangeAllocator vertexAllocator
Definition graphicsdevice.h:140
CoreGraphics::ResourceTableId frameResourceTableCompute
Definition graphicsdevice.h:136
IndexT currentFrameIndex
Definition graphicsdevice.h:157
CoreGraphics::CmdBufferPoolId setupTransferCommandBufferPool
Definition graphicsdevice.h:121
_declare_counter(GraphicsDeviceNumPrimitives)
uint globalConstantBufferMaxValue
Definition graphicsdevice.h:130
_declare_counter(NumBytesAllocated)
Definition graphicsdevice.h:172
CoreGraphics::CmdBufferId graphicsCommandBuffer
Definition graphicsdevice.h:173
CmdPipelineBuildBits currentPipelineBits
Definition graphicsdevice.h:175
bool usePatches
Definition graphicsdevice.h:183
bool renderWireframe
Definition graphicsdevice.h:181
bool isOpen
Definition graphicsdevice.h:179
CoreGraphics::PassId pass
Definition graphicsdevice.h:178
bool enableValidation
Definition graphicsdevice.h:184
CoreGraphics::PrimitiveTopology::Code primitiveTopology
Definition graphicsdevice.h:176
bool visualizeMipMaps
Definition graphicsdevice.h:182
bool inNotifyEventHandlers
Definition graphicsdevice.h:180
CoreGraphics::PrimitiveGroup primitiveGroup
Definition graphicsdevice.h:177
CoreGraphics::CmdBufferId computeCommandBuffer
Definition graphicsdevice.h:173
Definition resourcetable.h:95
Definition graphicsdevice.h:101
const bool operator==(const std::nullptr_t) const
Definition vkgraphicsdevice.cc:2732
SubmissionWaitEvent()
Definition vkgraphicsdevice.cc:2723
void operator=(const std::nullptr_t)
Definition vkgraphicsdevice.cc:2750
CoreGraphics::QueueType queue
Definition graphicsdevice.h:114
const bool operator!=(const std::nullptr_t) const
Definition vkgraphicsdevice.cc:2741
texture type
Definition texture.h:25
Definition textureview.h:16
Definition accelerationstructure.h:98
A 4D vector.
Definition vec4.h:24
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
uint64_t uint64
Definition types.h:36
int IndexT
Definition types.h:48