Vulkan implementation of GPU acceleration structure.
Implements the entry point to the instance rendering subsystem, for Vulkan.
Implements a Vulkan specific renderer for instanced draws.
Vulkan implementation of vertex layout.
Utility functions to convert from Nebula enums to Vulkan values.
Vulkan implementation of a texture view.
Implements a text renderer using Vulkan.
Vulkan implementation of Swapchain.
The Vulkan sub-context handler is responsible for negotiating queue submissions.
Implements a Vulkan immediate shape and primitive renderer (debug meshes, random primitives, wireframes etc)
Implements a shader variation (shader program within effect) in Vulkan.
Vulkan semaphore (cross-queue synchronization primitive)
Implements a scheduler interface which serves to perform Vulkan operations which might be requested anywhere in the code to be executed when actually relevant.
Vulkan sampler implemention.
Vulkan implementation of ResourceTable, ResourceTableLayout, and ResourcePipeline.
VkPipelineDatabase implements something akin to a VkPipelineCache.
Vulkan implementation of CoreGraphics::PipelineId.
Implements a Vulkan pass, which translates into a VkRenderPass.
Vulkan Memory Manager.
The Vulkan implementation of the graphics device.
Vulkan abstraction of a fence.
Vulkan abstraction of event.
Implements a Vulkan display device.
Implements a Vulkan depth-stencil renderable texture.
Implements a deferred delegate, which is used to perform an action whenever a fence object is done.
This thread records commands to a Vulkan Command Buffer in its own thread.
Vulkan implementation of a GPU buffer.
The Vulkan implementation of a GPU command barrier.
- Copyright
- (C) 2022 Individual contributors, see AUTHORS file
-
(C) 2017-2020 Individual contributors, see AUTHORS file
-
(C) 2020 Individual contributors, see AUTHORS file
-
(C) 2016-2020 Individual contributors, see AUTHORS file
(C) 2016-2018 Individual contributors, see AUTHORS file
All functions in the Vulkan namespace are internal helper functions specifically for Vulkan, the other functions implement the abstraction layer.
- Copyright
- (C) 2018-2020 Individual contributors, see AUTHORS file
-
(C) 2023 Individual contributors, see AUTHORS file
It works in a tree-like structure, where frequency of change dictates which level the state belongs to.
It works by incrementally creating a DAG, which at the end points to a path used to create a graphics pipeline. If it has already been created, then the pipeline is simply returned, however, if a node is set to initial (which happens on construction, meaning all children are also initial), then a new graphics pipeline is created and gets associated with the DAG path.
It can be slightly more efficient, currently, whenever a state is changed high up in the DAG, child nodes are created for the rest of the currently used state. This is somewhat unnecessary, instead, the nodes should be created when and if we actually do create a pipeline.
- Copyright
- (C) 2016-2020 Individual contributors, see AUTHORS file
-
(C) 2018-2020 Individual contributors, see AUTHORS file
Calls to the scheduler will be executed dependent on the CommandPass, which denotes when the delayed command is supposed to be run. This is to make sure commands come in order on the command queue.
For immediate calls to Vulkan, look at VkUtilities
(C)2017-2018 Individual contributors, see AUTHORS file
In Vulkan, this directly maps to the VkQueue, but also implicitly support semaphore synchronization of required.
To more efficiently utilize the GPU, call SetToNextContext after a Submit if the subsequent Submits can run in parallel. If synchronization is a problem, defer from using SetToNextContext such that we can run all commands on a single submission.
Submit also allows for waiting on the entire command buffer execution on the CPU. By either submitting true to the Submit function argument 'wait for fence', or chose where to wait for it in the main code. Avoid waiting as well if possible, since it will stall the CPU.
It also supports inserting a dependency on different queues, wherein the depender is the queue depending on another to finish working, will wait for the other to signal.
TODO: We should be able to use this handler across devices too...
- Copyright
- (C) 2017-2020 Individual contributors, see AUTHORS file
-
(C) 2024 Individual contributors, see AUTHORS file
|
typedef Ids::IdAllocatorSafe< 0xFFF, VkDevice, VkAccelerationStructureKHR, CoreGraphics::BufferId, CoreGraphics::BufferId, GeometrySetup, VkDeviceAddress > | VkBlasAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFFFF, VkAccelerationStructureInstanceKHR, Math::mat4, uint > | VkBlasInstanceAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFFF, VkDevice, SceneSetup, VkAccelerationStructureKHR, CoreGraphics::BufferId, CoreGraphics::BufferId, CoreGraphics::BufferId, VkDeviceAddress, VkDeviceAddress > | VkTlasAllocator |
|
typedef Ids::IdAllocator< VkBarrierInfo, Util::Array< CoreGraphics::TextureId > > | VkBarrierAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFFFF, VkBufferLoadInfo, VkBufferRuntimeInfo, VkBufferMapInfo > | VkBufferAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFF, BufferSparsePageTable, Util::Array< VkSparseMemoryBind > > | VkBufferSparseExtensionAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkCommandPool > | VkCommandBufferPoolAllocator |
|
typedef Ids::IdAllocatorSafe< 0x1000, VkDevice, VkCommandBuffer, VkCommandPool, CoreGraphics::CmdPipelineBuildBits, VkPipelineBundle, ViewportBundle, ScissorBundle, CoreGraphics::QueueType > | VkCommandBufferAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkEventInfo > | VkEventAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkFenceInfo > | VkFenceAllocator |
|
typedef Ids::IdAllocator< VkPassLoadInfo, VkPassRuntimeInfo, VkRenderPassBeginInfo, Util::Array< uint32_t > > | VkPassAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkDescriptorSet, IndexT, Threading::Spinlock, CoreGraphics::ResourceTableLayoutId, Util::Array< WriteInfo, 16 >, Util::Array< VkCopyDescriptorSet, 4 > > | VkResourceTableAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkDescriptorSetLayout, Util::Array< VkDescriptorPoolSize >, Util::Array< Util::Pair< CoreGraphics::SamplerId, uint32_t > >, Util::HashTable< uint32_t, bool >, Util::Array< VkDescriptorPool >, Util::Array< uint > > | VkResourceTableLayoutAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkPipelineLayout > | VkResourcePipelineAllocator |
| Resource pipeline.
|
|
typedef Ids::IdAllocator< VkDevice, VkSampler, uint32_t > | VkSamplerAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkSemaphore, CoreGraphics::SemaphoreType, uint64 > | VkSemaphoreAllocator |
|
typedef Util::Dictionary< Util::StringAtom, CoreGraphics::BufferId > | UniformBufferMap |
|
typedef Util::Dictionary< uint32_t, Util::Array< CoreGraphics::BufferId > > | UniformBufferGroupMap |
|
typedef Util::Dictionary< CoreGraphics::ShaderFeature::Mask, CoreGraphics::ShaderProgramId > | ProgramMap |
|
typedef Ids::IdAllocator< VkReflectionInfo, VkShaderSetupInfo, VkShaderRuntimeInfo, Util::Array< CoreGraphics::ShaderProgramId > > | ShaderAllocator |
| this member allocates shaders
|
|
typedef Ids::IdAllocator< VkShaderProgramSetupInfo, VkProgramReflectionInfo, VkShaderProgramRuntimeInfo > | ShaderProgramAllocator |
|
typedef Ids::IdAllocator< VkDevice, VkSurfaceKHR, VkSwapchainKHR, uint, CoreGraphics::DisplayMode, Util::Array< VkImage >, Util::Array< VkImageView >, VkQueue, CoreGraphics::QueueType, CoreGraphics::CmdBufferPoolId > | SwapchainAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFFFF, VkTextureRuntimeInfo, VkTextureLoadInfo, VkTextureMappingInfo > | VkTextureAllocator |
| we need a thread-safe allocator since it will be used by both the memory and stream pool
|
|
typedef Ids::IdAllocatorSafe< 0xFFFF, CoreGraphics::TextureViewId, IndexT > | VkTextureStencilExtensionAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFF, VkTextureSwapInfo > | VkTextureSwapExtensionAllocator |
|
typedef Ids::IdAllocatorSafe< 0xFF, TextureSparsePageTable, VkSparseImageMemoryRequirements, Util::Array< VkSparseMemoryBind >, Util::Array< VkSparseImageMemoryBind >, Util::Array< CoreGraphics::Alloc > > | VkTextureSparseExtensionAllocator |
|
typedef Ids::IdAllocator< VkTextureViewLoadInfo, VkTextureViewRuntimeInfo > | VkTextureViewAllocator |
|
typedef Ids::IdAllocator< Util::HashTable< uint64_t, DerivativeLayout >, VkPipelineVertexInputStateCreateInfo, BindInfo, CoreGraphics::VertexLayoutInfo, Util::Array< SizeT >, VertexLayoutVkBindInfo > | VkVertexLayoutAllocator |
|
|
const VkDevice | BlasGetVkDevice (const CoreGraphics::BlasId id) |
| Get device used to create blas.
|
|
const VkBuffer | BlasGetVkBuffer (const CoreGraphics::BlasId id) |
| Get buffer holding TLAS data.
|
|
const VkAccelerationStructureKHR | BlasGetVk (const CoreGraphics::BlasId id) |
| Get buffer representing the acceleration structure.
|
|
const VkAccelerationStructureBuildGeometryInfoKHR & | BlasGetVkBuild (const CoreGraphics::BlasId id) |
| Get build info for bottom level acceleration structure.
|
|
const Util::Array< VkAccelerationStructureBuildRangeInfoKHR > & | BlasGetVkRanges (const CoreGraphics::BlasId id) |
| Get range infos for bottom level acceleration structure.
|
|
const VkDevice | TlasGetVkDevice (const CoreGraphics::TlasId id) |
| Get device used to create Tlas.
|
|
const VkBuffer | TlasGetVkBuffer (const CoreGraphics::TlasId id) |
| Get buffer holding TLAS data.
|
|
const VkAccelerationStructureKHR | TlasGetVk (const CoreGraphics::TlasId id) |
| Get acceleration structure.
|
|
const VkAccelerationStructureBuildGeometryInfoKHR & | TlasGetVkBuild (const CoreGraphics::TlasId id) |
| Get build info.
|
|
const Util::Array< VkAccelerationStructureBuildRangeInfoKHR > & | TlasGetVkRanges (const CoreGraphics::TlasId id) |
| Get build ranges.
|
|
const VkBarrierInfo & | BarrierGetVk (const CoreGraphics::BarrierId id) |
| Get Vulkan info.
|
|
VkBuffer | BufferGetVk (const CoreGraphics::BufferId id) |
| get buffer object
|
|
VkDeviceMemory | BufferGetVkMemory (const CoreGraphics::BufferId id) |
| get buffer memory
|
|
VkDevice | BufferGetVkDevice (const CoreGraphics::BufferId id) |
| get buffer device
|
|
const VkCommandPool | CmdBufferPoolGetVk (const CoreGraphics::CmdBufferPoolId id) |
| get vk command buffer pool
|
|
const VkDevice | CmdBufferPoolGetVkDevice (const CoreGraphics::CmdBufferPoolId id) |
| get vk device that created the pool
|
|
const VkCommandBuffer | CmdBufferGetVk (const CoreGraphics::CmdBufferId id) |
| Get vk command buffer.
|
|
const VkCommandPool | CmdBufferGetVkPool (const CoreGraphics::CmdBufferId id) |
| Get vk command buffer pool.
|
|
const VkDevice | CmdBufferGetVkDevice (const CoreGraphics::CmdBufferId id) |
| Get vk device.
|
|
| __ImplementClass (Vulkan::VkCommandBufferThread, 'VCBT', Threading::Thread) |
|
| __ImplementClass (Vulkan::VkDepthStencilTarget, 'VKDS', Base::DepthStencilTargetBase) |
|
| __ImplementClass (Vulkan::VkDisplayDevice, 'VKDD', Base::DisplayDeviceBase) |
|
| __ImplementSingleton (Vulkan::VkDisplayDevice) |
|
const VkEventInfo & | EventGetVk (const CoreGraphics::EventId id) |
| Get vk event info.
|
|
VkFence | FenceGetVk (const CoreGraphics::FenceId id) |
|
void | SetupAdapter (CoreGraphics::GraphicsDeviceCreateInfo::Features features) |
| setup graphics adapter
|
|
VkInstance | GetInstance () |
| get vk instance
|
|
VkDevice | GetCurrentDevice () |
| get the currently activated device
|
|
VkPhysicalDevice | GetCurrentPhysicalDevice () |
| get the currently activated physical device
|
|
VkPhysicalDeviceFeatures | GetCurrentFeatures () |
| get the current device features
|
|
VkPipelineCache | GetPipelineCache () |
| get pipeline cache
|
|
VkPhysicalDeviceMemoryProperties | GetMemoryProperties () |
| get memory properties
|
|
VkSemaphore | GetRenderingSemaphore () |
| get final rendering semaphore
|
|
VkFence | GetPresentFence () |
| get the present fence
|
|
void | DelayedDeleteVkBuffer (const VkDevice dev, const VkBuffer buf) |
| Add VkBuffer for late delete.
|
|
VkQueryPool | GetQueryPool (const CoreGraphics::QueryType query) |
| Get query pool.
|
|
void | WaitForPresent (VkSemaphore sem) |
|
const VkQueue | GetQueue (const CoreGraphics::QueueType type, const IndexT index) |
| get queue from index and family
|
|
const VkQueue | GetCurrentQueue (const CoreGraphics::QueueType type) |
| get currently active queue of type
|
|
VkPipeline | GetOrCreatePipeline (CoreGraphics::PassId pass, uint subpass, CoreGraphics::ShaderProgramId program, const CoreGraphics::InputAssemblyKey inputAssembly, const VkGraphicsPipelineCreateInfo &info) |
| Generate or return cached VkPipeline.
|
|
void | SparseTextureBind (const VkImage img, const Util::Array< VkSparseMemoryBind > &opaqueBinds, const Util::Array< VkSparseImageMemoryBind > &pageBinds) |
| perform a set of sparse image binding operations
|
|
void | SparseBufferBind (const VkBuffer buf, const Util::Array< VkSparseMemoryBind > &binds) |
| Perform a set of sparse binding operations for buffers.
|
|
void | ClearPending () |
| Clear pending resources.
|
|
void | DeviceLost () |
| Handle VK Results.
|
|
VkCommandBuffer | GetMainBuffer (const CoreGraphics::QueueType queue) |
| get main command buffer
|
|
void | InitVulkan () |
| initialize Vulkan by loading dll and setting up the instance loader
|
|
void | InitInstance (VkInstance instance) |
| initialize Vulkan instance, loads function pointers directly from driver
|
|
CoreGraphics::Alloc | AllocateMemory (const VkDevice dev, const VkImage &img, CoreGraphics::MemoryPoolType type) |
| allocate memory for an image
|
|
CoreGraphics::Alloc | AllocateMemory (const VkDevice dev, const VkBuffer &buf, CoreGraphics::MemoryPoolType type, uint alignment=1) |
| allocate memory for a buffer
|
|
CoreGraphics::Alloc | AllocateMemory (const VkDevice dev, VkMemoryRequirements reqs, VkDeviceSize allocSize) |
| allocate memory for sparse memory
|
|
void | Flush (const VkDevice dev, const CoreGraphics::Alloc &alloc, IndexT offset, SizeT size) |
| flush a mapped memory region
|
|
void | Invalidate (const VkDevice dev, const CoreGraphics::Alloc &alloc, IndexT offset, SizeT size) |
| invalidate a mapped memory region
|
|
VkResult | GetMemoryType (uint32_t bits, VkMemoryPropertyFlags flags, uint32_t &index) |
| get vulkan memory type based on resource requirements and wanted memory properties
|
|
const VkRenderPassBeginInfo & | PassGetVkRenderPassBeginInfo (const CoreGraphics::PassId &id) |
| get vk render pass
|
|
const VkGraphicsPipelineCreateInfo & | PassGetVkFramebufferInfo (const CoreGraphics::PassId &id) |
| get vk framebuffer info
|
|
const SizeT | PassGetVkNumAttachments (const CoreGraphics::PassId &id) |
| get number of pass attachments
|
|
const VkDevice | PassGetVkDevice (const CoreGraphics::PassId &id) |
| Get device creating this pass.
|
|
const VkFramebuffer | PassGetVkFramebuffer (const CoreGraphics::PassId &id) |
| Get framebuffer.
|
|
const VkRenderPass | PassGetVkRenderPass (const CoreGraphics::PassId &id) |
| Get pass.
|
|
| __ImplementSingleton (VkPipelineDatabase) |
|
const VkDescriptorSet & | ResourceTableGetVkDescriptorSet (CoreGraphics::ResourceTableId id) |
| Get descriptor set.
|
|
const IndexT | ResourceTableGetVkPoolIndex (CoreGraphics::ResourceTableId id) |
| Get descriptor pool index.
|
|
const VkDevice & | ResourceTableGetVkDevice (CoreGraphics::ResourceTableId id) |
| Get device used to create resource table.
|
|
void | SetupEmptyDescriptorSetLayout () |
| run this before using any resource tables
|
|
const VkDescriptorSetLayout & | ResourceTableLayoutGetVk (const CoreGraphics::ResourceTableLayoutId &id) |
| get table layout
|
|
void | ResourceTableLayoutAllocTable (const CoreGraphics::ResourceTableLayoutId &id, const VkDevice dev, uint overallocationSize, IndexT &outIndex, VkDescriptorSet &outSet) |
| allocate new descriptor set from pool
|
|
void | ResourceTableLayoutDeallocTable (const CoreGraphics::ResourceTableLayoutId &id, const VkDevice dev, const VkDescriptorSet &set, const IndexT index) |
| deallocate descriptor set from pool
|
|
const VkDescriptorPool & | ResourceTableLayoutGetVkDescriptorPool (const CoreGraphics::ResourceTableLayoutId &id, const IndexT index) |
| Get descriptor pool.
|
|
uint * | ResourceTableLayoutGetFreeItemsCounter (const CoreGraphics::ResourceTableLayoutId &id, const IndexT index) |
| Get descriptor pool free items counter.
|
|
const VkPipelineLayout & | ResourcePipelineGetVk (const CoreGraphics::ResourcePipelineId &id) |
| get pipeline layout
|
|
const VkSampler & | SamplerGetVk (const CoreGraphics::SamplerId &id) |
| get vulkan sampler
|
|
| __ImplementSingleton (Vulkan::VkScheduler) |
|
VkSemaphore | SemaphoreGetVk (const CoreGraphics::SemaphoreId &id) |
| get vulkan sampler
|
|
void | UpdateOccupancy (uint32_t *occupancyList, uint32_t &slotsUsed, const CoreGraphics::ShaderVisibility vis) |
|
void | ShaderSetup (VkDevice dev, const Util::StringAtom &name, AnyFX::ShaderEffect *effect, Util::FixedArray< CoreGraphics::ResourcePipelinePushConstantRange > &constantRange, Util::Array< CoreGraphics::SamplerId > &immutableSamplers, Util::FixedArray< Util::Pair< uint32_t, CoreGraphics::ResourceTableLayoutId > > &setLayouts, Util::Dictionary< uint32_t, uint32_t > &setLayoutMap, CoreGraphics::ResourcePipelineId &pipelineLayout, Util::Dictionary< Util::StringAtom, uint32_t > &resourceSlotMapping, Util::Dictionary< Util::StringAtom, IndexT > &constantBindings) |
| create descriptor set layout
|
|
void | ShaderCleanup (VkDevice dev, Util::Array< CoreGraphics::SamplerId > &immutableSamplers, Util::FixedArray< Util::Pair< uint32_t, CoreGraphics::ResourceTableLayoutId > > &setLayouts, Util::Dictionary< Util::StringAtom, CoreGraphics::BufferId > &buffers, CoreGraphics::ResourcePipelineId &pipelineLayout) |
| cleanup shader
|
|
Util::String | VkShaderCreateSignature (const VkDescriptorSetLayoutBinding &bind) |
| create descriptor layout signature
|
|
const VkProgramReflectionInfo & | ShaderGetProgramReflection (const CoreGraphics::ShaderProgramId shaderProgramId) |
| Use direct resource ids, not the State, Shader or Variable type ids.
|
|
| __ImplementClass (Vulkan::VkShaderCache, 'VKSL', Resources::ResourceStreamCache) |
|
void | VkShaderProgramSetup (const Ids::Id24 id, const Resources::ResourceName &shaderName, AnyFX::VkProgram *program, const CoreGraphics::ResourcePipelineId &pipelineLayout) |
| setup from AnyFX program
|
|
void | VkShaderProgramCreateShader (const VkDevice dev, VkShaderModule *shader, unsigned binarySize, char *binary) |
| create shader object
|
|
void | VkShaderProgramSetupAsGraphics (AnyFX::VkProgram *program, const Resources::ResourceName &shaderName, VkShaderProgramRuntimeInfo &runtime) |
| create this program as a graphics program
|
|
void | VkShaderProgramSetupAsCompute (VkShaderProgramSetupInfo &setup, VkShaderProgramRuntimeInfo &runtime) |
| create this program as a compute program (can be done immediately)
|
|
void | VkShaderProgramSetupAsRaytracing (AnyFX::VkProgram *program, const Resources::ResourceName &shaderName, VkShaderProgramSetupInfo &setup, VkShaderProgramRuntimeInfo &runtime) |
| create this program as a compute program (can be done immediately)
|
|
VkPipeline | VkShaderProgramGetRaytracingLibrary (const CoreGraphics::ShaderProgramId id) |
| Get raytracing library pipepline.
|
|
VkPipelineLayout | VkShaderProgramGetLayout (const CoreGraphics::ShaderProgramId id) |
| Get resource layout of shader program.
|
|
void | VkShaderProgramGetRaytracingVaryingSizes (const CoreGraphics::ShaderProgramId id, uint &rayPayloadSize, uint &hitAttributeSize) |
| Get ray payload and hit attribute sizes.
|
|
void | VkShaderProgramDiscard (VkShaderProgramSetupInfo &info, VkShaderProgramRuntimeInfo &rt, VkPipeline &computePipeline) |
| discard variation
|
|
| __ImplementClass (Vulkan::VkShaderServer, 'VKSS', Base::ShaderServerBase) |
|
| __ImplementInterfaceSingleton (Vulkan::VkShaderServer) |
|
| __ImplementClass (Vulkan::VkShapeRenderer, 'VKSR', Base::ShapeRendererBase) |
|
| __ImplementClass (Vulkan::VkTextRenderer, 'VKTR', Base::TextRendererBase) |
|
| __ImplementSingleton (Vulkan::VkTextRenderer) |
|
const VkImage | TextureGetVkImage (const CoreGraphics::TextureId id) |
| get Vk image
|
|
const VkImageView | TextureGetVkImageView (const CoreGraphics::TextureId id) |
| get vk image view
|
|
const VkImageView | TextureGetVkStencilImageView (const CoreGraphics::TextureId id) |
| get vk image view for stencil
|
|
const VkDevice | TextureGetVkDevice (const CoreGraphics::TextureId id) |
| get the device created the image
|
|
void | SetupSparse (VkDevice dev, VkImage img, Ids::Id32 sparseExtension, const VkTextureLoadInfo &info) |
|
const VkImageView | TextureViewGetVk (const CoreGraphics::TextureViewId id) |
| Get vk image view.
|
|
const VkDevice | TextureViewGetVkDevice (const CoreGraphics::TextureViewId id) |
| Get device used to create view.
|
|
const VertexLayoutVkBindInfo & | VertexLayoutGetVkBindInfo (const CoreGraphics::VertexLayoutId layout) |
| Get dynamic bind info.
|
|
| __ImplementClass (Vulkan::VkInstanceRenderer, 'VKIR', Base::InstanceRendererBase) |
|
| __ImplementSingleton (Vulkan::VkInstanceServer) |
|
| __ImplementClass (Vulkan::VkInstanceServer, 'VKIS', Base::InstanceServerBase) |
|