Nebula
Loading...
Searching...
No Matches
vksubcontexthandler.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
27//------------------------------------------------------------------------------
28#include "vkloader.h"
29#include "util/fixedarray.h"
30#include "coregraphics/config.h"
31namespace Vulkan
32{
33
35{
36public:
37
42
52
66
72
87
89 void Setup(VkDevice dev, const Util::FixedArray<Util::Pair<uint, uint>> indexMap);
91 void Discard();
94
98 , VkCommandBuffer cmds
101 , const char* name = nullptr
102#endif
103 );
104
111 , const char* name = nullptr
112#endif
113 );
121 void AppendPresentSignal(CoreGraphics::QueueType type, VkSemaphore sem);
123 void FlushSubmissions(VkFence fence);
125 void Wait(CoreGraphics::QueueType type, uint64 index);
127 bool Poll(CoreGraphics::QueueType type, uint64_t index);
128
130 void FlushSparseBinds(VkFence fence);
132 void InsertFence(CoreGraphics::QueueType type, VkFence fence);
133
135 void WaitIdle(const CoreGraphics::QueueType type);
136
138 VkQueue GetQueue(const CoreGraphics::QueueType type);
139
140private:
141 friend const VkQueue GetQueue(const CoreGraphics::QueueType type, const IndexT index);
142
143 VkSemaphore GetSemaphore(const CoreGraphics::QueueType type);
146
147 VkDevice device;
155};
156
157} // namespace Vulkan
Critical section objects are used to protect a portion of code from parallel execution.
Nebula's dynamic array class.
Definition array.h:60
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
Definition vksubcontexthandler.h:35
void WaitIdle(const CoreGraphics::QueueType type)
wait for a queue to finish working
Definition vksubcontexthandler.cc:503
void SetToNextContext(const CoreGraphics::QueueType type)
set to next context of type
Definition vksubcontexthandler.cc:118
uint64 AppendSparseBind(CoreGraphics::QueueType type, const VkImage img, const Util::Array< VkSparseMemoryBind > &opaqueBinds, const Util::Array< VkSparseImageMemoryBind > &pageBinds)
append a sparse image bind timeline operation
Definition vksubcontexthandler.cc:227
void IncrementSemaphoreId(const CoreGraphics::QueueType type)
Definition vksubcontexthandler.cc:546
uint64 AppendSubmissionTimeline(CoreGraphics::QueueType type, VkCommandBuffer cmds, Util::Array< CoreGraphics::SubmissionWaitEvent, 8 > waitEvents)
append submission to context to execute later, supports waiting for a queue
Definition vksubcontexthandler.cc:131
VkDevice device
Definition vksubcontexthandler.h:147
Util::FixedArray< Util::Array< VkQueue > > queues
Definition vksubcontexthandler.h:148
void Discard()
discard
Definition vksubcontexthandler.cc:110
void FlushSubmissions(VkFence fence)
Flush submissions.
Definition vksubcontexthandler.cc:323
Util::FixedArray< Util::Array< TimelineSubmission2, 16 > > submissions
Definition vksubcontexthandler.h:152
friend const VkQueue GetQueue(const CoreGraphics::QueueType type, const IndexT index)
get queue from index and family
Definition vkgraphicsdevice.cc:486
Util::FixedArray< Util::Array< VkSemaphore > > semaphores
Definition vksubcontexthandler.h:150
bool Poll(CoreGraphics::QueueType type, uint64_t index)
check to see if timeline index has passed
Definition vksubcontexthandler.cc:425
uint64 GetNextTimelineIndex(CoreGraphics::QueueType type)
Gets the next submission id for a specific queue.
Definition vksubcontexthandler.cc:218
void Setup(VkDevice dev, const Util::FixedArray< Util::Pair< uint, uint > > indexMap)
setup subcontext handler
Definition vksubcontexthandler.cc:32
Util::FixedArray< uint > currentQueue
Definition vksubcontexthandler.h:149
void FlushSparseBinds(VkFence fence)
flush sparse binds
Definition vksubcontexthandler.cc:437
Util::FixedArray< Util::Array< uint64 > > semaphoreSubmissionIds
Definition vksubcontexthandler.h:151
VkSubContextHandler()
constructor
Definition vksubcontexthandler.cc:16
void AppendPresentSignal(CoreGraphics::QueueType type, VkSemaphore sem)
Append present signal.
Definition vksubcontexthandler.cc:311
void InsertFence(CoreGraphics::QueueType type, VkFence fence)
insert fence
Definition vksubcontexthandler.cc:492
uint64 GetSemaphoreId(const CoreGraphics::QueueType type)
Definition vksubcontexthandler.cc:537
void Wait(CoreGraphics::QueueType type, uint64 index)
wait for timeline index
Definition vksubcontexthandler.cc:398
Threading::CriticalSection submissionLock
Definition vksubcontexthandler.h:154
Util::Array< SparseBindSubmission > sparseBindSubmissions
Definition vksubcontexthandler.h:153
VkSemaphore GetSemaphore(const CoreGraphics::QueueType type)
Definition vksubcontexthandler.cc:528
~VkSubContextHandler()
destructor
Definition vksubcontexthandler.cc:23
QueueType
Definition config.h:40
std::pair< A, B > Pair
Wrap std::pair.
Definition tupleutility.h:47
Vulkan implementation of GPU acceleration structure.
Definition vkaccelerationstructure.cc:15
Compile time configuration options for the CoreGraphics subsystem.
#define NEBULA_GRAPHICS_DEBUG
Definition config.h:322
Definition vksubcontexthandler.h:74
Util::Array< VkSemaphore, 16 > signalSemaphores
Definition vksubcontexthandler.h:77
Util::Array< uint64, 16 > waitIndices
Definition vksubcontexthandler.h:85
Util::FixedArray< VkSparseMemoryBind > bufferMemoryBinds
Definition vksubcontexthandler.h:80
Util::Array< VkSemaphore, 16 > waitSemaphores
Definition vksubcontexthandler.h:84
Util::FixedArray< VkSparseImageMemoryBind > imageMemoryBinds
Definition vksubcontexthandler.h:79
Util::Array< VkSparseImageMemoryBindInfo, 16 > imageMemoryBindInfos
Definition vksubcontexthandler.h:83
Util::Array< uint64, 16 > signalIndices
Definition vksubcontexthandler.h:76
Util::Array< VkSparseImageOpaqueMemoryBindInfo, 16 > imageOpaqueBindInfos
Definition vksubcontexthandler.h:82
Util::Array< VkSparseBufferMemoryBindInfo, 16 > bufferMemoryBindInfos
Definition vksubcontexthandler.h:81
Util::FixedArray< VkSparseMemoryBind > opaqueMemoryBinds
Definition vksubcontexthandler.h:78
VkBindSparseInfo bindInfo
Definition vksubcontexthandler.h:75
Definition vksubcontexthandler.h:68
Util::Array< TimelineSubmission2 > submissions
Definition vksubcontexthandler.h:70
CoreGraphics::QueueType queue
Definition vksubcontexthandler.h:69
Definition vksubcontexthandler.h:54
CoreGraphics::QueueType queue
Definition vksubcontexthandler.h:58
Util::Array< VkPipelineStageFlags, 16 > waitFlags
Definition vksubcontexthandler.h:62
Util::Array< uint64, 16 > waitIndices
Definition vksubcontexthandler.h:64
Util::Array< VkCommandBuffer, 16 > buffers
Definition vksubcontexthandler.h:61
Util::Array< VkSemaphore, 16 > signalSemaphores
Definition vksubcontexthandler.h:60
Util::Array< uint64, 16 > signalIndices
Definition vksubcontexthandler.h:59
Util::Array< VkSemaphore, 16 > waitSemaphores
Definition vksubcontexthandler.h:63
Definition vksubcontexthandler.h:44
Util::Array< VkSemaphore > waitSemaphores
Definition vksubcontexthandler.h:49
Util::Array< VkPipelineStageFlags > waitFlags
Definition vksubcontexthandler.h:48
Util::Array< VkCommandBuffer > buffers
Definition vksubcontexthandler.h:47
Util::Array< VkSemaphore > signalSemaphores
Definition vksubcontexthandler.h:46
Util::Array< uint64 > waitIndices
Definition vksubcontexthandler.h:50
Util::Array< uint64 > signalIndices
Definition vksubcontexthandler.h:45
uint64_t uint64
Definition types.h:36
int IndexT
Definition types.h:48