Click or drag to resize
Ab4d.SharpEngine logo

VulkanDevice Class

VulkanDevice represents the Vulkan device that defines resources on the graphics card and is used to render objects defined by a Scene object. To share resources between multiple Scene objects, create all Scene objects by the same VulkanDevice instance. To create a VulkanDevice use the static Create method.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.CoreComponentBase
    Ab4d.SharpEngine.VulkanVulkanDevice

Namespace: Ab4d.SharpEngine.Vulkan
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class VulkanDevice : ComponentBase, 
	IDisposable

The VulkanDevice type exposes the following members.

Properties
 NameDescription
Public propertyApiVersion 
Public propertyAutomaticallyDisposeSurface 
Public propertyCreateOptions 
Public propertyDebugUtils 
Public propertyDefaultBitmapIO Gets or sets the default (or fallback) BitmapIO that is used to read (and write) images. By default this is set to an instance of PngBitmapIO. This can be changed by the user to some other IBitmapIO implementation.
Public propertyDefaultSurface 
Public propertyDefaultSurfaceDetails 
Public propertyDevice 
Public propertyEnabledDeviceExtensionNames Gets an array of Device extension names that are enabled for this device. To quickly check if an extension is enabled, you can also check the EnabledDeviceExtensions property (note that this does not include all extensions but only extensions that are supported by SharpEngine).
Public propertyEnabledDeviceExtensions Gets a SupportedDeviceExtensions that can be used to quickly check which Device Extensions are enabled on this device. This value can include only extension names that are supported by SharpEngine (and defined in SupportedDeviceExtensions enum). This value includes also extensions that are promoted to the current Vulkan API (and are not explicitly specified in the EnabledDeviceExtensionNames array). To get an array of all enabled extensions see the EnabledDeviceExtensionNames.
Public propertyGpuName Gets the name of the used device (graphics card).
Public propertyGraphicsCommandPool 
Public propertyGraphicsQueue 
Public propertyHasTransferQueueFamily 
Public propertyIsDebugUtilsExtensionEnabled 
Public propertyIsIntegratedGpu When true, then this device is an integrated GPU (usually an Intel or AMD GPU that is integrated into the CPU).
Public propertyIsPrimarySystemDevice Gets Boolean that specifies if this device is using the primary (default) system graphic card.
Public propertyIsStandardValidationEnabled 
Public propertyKhrSwapchainExt 
Public propertyLineRasterizationExt 
Public propertyMemoryAllocator 
Public propertyPhysicalDevice 
Public propertyPhysicalDeviceDetails 
Public propertyQueueFamilyIndices 
Public propertySamplerFactory 
Public propertyShadersManager 
Public propertyTransferCommandPool 
Public propertyTransferQueue 
Public propertyVertexBufferDescriptionsManager 
Public propertyVulkanInstance 
Top
Methods
 NameDescription
