public sealed class VulkanDeviceThe Vulkan logical device: everything the RHI can do, done.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Handles index tables this object owns. Nothing here is finalisable and nothing is reference-counted by the collector: a GPU object's lifetime belongs to the renderer, and destruction is deferred by FramesInFlight frames so that a resource released while the GPU is still reading it stays alive until it is not.
Recording is thread-safe; creation and destruction are serialised by a lock. That split is deliberate — command recording is the hot path a renderer parallelises, and resource creation is not.
Fields and properties (9)
public IGraphicsAdapter AdapterThe adapter this device runs on.
public GraphicsDeviceFeatures FeaturesWhat it can do.
public ICommandSubmitter GraphicsQueueThe queue that can do everything.
public ICommandSubmitter ComputeQueueThe compute queue, which is GraphicsQueue where the hardware has only one.
public ICommandSubmitter TransferQueueThe transfer queue, which is GraphicsQueue where the hardware has only one.
public int FramesInFlightHow many frames may be recorded before the first has to have finished.
public bool ValidationEnabledWhether the validation layers are watching this device.
public VulkanNativeHandles NativeHandlesThe raw objects something sharing this device needs.
public bool UsesDynamicRenderingWhether rendering goes through VK_KHR_dynamic_rendering rather than a pass object.
Methods (39)
public AccelerationStructureSizes GetAccelerationStructureSizes(in AccelerationStructureBuildInput input)Asks how much memory one acceleration-structure build needs.
public AccelerationStructureHandle CreateAccelerationStructure(in AccelerationStructureDescription description)public ulong GetAccelerationStructureAddress(AccelerationStructureHandle handle)The GPU address a top-level build's instances refer to a bottom level by.
public void Destroy(AccelerationStructureHandle handle)Returns an acceleration structure.
public TextureHandle ImportImage(nint image, in TextureDescription description)Adopts an image this device did not create, as a texture handle.
public static VulkanDevice Create()Creates a device with the documented defaults, or explains why it could not.
public static VulkanDevice Create(VulkanDeviceOptions options)Creates a device, or explains why it could not.
public static bool TryCreate(VulkanDeviceOptions options, out VulkanDevice? device, out string? reason)Creates a device, reporting failure rather than throwing.
public void BeginFrame()Marks the start of a frame, retiring whatever the oldest in-flight frame held.
public void EndFrame()Marks the end of a frame.
public void WaitIdle()Blocks until every queue is idle.
public ICommandList BeginCommandList(QueueKind kind = Graphics, string name = "")Takes a command list to record into.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public DescriptorSetLayoutHandle CreateDescriptorSetLayout(in DescriptorSetLayoutDescription description)public PipelineLayoutHandle CreatePipelineLayout(in PipelineLayoutDescription description)Creates a pipeline layout.
public DescriptorSetHandle CreateDescriptorSet(DescriptorSetLayoutHandle layout, string name = "")Creates a descriptor set.
public void UpdateDescriptorSet(DescriptorSetHandle descriptors, ReadOnlySpan<DescriptorWrite> writes)Points a descriptor set's bindings at resources.
public PipelineHandle CreateGraphicsPipeline(in GraphicsPipelineDescription description)Compiles a graphics pipeline.
public PipelineHandle CreateComputePipeline(in ComputePipelineDescription description)Compiles a compute pipeline.
public ISwapChain CreateSwapChain(in SwapChainDescription description)Creates a swapchain for a window surface.
public void Destroy(PipelineHandle handle)Returns a pipeline.
public void Destroy(PipelineLayoutHandle handle)Returns a pipeline layout.
public void Destroy(DescriptorSetLayoutHandle handle)Returns a descriptor-set layout.
public void Destroy(DescriptorSetHandle handle)Returns a descriptor set.
public BufferHandle CreateBuffer(in BufferDescription description)Creates a buffer.
public TextureHandle CreateTexture(in TextureDescription description)Creates a texture.
public TextureViewHandle CreateTextureView(TextureHandle texture, PixelFormat format = Undefined, int baseMipLevel = 0, int mipLevelCount = 0, int baseArrayLayer = 0, int arrayLayerCount = 0)Creates a view of part of a texture.
public SamplerHandle CreateSampler(in SamplerDescription description)Creates a sampler.
public ShaderHandle CreateShader(ShaderStage stage, ReadOnlySpan<byte> bytecode, string name = "")Creates a shader module from compiled bytecode.
public void Write(BufferHandle buffer, long offset, ReadOnlySpan<byte> data)Writes into a host-visible buffer.
public void Read(BufferHandle buffer, long offset, Span<byte> destination)Reads out of a readback buffer.
public void Destroy(BufferHandle handle)Returns a buffer.
public void Destroy(TextureHandle handle)Returns a texture.
public void Destroy(TextureViewHandle handle)Returns a texture view.
public void Destroy(SamplerHandle handle)Returns a sampler.
public void Destroy(ShaderHandle handle)Returns a shader module.
public QueryPoolHandle CreateQueryPool(in QueryPoolDescription description)Creates a pool of GPU queries.
public void Destroy(QueryPoolHandle handle)Returns a query pool.
public bool TryResolveQueries(QueryPoolHandle pool, int first, Span<ulong> results)
Used by (63, showing 40)
- PbrShowcaseGamePbrShowcase
- TriangleGameHelloTriangle
- UiHostHelloUi
- VideoGameVideoPlayback
- VirtualGeometryGameVirtualGeometry
- AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
- BindlessSamplingDeviceTestsVixen.Graphics.Golden.Tests
- BindlessTableDeviceTestsVixen.Graphics.Golden.Tests
- BufferTransferDeviceTestsVixen.Graphics.Golden.Tests
- ChainVixen.Graphics.Golden.Tests
- ClusterCullingDeviceTestsVixen.Graphics.Golden.Tests
- ClusteredShadingDeviceTestsVixen.Graphics.Golden.Tests
- CompilerVixen.Graphics.Golden.Tests
- CompositorImageTestsVixen.Graphics.Golden.Tests
- DistanceFieldAoImageTestsVixen.Graphics.Golden.Tests
- EditorGizmoFacingDeviceTestsVixen.Graphics.Golden.Tests
- FixtureVixen.Graphics.Golden.Tests
- FlatVixen.Graphics.Golden.Tests
- IndirectDiffuseImageTestsVixen.Graphics.Golden.Tests
- IrradianceBounceDeviceTestsVixen.Graphics.Golden.Tests
- IrradianceCaptureDeviceTestsVixen.Graphics.Golden.Tests
- IrradianceFillDeviceTestsVixen.Graphics.Golden.Tests
- IrradianceRepairDeviceTestsVixen.Graphics.Golden.Tests
- IrradianceShadingDeviceTestsVixen.Graphics.Golden.Tests
- ParticleSpriteDeviceTestsVixen.Graphics.Golden.Tests
- PipelineStateImageTestsVixen.Graphics.Golden.Tests
- ReflectionRendererDeviceTestsVixen.Graphics.Golden.Tests
- ReflectionTraceDeviceTestsVixen.Graphics.Golden.Tests
- RenderPassCacheVixen.Graphics.Vulkan
- SceneVixen.Graphics.Golden.Tests
- ScreenProbeAccumulateDeviceTestsVixen.Graphics.Golden.Tests
- ScreenProbeBilateralImageTestsVixen.Graphics.Golden.Tests
- ScreenProbeGatherImageTestsVixen.Graphics.Golden.Tests
- ScreenProbeResolveDeviceTestsVixen.Graphics.Golden.Tests
- ScreenProbeTraceDeviceTestsVixen.Graphics.Golden.Tests
- ScreenProbeUpsampleImageTestsVixen.Graphics.Golden.Tests
- ScreenPyramidDeviceTestsVixen.Graphics.Golden.Tests
- ShaderRunVixen.Raven.Gpu.Tests
- ShadowedVixen.Graphics.Golden.Tests
- SurfaceCacheRadiosityDeviceTestsVixen.Graphics.Golden.Tests