Class MTLTexture
This class represents a native texture object on Metal.
Inherited Members
Namespace: Evergine.Metal
Assembly: Evergine.Metal.dll
Syntax
public class MTLTexture : Texture, ILoadable, IDisposable, IDependencyObject
Constructors
MTLTexture(MTLGraphicsContext, DataBox[], ref TextureDescription)
Initializes a new instance of the MTLTexture class.
Declaration
public MTLTexture(MTLGraphicsContext context, DataBox[] data, ref TextureDescription description)
Parameters
Type | Name | Description |
---|---|---|
MTLGraphicsContext | context | The graphics context. |
DataBox[] | data | The data pointer. |
TextureDescription | description | The texture description. |
MTLTexture(MTLGraphicsContext, DataBox[], ref TextureDescription, ref SamplerStateDescription)
Initializes a new instance of the MTLTexture class.
Declaration
public MTLTexture(MTLGraphicsContext context, DataBox[] data, ref TextureDescription description, ref SamplerStateDescription samplerState)
Parameters
Type | Name | Description |
---|---|---|
MTLGraphicsContext | context | The graphics context. |
DataBox[] | data | The data pointer. |
TextureDescription | description | The texture description. |
SamplerStateDescription | samplerState | the sampler state description for this texture. |
Fields
NativeBuffer
The native buffer object for staging textures.
Declaration
public MTLBuffer NativeBuffer
Field Value
Type | Description |
---|---|
MTLBuffer |
NativeTexture
The native texture object.
Declaration
public MTLTexture NativeTexture
Field Value
Type | Description |
---|---|
MTLTexture |
PixelFormat
The native pixelformat of this texture.
Declaration
public MTLPixelFormat PixelFormat
Field Value
Type | Description |
---|---|
MTLPixelFormat |
Properties
Name
Gets or sets a string identifying this instance. Can be used in graphics debuggers tools.
Declaration
public override string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
NativePointer
Gets the native pointer.
Declaration
public override IntPtr NativePointer { get; }
Property Value
Type | Description |
---|---|
IntPtr |
Overrides
Methods
CopyTo(MTLBlitCommandEncoder, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint, uint, uint, uint)
Copy a pixel region from source to destination texture.
Declaration
public void CopyTo(MTLBlitCommandEncoder commandBuffer, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBaseArray, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArray, uint width, uint height, uint depth, uint layerCount)
Parameters
Type | Name | Description |
---|---|---|
MTLBlitCommandEncoder | commandBuffer | The copy commandbuffer. |
uint | sourceX | U coord source texture. |
uint | sourceY | V coord source texture. |
uint | sourceZ | W coord source texture. |
uint | sourceMipLevel | Source mip level. |
uint | sourceBaseArray | Source array index. |
Texture | destination | Destination texture. |
uint | destinationX | U coord destination texture. |
uint | destinationY | V coord destination texture. |
uint | destinationZ | W coord destination texture. |
uint | destinationMipLevel | Destination mip level. |
uint | destinationBasedArray | Destination array index. |
uint | width | Destination width. |
uint | height | Destination heigh. |
uint | depth | Destination depth. |
uint | layerCount | Destination layer count. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
FromMetalImage(MTLGraphicsContext, ref TextureDescription, MTLTexture)
Create a new texture from a MTLTexture.
Declaration
public static MTLTexture FromMetalImage(MTLGraphicsContext context, ref TextureDescription description, MTLTexture image)
Parameters
Type | Name | Description |
---|---|---|
MTLGraphicsContext | context | The graphics context. |
TextureDescription | description | The texture description. |
MTLTexture | image | The metal image already created. |
Returns
Type | Description |
---|---|
MTLTexture | A new VKTexture. |
SetData(MTLBlitCommandEncoder, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
public void SetData(MTLBlitCommandEncoder commandBuffer, IntPtr source, uint sourceSizeInBytes, uint subResource = 0)
Parameters
Type | Name | Description |
---|---|---|
MTLBlitCommandEncoder | commandBuffer | The copy commandbuffer. |
IntPtr | source | The data pointer. |
uint | sourceSizeInBytes | The size in bytes. |
uint | subResource | The subresource index. |
ToStaging()
Return a new Buffer with ResourceUsage set to staging.
Declaration
public MTLTexture ToStaging()
Returns
Type | Description |
---|---|
MTLTexture | New staging Buffer. |