Public methodAllocateMemory(Buffer, MemoryPropertyFlags, Boolean, String) 
Public methodAllocateMemory(Image, MemoryPropertyFlags, Boolean, String) 
Public methodAllocateMemory(MemoryRequirements, MemoryPropertyFlags, Boolean, Boolean, String) 
Public methodAllocateMemory(UInt32, UInt32, Int32, Boolean, Boolean, String) 
Public methodAllocateShaderSpecializationInfoT(T, Int32, String) 
Public methodAllocateShaderSpecializationInfoT(T, Int32, String) 
Public methodBeginGraphicsCommands 
Public methodBeginStagingCommands 
Public methodCacheObject CacheObject sets the specified objectToCache to the specified key in the dictionary used by this VulkanDevice. The cached object can be retrieved by GetCachedObjectT(String) or removed by RemoveCachedObject(String) method. This method is thread safe and can be called from any thread.
Public methodCalculateMipLevelsCount 
Public methodStatic memberCheckDeviceMinimumRequirements(VulkanInstance, PhysicalDevice, Boolean) Returns true if the specified physicalDevice is supported to run Ab4d.SharpEngine.
Public methodStatic memberCheckDeviceMinimumRequirements(PhysicalDeviceDetails, SurfaceDetails, Boolean, Boolean) Returns true if the physicalDevice (specified in physicalDeviceDetails) is supported to run SharpEngine. When isSurfaceSupportRequired is true, then also the vulkanSurface is checked.
Public methodStatic memberCheckDeviceMinimumRequirements(VulkanInstance, PhysicalDevice, SurfaceKHR, Boolean, Boolean) Returns true if the specified physicalDevice is supported to run Ab4d.SharpEngine. When isSurfaceSupportRequired is true, then also the vulkanSurface is checked.
Public methodCheckIsOnMainThread CheckIsOnMainThread method thrown an exception when the current thread is not main thread.
Public methodCopyBuffer 
Public methodCopyDataToGpuImage(GpuImage, GpuBuffer, Boolean, ImageLayout, AccessFlags, PipelineStageFlags) 
Public methodCopyDataToGpuImage(GpuImage, Int32, Int32, Int32, DeviceMemory, Int32, Byte, ImageLayout, AccessFlags, PipelineStageFlags) 
Public methodCopyDataToGpuImage(Image, Int32, Int32, Int32, AccessFlags, ImageLayout, PipelineStageFlags, DeviceMemory, Int32, Byte, ImageLayout, AccessFlags, PipelineStageFlags) 
Public methodCopyDataToImage 
Public methodCopyGpuImage 
Public methodCopyImage(Image, ImageLayout, AccessFlags, PipelineStageFlags, Image, Int32, Int32, AccessFlags, ImageLayout, PipelineStageFlags, Boolean, ImageLayout, NullableSemaphore, NullableSemaphore) 
Public methodCopyImage(Image, ImageLayout, AccessFlags, PipelineStageFlags, Image, ImageCopy, ImageLayout, AccessFlags, PipelineStageFlags, Boolean, ImageLayout, AccessFlags, PipelineStageFlags, NullableSemaphore, NullableSemaphore) 
Public methodCopyToGpuImage 
Public methodStatic memberCreate(ActionEngineCreateOptions, String) Creates an instance of VulkanDevice by using an action that defines the EngineCreateOptions. This method will also create a VulkanInstance if it was not created before.
Public methodStatic memberCreate(EngineCreateOptions, String) Creates an instance of VulkanDevice. Optionally the EngineCreateOptions can be used to specify the creation options. This method will also create a VulkanInstance if it was not created before.
Public methodStatic memberCreate(SurfaceKHR, EngineCreateOptions, String) Creates an instance of VulkanDevice that will use the Vulkan surface that is defined by the SurfaceKHR. Optionally the EngineCreateOptions can be used to specify the creation options. This method will also create a VulkanInstance if it was not created before.
Public methodStatic memberCreate(SurfaceKHR, ActionEngineCreateOptions, String) Creates an instance of VulkanDevice that will use the Vulkan surface that is defined by the SurfaceKHR and will configure the EngineCreateOptions by using the specified configure action. This method will also create a VulkanInstance if it was not created before.
Public methodStatic memberCreate(VulkanSurfaceProvider, EngineCreateOptions, String) Creates an instance of VulkanDevice that will use the Vulkan surface that is defined by the VulkanSurfaceProvider. Optionally the EngineCreateOptions can be used to specify the creation options. This method will also create a VulkanInstance if it was not created before.
Public methodStatic memberCreate(VulkanSurfaceProvider, ActionEngineCreateOptions, String) Creates an instance of VulkanDevice that will use the Vulkan surface that is defined by the VulkanSurfaceProvider and will configure the EngineCreateOptions by using the specified configure action. This method will also create a VulkanInstance if it was not created before.
Public methodStatic memberCreate(VulkanInstance, PhysicalDeviceDetails, EngineCreateOptions, SurfaceKHR, String) Creates a new VulkanDevice with specified VulkanInstance, PhysicalDeviceDetails, EngineCreateOptions and optional surface and name.
Public methodStatic memberCreate(VulkanInstance, PhysicalDevice, EngineCreateOptions, SurfaceKHR, String) Creates a new VulkanDevice with specified VulkanInstance, PhysicalDevice, EngineCreateOptions and optional surface and name.
Public methodCreateBufferT(Span, Void, T, BufferCreateInfo) 
Public methodCreateBufferT(T, BufferUsageFlags, Boolean, String) 
Public methodCreateBufferT(T, BufferUsageFlags, QueueFlags, MemoryPropertyFlags, String) 
Public methodCreateBufferT(T, BufferUsageFlags, Boolean, Boolean, String) 
Public methodCreateBuffers(Int32, Int32, BufferUsageFlags, Type, Int32, String) 
Public methodCreateBuffers(Int32, Int32, BufferUsageFlags, Type, Int32, Boolean, String) 
Public methodCreateCommandBuffers 
Public methodCreateCommandPool 
Public methodCreateDescriptorPool(DescriptorType, Int32, Boolean, String) 
Public methodCreateDescriptorPool(DescriptorType, Int32, Boolean, String) 
Public methodCreateDescriptorPool(DescriptorType, Int32, Boolean, String) 
Public methodCreateDescriptorSetLayout(DescriptorType, ShaderStageFlags, String) 
Public methodCreateDescriptorSetLayout(DescriptorType, ShaderStageFlags, Int32, String) 
Public methodCreateDescriptorSetLayout(DescriptorType, ShaderStageFlags, Int32, String) 
Public methodCreateDescriptorSets 
Public methodCreateDynamicUniformBuffers 
Public methodCreateFence 
Public methodCreateFrameBuffers(ImageView, ImageView, Int32, Int32, RenderPass, String) 
Public methodCreateFrameBuffers(ImageView, ImageView, Int32, Int32, RenderPass, Framebuffer, String) 
Public methodCreateGraphicsCommandPool 
Public methodCreateImageViews(Image, Format, ImageAspectFlags, String) 
Public methodCreateImageViews(Image, Format, ImageView, ImageAspectFlags, String) 
Public methodCreateMultiSampledFrameBuffers 
Public methodCreateMultiSampledRenderPass 
Public methodCreatePipelineLayout(DescriptorSetLayout, PushConstantRange, String) 
Public methodCreatePipelineLayout(DescriptorSetLayout, Int32, Int32, String) 
Public methodCreateSampler 
Public methodCreateSemaphore 
Public methodCreateStandardRenderPass 
Public methodCreateSwapChain 
Public methodCreateSwapChainImages(SwapchainKHR, String) 
Public methodCreateSwapChainImages(SwapchainKHR, Image, String) 
Public methodCreateUniformBuffers 
Public methodDispose Dispose
Protected methodDispose(Boolean) Dispose
(Overrides ComponentBaseDispose(Boolean))
Public methodDisposeVulkanResourceOnMainThreadAfterFrameRendered DisposeVulkanResourceOnMainThreadAfterFrameRendered method disposes the Vulkan resources with the specified type and handle on the main thread and after the rendering of the current frame is complete and the GPU resources for that frame are no longer used. If this is called on the main thread and if the current frame is already fully rendered (for example after calling WaitUntilIdle, then the specified Vulkan resource is immediately disposed. This method can be called from any thread.
Public methodDumpMemoryReport Writes string that contains details memory usage of this device.
Public methodDumpResources Writes string that contains details tracked resources (objected derived from ComponentBase) to the console (when the application is debugged in Visual Studio the result is written to Output window or Immediate Window if started from there; in Rider the result is written to Debug Output window). To get a meaningful result, enable tracking resource on application startup. This can be done by setting static ComponentBase.ResourcesTracker.IsTrackingResources to true.
Public methodDumpResourcesForDelayedDisposal Writes string that contains details about resources that are scheduled to be disposed when the background rendering of frames is completed.
Public methodEndGraphicsCommands(Boolean, Boolean) 
Public methodEndGraphicsCommands(Semaphore, Semaphore) 
Public methodEndStagingCommands 
Public methodExecuteOnMainThread ExecuteOnMainThread executes the specified action on the main thread (the same thread the VulkanDevice was created on). If this is called on the main thread, then the action is immediately executed, otherwise the action is saved and it will be executed when the RunAllUpdateActions method will be called (usually at the beginning of the update render phase). This method can be called from any thread.
Public methodExecuteOnMainThreadAfterFrameRendered ExecuteOnMainThreadAfterFrameRendered executes the specified action on the main thread (the same thread the VulkanDevice was created on) and after the rendering of the current frame is complete and the GPU resources for that frame are no longer used. If this is called on the main thread and if the current frame is already fully rendered (for example after calling WaitUntilIdle, then the action is immediately executed, otherwise the action is saved and it will be executed when on the main thread and after the frame is rendered. This method can be called from any thread.
Public methodFreeMemory 
Public methodGetCachedObjectT GetCachedObject gets the object that was previously stored by the to CacheObject(String, Object) method. If the key is not found a default value of T (null for reference types) is returned. This method is thread safe and can be called from any thread.
Public methodGetCachedObjectsReportString Returns a string that shows which objects are cached by this VulkanDevice.
Public methodGetMemoryReportString Gets a string that contains details memory usage of this device.
Public methodGetPipelineCache 
Public methodStatic memberGetPreTransform 
Public methodGetResourcesForDelayedDisposalString 
Public methodGetResourcesReportString Gets a string with report of tracked resources (objected derived from ComponentBase). To get a meaningful result, enable tracking resource on application startup. This can be done by setting static ComponentBase.ResourcesTracker.IsTrackingResources to true.
Public methodGetSupportedDepthStencilFormat 
Public methodStatic memberGetVulkanFormat 
Public methodInsertImageMemoryBarrier(CommandBuffer, GpuImage, AccessFlags, ImageLayout, PipelineStageFlags, Int32, Int32) 
Public methodInsertImageMemoryBarrier(CommandBuffer, Image, AccessFlags, AccessFlags, ImageLayout, ImageLayout, PipelineStageFlags, PipelineStageFlags) 
Public methodInsertImageMemoryBarrier(CommandBuffer, Image, AccessFlags, AccessFlags, ImageLayout, ImageLayout, PipelineStageFlags, PipelineStageFlags, ImageSubresourceRange) 
Public methodInsertImageMemoryBarrier(CommandBuffer, Image, AccessFlags, AccessFlags, ImageLayout, ImageLayout, PipelineStageFlags, PipelineStageFlags, Int32, Int32) 
Public methodIsOnMainThread Returns true if the current thread is the same as the thread that was used to create this VulkanDevice.
Public methodMapMemoryT 
Public methodMultiPassDataCopyWithStagingT 
Public methodReadDataWithStagingT 
Public methodReleaseShaderSpecializationInfo 
Public methodRemoveCachedObject RemoveCachedObject removes the specified key from the dictionary used by this VulkanDevice. This method is thread safe and can be called from any thread.
Public methodRunAllUpdateActions RunAllUpdateActions executes all the actions that were added by the ExecuteOnMainThread(Action) method.
Protected methodSetupRequestedDeviceFeatures 
Public methodTransitionImageToShaderReadOnlyOptimalLayout 
Public methodUnmapMemory 
Public methodUpdateDescriptorSets 
Public methodWaitUntilIdle 
Public methodWriteDataWithStagingT WriteDataWithStaging writes the specified data to the destination buffer with using staging buffer (when staging buffer is not specified, then the standard staging buffer for this device is used). When the staging buffer is smaller then the data size, then a new ad-hoc staging buffer is created and disposed after being used.
Top
Fields
 NameDescription
Public fieldStatic memberDefaultFormat 
Public fieldStatic memberGlobalDynamicStates GlobalDynamicStates defines static array with dynamic states that are used by all pipelines. By default Viewport and Scissor dynamic states are used. Additional dynamic states can be added to specific pipelines by adding them to the EffectTechnique.[!:EffectTechnique.AdditionalDynamicStates] property.
Public fieldStatic memberPossibleDepthFormats 
Public fieldStatic memberPossibleDepthStencilFormats 
Public fieldSynchronizationContext When SynchronizationContext is not null, then it is possible to call its Send method to execute the code on the thread that was used to create this VulkanDevice.
Public fieldVk 
Top
See Also