Class VKGraphicsContext
Graphics context for Vulkan.
Implements
Inherited Members
Namespace: Evergine.Vulkan
Assembly: Evergine.Vulkan.dll
Syntax
public class VKGraphicsContext : GraphicsContext, IGetNativePointers
Constructors
VKGraphicsContext()
Initializes a new instance of the VKGraphicsContext class.
Declaration
public VKGraphicsContext()
VKGraphicsContext(IEnumerable<string>, IEnumerable<string>)
Initializes a new instance of the VKGraphicsContext class.
Declaration
public VKGraphicsContext(IEnumerable<string> deviceExtensionsToEnable, IEnumerable<string> instanceExtensionsToEnable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | deviceExtensionsToEnable | Set of device extensions to be enabled for this application. |
IEnumerable<string> | instanceExtensionsToEnable | Set of instance extensions to be enabled for this application. |
Fields
CopyCommandBuffer
The Vulkan command buffer used to execute copy commands.
Declaration
public VkCommandBuffer CopyCommandBuffer
Field Value
Type | Description |
---|---|
VkCommandBuffer |
DeviceExtensionsToEnable
Set of device extensions to be enabled for this application.
Declaration
public readonly List<string> DeviceExtensionsToEnable
Field Value
Type | Description |
---|---|
List<string> |
Remarks
Must be set before creating the device.
InstanceExtensionsToEnable
Set of device instance extensions to be enabled for this application.
Declaration
public readonly List<string> InstanceExtensionsToEnable
Field Value
Type | Description |
---|---|
List<string> |
Remarks
Must be set before creating the device.
VkDevice
Vulkan device object.
Declaration
public VkDevice VkDevice
Field Value
Type | Description |
---|---|
VkDevice |
VkInstance
Vulkan instance object.
Declaration
public VkInstance VkInstance
Field Value
Type | Description |
---|---|
VkInstance |
VkPhysicalDevice
Vulkan physical device object.
Declaration
public VkPhysicalDevice VkPhysicalDevice
Field Value
Type | Description |
---|---|
VkPhysicalDevice |
VkPhysicalDeviceMemoryProperties
Vulkan physical device memory properties.
Declaration
public VkPhysicalDeviceMemoryProperties VkPhysicalDeviceMemoryProperties
Field Value
Type | Description |
---|---|
VkPhysicalDeviceMemoryProperties |
disposed
Indicates whether the object is disposed.
Declaration
protected bool disposed
Field Value
Type | Description |
---|---|
bool |
Properties
BackendType
Gets the backend type (DirectX, OpenGL, etc.)
Declaration
public override GraphicsBackend BackendType { get; }
Property Value
Type | Description |
---|---|
GraphicsBackend |
Overrides
Capabilities
Gets the capabilities of this graphics context.
Declaration
public override GraphicsContextCapabilities Capabilities { get; }
Property Value
Type | Description |
---|---|
GraphicsContextCapabilities |
Overrides
NativeDevicePointer
Gets the native device pointer.
Declaration
public override nint NativeDevicePointer { get; }
Property Value
Type | Description |
---|---|
nint |
Overrides
Methods
CreateDeviceInternal()
Initializes the graphics context to be used in a compute shader.
Declaration
public override void CreateDeviceInternal()
Overrides
CreateSwapChain(SwapChainDescription)
Initializes the swap chain.
Declaration
public override SwapChain CreateSwapChain(SwapChainDescription description)
Parameters
Type | Name | Description |
---|---|---|
SwapChainDescription | description | The swap chain descriptor. |
Returns
Type | Description |
---|---|
SwapChain | Created Swap chain. |
Overrides
Dispose(bool)
Releases unmanaged and optionally managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
|
Overrides
GenerateTextureMipmapping(Texture)
Generates mipmapping texture levels.
Declaration
public override bool GenerateTextureMipmapping(Texture texture)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | The texture for which mipmapping is generated. |
Returns
Type | Description |
---|---|
bool | True if the mipmapping has been generated. |
Overrides
GetNativePointer(string, out nint)
Obtains a native pointer for this graphics context using the given key.
Declaration
public override bool GetNativePointer(string pointerKey, out nint nativePointer)
Parameters
Type | Name | Description |
---|---|---|
string | pointerKey | The pointer key. |
nint | nativePointer | The native pointer. |
Returns
Type | Description |
---|---|
bool | True if there is an available pointer with this key. |
Overrides
InternalUpdateBufferData(Buffer, nint, uint, uint)
Fills the buffer from a pointer.
Declaration
protected override void InternalUpdateBufferData(Buffer buffer, nint source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
Type | Name | Description |
---|---|---|
Buffer | buffer | Buffer instance. |
nint | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | destinationOffsetInBytes | The offset in bytes. |
Overrides
MapMemory(GraphicsResource, MapMode, uint)
Declaration
public override MappedResource MapMemory(GraphicsResource resource, MapMode mode, uint subResource = 0)
Parameters
Type | Name | Description |
---|---|---|
GraphicsResource | resource | The graphics resource to map. |
MapMode | mode | The MapMode used to map the resource. |
uint | subResource | The subresource to map. Subresources are indexed first by mip slice and then by array layer. Applies only to Textures. |
Returns
Type | Description |
---|---|
MappedResource | A MappedResource structure describing the mapped data region. |
Overrides
ShaderCompile(string, string, ShaderStages, CompilerParameters)
Converts the shader source into bytecode.
Declaration
public override CompilationResult ShaderCompile(string shaderSource, string entryPoint, ShaderStages stage, CompilerParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
string | shaderSource | The shader source text. |
string | entryPoint | The entry point function name. |
ShaderStages | stage | The shader stage, ShaderStages. |
CompilerParameters | parameters | The compiler parameters. |
Returns
Type | Description |
---|---|
CompilationResult | The shader bytecode. |
Overrides
SyncUpcopyQueue()
Syncs the current buffer data in the copyQueue. Internal function used in the UploadBuffer strategy.
Declaration
public override void SyncUpcopyQueue()
Overrides
UnmapMemory(GraphicsResource, uint)
Declaration
public override void UnmapMemory(GraphicsResource resource, uint subResource = 0)
Parameters
Type | Name | Description |
---|---|---|
GraphicsResource | resource | The graphics resource to unmap. |
uint | subResource | The subresource to unmap. Subresources are indexed first by mip slice and then by array layer. Only for Textures. |
Overrides
UpdateTextureData(Texture, nint, uint, uint)
Fills the buffer from a pointer.
Declaration
public override void UpdateTextureData(Texture texture, nint source, uint sourceSizeInBytes, uint subResource)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | Texture instance. |
nint | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | subResource | The sub-resource index. |