Search Results for

    Show / Hide Table of Contents

    Class MTLTexture

    This class represents a native texture object in Metal.

    Inheritance
    object
    GraphicsResource
    Texture
    MTLTexture
    Implements
    ILoadable
    IDependencyObject
    Inherited Members
    Texture.Id
    Texture.Description
    Texture.ReaderVersion
    Texture.Invalidated
    Texture.Dependencies
    Texture.Sampler
    Texture.CouldBeAttachedToFramebuffer
    Texture.Invalidate(ILoadable)
    Texture.ReleaseUnusedMemory()
    GraphicsResource.disposed
    GraphicsResource.Context
    GraphicsResource.Disposed
    Namespace: Evergine.Metal
    Assembly: Evergine.Metal.dll
    Syntax
    public class MTLTexture : Texture, ILoadable, 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 IMTLBuffer NativeBuffer
    Field Value
    Type Description
    IMTLBuffer

    NativeTexture

    The native texture object.

    Declaration
    public IMTLTexture NativeTexture
    Field Value
    Type Description
    IMTLTexture

    PixelFormat

    The native pixel format 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 debugger tools.

    Declaration
    public override string Name { get; set; }
    Property Value
    Type Description
    string
    Overrides
    Texture.Name

    NativePointer

    Gets the native pointer.

    Declaration
    public override nint NativePointer { get; }
    Property Value
    Type Description
    nint
    Overrides
    GraphicsResource.NativePointer

    Methods

    CopyTo(IMTLBlitCommandEncoder, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint, uint, uint, uint)

    Copies a pixel region from the source to the destination texture.

    Declaration
    public void CopyTo(IMTLBlitCommandEncoder 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
    IMTLBlitCommandEncoder commandBuffer

    The copy command buffer.

    uint sourceX

    U coordinate of the source texture.

    uint sourceY

    V coordinate of the source texture.

    uint sourceZ

    W coordinate of the source texture.

    uint sourceMipLevel

    Source mip level.

    uint sourceBaseArray

    Source array index.

    Texture destination

    Destination texture.

    uint destinationX

    U coordinate of the destination texture.

    uint destinationY

    V coordinate of the destination texture.

    uint destinationZ

    W coordinate of the destination texture.

    uint destinationMipLevel

    Destination mip level.

    uint destinationBasedArray

    Destination array index.

    uint width

    Destination width.

    uint height

    Destination height.

    uint depth

    Destination depth.

    uint layerCount

    Destination layer count.

    Dispose()

    Performs application-defined tasks related to freeing, releasing, or resetting unmanaged resources.

    Declaration
    public override void Dispose()
    Overrides
    Texture.Dispose()

    FromMetalImage(MTLGraphicsContext, ref TextureDescription, IMTLTexture)

    Creates a new texture from an MTLTexture.

    Declaration
    public static MTLTexture FromMetalImage(MTLGraphicsContext context, ref TextureDescription description, IMTLTexture image)
    Parameters
    Type Name Description
    MTLGraphicsContext context

    The graphics context.

    TextureDescription description

    The texture description.

    IMTLTexture image

    The metal image already created.

    Returns
    Type Description
    MTLTexture

    A new MTLTexture.

    SetData(IMTLBlitCommandEncoder, nint, uint, uint)

    Fills the buffer from a pointer.

    Declaration
    public void SetData(IMTLBlitCommandEncoder commandBuffer, nint source, uint sourceSizeInBytes, uint subResource = 0)
    Parameters
    Type Name Description
    IMTLBlitCommandEncoder commandBuffer

    The copy command buffer.

    nint source

    The data pointer.

    uint sourceSizeInBytes

    The size in bytes.

    uint subResource

    The subresource index.

    ToStaging()

    Returns a new Buffer with ResourceUsage set to staging.

    Declaration
    public MTLTexture ToStaging()
    Returns
    Type Description
    MTLTexture

    New staging Buffer.

    Implements

    ILoadable
    IDependencyObject

    Extension Methods

    TextureExtension.SaveToFile(Texture, GraphicsContext, string)
    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX