Class MTLExtensionsMethods
Extension methods used to convert values from Evergine to DirectX.
Namespace: Evergine.Metal
Assembly: Evergine.Metal.dll
Syntax
public static class MTLExtensionsMethods
Methods
FromMetal(MTLPixelFormat)
Converts to the Evergine pixel format.
Declaration
public static PixelFormat FromMetal(this MTLPixelFormat format)
Parameters
Type | Name | Description |
---|---|---|
MTLPixelFormat | format | The format to convert. |
Returns
Type | Description |
---|---|
PixelFormat | The Evergine format. |
ToMetal(Blend)
Converts to a native blend factor.
Declaration
public static MTLBlendFactor ToMetal(this Blend blend)
Parameters
Type | Name | Description |
---|---|---|
Blend | blend | The value to convert. |
Returns
Type | Description |
---|---|
MTLBlendFactor | The native value. |
ToMetal(BlendOperation)
Converts to a native blend operation.
Declaration
public static MTLBlendOperation ToMetal(this BlendOperation operation)
Parameters
Type | Name | Description |
---|---|---|
BlendOperation | operation | The value to convert. |
Returns
Type | Description |
---|---|
MTLBlendOperation | The native value. |
ToMetal(ComparisonFunction)
Converts to a Metal compare function.
Declaration
public static MTLCompareFunction ToMetal(this ComparisonFunction function)
Parameters
Type | Name | Description |
---|---|---|
ComparisonFunction | function | The value to convert. |
Returns
Type | Description |
---|---|
MTLCompareFunction | The native value. |
ToMetal(CullMode)
Converts to the native CullMode.
Declaration
public static MTLCullMode ToMetal(this CullMode cullMode)
Parameters
Type | Name | Description |
---|---|---|
CullMode | cullMode | The value to be converted. |
Returns
Type | Description |
---|---|
MTLCullMode | The native value. |
ToMetal(ElementFormat)
To convert from VertexElementFormat to Metal format.
Declaration
public static MTLVertexFormat ToMetal(this ElementFormat format)
Parameters
Type | Name | Description |
---|---|---|
ElementFormat | format | The format to convert. |
Returns
Type | Description |
---|---|
MTLVertexFormat | The resulting Metal format. |
ToMetal(PixelFormat, bool)
Converts to a native pixel format.
Declaration
public static MTLPixelFormat ToMetal(this PixelFormat format, bool depthFormat)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | The format to convert. |
bool | depthFormat | Whether it is a depth texture. |
Returns
Type | Description |
---|---|
MTLPixelFormat | The native Metal format. |
ToMetal(PrimitiveTopology)
Converts to native primitive topology.
Declaration
public static MTLPrimitiveType ToMetal(this PrimitiveTopology primitive)
Parameters
Type | Name | Description |
---|---|---|
PrimitiveTopology | primitive | The primitive topology to convert. |
Returns
Type | Description |
---|---|
MTLPrimitiveType | The native primitive topology. |
ToMetal(SamplerBorderColor)
Converts to native border color.
Declaration
public static MTLSamplerBorderColor ToMetal(this SamplerBorderColor borderColor)
Parameters
Type | Name | Description |
---|---|---|
SamplerBorderColor | borderColor | The value to convert. |
Returns
Type | Description |
---|---|
MTLSamplerBorderColor | The MTLSamplerBorderColor value. |
ToMetal(StencilOperation)
Converts to a native stencil operation.
Declaration
public static MTLStencilOperation ToMetal(this StencilOperation operation)
Parameters
Type | Name | Description |
---|---|---|
StencilOperation | operation | The value to convert. |
Returns
Type | Description |
---|---|
MTLStencilOperation | The native value. |
ToMetal(TextureAddressMode)
Converts to Metal sampler address mode.
Declaration
public static MTLSamplerAddressMode ToMetal(this TextureAddressMode addressMode)
Parameters
Type | Name | Description |
---|---|---|
TextureAddressMode | addressMode | The address mode to convert. |
Returns
Type | Description |
---|---|
MTLSamplerAddressMode | The native address mode. |
ToMetal(TextureFilter, out MTLSamplerMinMagFilter, out MTLSamplerMinMagFilter, out MTLSamplerMipFilter)
Converts to native Vulkan minFilter, magFilter, and SamplerMipmapMode.
Declaration
public static void ToMetal(this TextureFilter filter, out MTLSamplerMinMagFilter minFilter, out MTLSamplerMinMagFilter magFilter, out MTLSamplerMipFilter mipmapMode)
Parameters
Type | Name | Description |
---|---|---|
TextureFilter | filter | The texture filter to convert. |
MTLSamplerMinMagFilter | minFilter | The native minFilter. |
MTLSamplerMinMagFilter | magFilter | The native magFilter. |
MTLSamplerMipFilter | mipmapMode | The native mipmapMode. |
ToMetal(TextureSampleCount)
Converts from TextureSampleCount to DirectX SampleDescription.
Declaration
public static nuint ToMetal(this TextureSampleCount sampleCount)
Parameters
Type | Name | Description |
---|---|---|
TextureSampleCount | sampleCount | The TextureSampleCount to convert. |
Returns
Type | Description |
---|---|
nuint | The SampleDescription value. |
ToMetal(VertexStepFunction)
Converts to Metal InputClassification enum.
Declaration
public static MTLVertexStepFunction ToMetal(this VertexStepFunction stepFunction)
Parameters
Type | Name | Description |
---|---|---|
VertexStepFunction | stepFunction | The value to be converted. |
Returns
Type | Description |
---|---|
MTLVertexStepFunction | The native value. |