Class VKExtensionsMethods
Extension methods used to convert values from Evergine to DirectX.
Namespace: Evergine.Vulkan
Assembly: Evergine.Vulkan.dll
Syntax
public static class VKExtensionsMethods
Methods
FromVulkan(VkFormat)
Converts to Evergine pixel format.
Declaration
public static PixelFormat FromVulkan(this VkFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| VkFormat | format | The format to be converted. |
Returns
| Type | Description |
|---|---|
| PixelFormat | The Evergine format. |
GetAccelerationStructureAddress(VkAccelerationStructureKHR, VkDevice)
Gets the address from the native Vulkan acceleration structure.
Declaration
public static ulong GetAccelerationStructureAddress(this VkAccelerationStructureKHR accelerationStructure, VkDevice device)
Parameters
| Type | Name | Description |
|---|---|---|
| VkAccelerationStructureKHR | accelerationStructure | Native acceleration structure. |
| VkDevice | device | Vulkan device. |
Returns
| Type | Description |
|---|---|
| ulong | Acceleration structure address. |
GetBufferAddress(VkBuffer, VkDevice)
Gets the address from a native Vulkan buffer.
Declaration
public static ulong GetBufferAddress(this VkBuffer buffer, VkDevice device)
Parameters
| Type | Name | Description |
|---|---|---|
| VkBuffer | buffer | Native buffer. |
| VkDevice | device | Vulkan device. |
Returns
| Type | Description |
|---|---|
| ulong | Buffer address. |
ToVulkan(Blend)
Converts to Vulkan blend factor.
Declaration
public static VkBlendFactor ToVulkan(this Blend blend)
Parameters
| Type | Name | Description |
|---|---|---|
| Blend | blend | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkBlendFactor | The native value. |
ToVulkan(BlendOperation)
Converts to a Vulkan blend operation.
Declaration
public static VkBlendOp ToVulkan(this BlendOperation operation)
Parameters
| Type | Name | Description |
|---|---|---|
| BlendOperation | operation | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkBlendOp | The native value. |
ToVulkan(ColorWriteChannels)
Converts to Vulkan ColorComponentFlags.
Declaration
public static VkColorComponentFlags ToVulkan(this ColorWriteChannels channels)
Parameters
| Type | Name | Description |
|---|---|---|
| ColorWriteChannels | channels | The value to be converted. |
Returns
| Type | Description |
|---|---|
| VkColorComponentFlags | The native value. |
ToVulkan(ComparisonFunction)
Converts to Vulkan compare function.
Declaration
public static VkCompareOp ToVulkan(this ComparisonFunction function)
Parameters
| Type | Name | Description |
|---|---|---|
| ComparisonFunction | function | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkCompareOp | The native value. |
ToVulkan(CullMode)
Converts to the native CullMode.
Declaration
public static VkCullModeFlags ToVulkan(this CullMode cullMode)
Parameters
| Type | Name | Description |
|---|---|---|
| CullMode | cullMode | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkCullModeFlags | The native value. |
ToVulkan(ElementFormat)
Converts to Vulkan vertex format.
Declaration
public static VkFormat ToVulkan(this ElementFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| ElementFormat | format | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkFormat | The native value. |
ToVulkan(FillMode)
Converts to the native PolygonMode.
Declaration
public static VkPolygonMode ToVulkan(this FillMode fillMode)
Parameters
| Type | Name | Description |
|---|---|---|
| FillMode | fillMode | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkPolygonMode | The native value. |
ToVulkan(IndexFormat)
Converts from index format to Vulkan format.
Declaration
public static VkIndexType ToVulkan(this IndexFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| IndexFormat | format | The index format to convert. |
Returns
| Type | Description |
|---|---|
| VkIndexType | The resulting Vulkan format. |
ToVulkan(PixelFormat, bool)
Converts to a native pixel format.
Declaration
public static VkFormat ToVulkan(this PixelFormat format, bool depthFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| PixelFormat | format | The format to convert. |
| bool | depthFormat | Indicates whether it is a depth texture. |
Returns
| Type | Description |
|---|---|
| VkFormat | The native Vulkan format. |
ToVulkan(PrimitiveTopology)
Converts to Vulkan primitive topology.
Declaration
public static VkPrimitiveTopology ToVulkan(this PrimitiveTopology topology)
Parameters
| Type | Name | Description |
|---|---|---|
| PrimitiveTopology | topology | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkPrimitiveTopology | The native value. |
ToVulkan(AccelerationStructureFlags)
Converts from AccelerationStructureFlags to Vulkan VkBuildAccelerationStructureFlagsKHR.
Declaration
public static VkBuildAccelerationStructureFlagsKHR ToVulkan(this AccelerationStructureFlags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| AccelerationStructureFlags | flags | The flags to convert. |
Returns
| Type | Description |
|---|---|
| VkBuildAccelerationStructureFlagsKHR | The converted flags. |
ToVulkan(AccelerationStructureInstanceFlags)
Converts instance flags to Vulkan instance flags.
Declaration
public static VkGeometryInstanceFlagsKHR ToVulkan(this AccelerationStructureInstanceFlags flags)
Parameters
| Type | Name | Description |
|---|---|---|
| AccelerationStructureInstanceFlags | flags | The flags to convert. |
Returns
| Type | Description |
|---|---|
| VkGeometryInstanceFlagsKHR | The Vulkan flags. |
ToVulkan(ResourceType, bool)
Converts to native DescriptorType.
Declaration
public static VkDescriptorType ToVulkan(this ResourceType type, bool allowDynamicOffset = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ResourceType | type | The resource type value. |
| bool | allowDynamicOffset | Allows dynamic offset. |
Returns
| Type | Description |
|---|---|
| VkDescriptorType | The native resource type. |
ToVulkan(SamplerBorderColor)
Converts to native border color.
Declaration
public static VkBorderColor ToVulkan(this SamplerBorderColor borderColor)
Parameters
| Type | Name | Description |
|---|---|---|
| SamplerBorderColor | borderColor | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkBorderColor | The MTLSamplerBorderColor value. |
ToVulkan(ShaderStages)
Converts to a native shader stage.
Declaration
public static VkShaderStageFlags ToVulkan(this ShaderStages stage)
Parameters
| Type | Name | Description |
|---|---|---|
| ShaderStages | stage | The stage value to convert. |
Returns
| Type | Description |
|---|---|
| VkShaderStageFlags | The native shader stage. |
ToVulkan(StencilOperation)
Converts to Vulkan stencil operation.
Declaration
public static VkStencilOp ToVulkan(this StencilOperation operation)
Parameters
| Type | Name | Description |
|---|---|---|
| StencilOperation | operation | The value to convert. |
Returns
| Type | Description |
|---|---|
| VkStencilOp | The converted native value. |
ToVulkan(TextureAddressMode)
Converts to Vulkan sampler address mode.
Declaration
public static VkSamplerAddressMode ToVulkan(this TextureAddressMode addressMode)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureAddressMode | addressMode | The address mode to convert. |
Returns
| Type | Description |
|---|---|
| VkSamplerAddressMode | The native address mode. |
ToVulkan(TextureFilter, out VkFilter, out VkFilter, out VkSamplerMipmapMode)
Converts to native Vulkan minFilter, magFilter, and samplerMipmapMode.
Declaration
public static void ToVulkan(this TextureFilter filter, out VkFilter minFilter, out VkFilter magFilter, out VkSamplerMipmapMode mipmapMode)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureFilter | filter | The texture filter to convert. |
| VkFilter | minFilter | The native minFilter. |
| VkFilter | magFilter | The native magFilter. |
| VkSamplerMipmapMode | mipmapMode | The native mipmapMode. |
ToVulkan(TextureSampleCount)
Converts to native sample count.
Declaration
public static VkSampleCountFlags ToVulkan(this TextureSampleCount sampleCount)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureSampleCount | sampleCount | The sample count value to convert. |
Returns
| Type | Description |
|---|---|
| VkSampleCountFlags | The native sample count. |