Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    TextureDescription Struct

    Namespace: Stride.Graphics
    Assembly: Stride.Graphics.dll

    A Common description for all textures.

    public struct TextureDescription : IEquatable<TextureDescription>
    Name Description
    Fields
    ArraySize

    Number of textures in the array. The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture1DArraySize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    Depth

    Texture depth (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture3DSize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    Dimension

    The dimension of a texture.

    Flags

    Flags (see SharpDX.Direct3D11.BindFlags) for binding to pipeline stages. The flags can be combined by a logical OR. For a 1D texture, the allowable values are: SharpDX.Direct3D11.BindFlags.ShaderResource, SharpDX.Direct3D11.BindFlags.RenderTarget and SharpDX.Direct3D11.BindFlags.DepthStencil.

    Format

    Texture format (see SharpDX.DXGI.Format).

    Height

    Texture height (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture3DSize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    MipLevels

    The maximum number of mipmap levels in the texture. See the remarks in SharpDX.Direct3D11.ShaderResourceViewDescription.Texture1DResource. Use 1 for a multisampled texture; or 0 to generate a full set of subtextures.

    MultisampleCount

    Structure that specifies multisampling parameters for the texture. See SharpDX.DXGI.SampleDescription.

    Options

    Resource options for DirectX 11 textures.

    Usage

    Value that identifies how the texture is to be read from and written to. The most common value is SharpDX.Direct3D11.ResourceUsage.Default; see SharpDX.Direct3D11.ResourceUsage for all possible values.

    Width

    Texture width (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture1DSize (16384). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    Properties
    IsDepthStencil

    Gets a value indicating whether this instance is a depth stencil.

    IsMultisample

    Gets a value indicating whether this instance is a multi sample texture.

    IsRenderTarget

    Gets a value indicating whether this instance is a render target.

    IsShaderResource

    Gets a value indicating whether this instance is a shader resource.

    IsUnorderedAccess

    Gets a value indicating whether this instance is a shader resource.

    Methods
    Equals(TextureDescription)
    Equals(Object)
    FromDescription(TextureDescription, TextureFlags, GraphicsResourceUsage)

    Creates a new description from another description but overrides Flags and Usage.

    GetHashCode()
    New1D(Int32, MipMapCount, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage)

    Creates a new 1D TextureDescription.

    New1D(Int32, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new 1D TextureDescription with a single level of mipmap.

    New1D(Int32, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage)

    Creates a new 1D TextureDescription with a single mipmap.

    New2D(Int32, Int32, MipMapCount, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage, MultisampleCount, TextureOptions)

    Creates a new TextureDescription.

    New2D(Int32, Int32, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage, TextureOptions)

    Creates a new TextureDescription with a single mipmap.

    New3D(Int32, Int32, Int32, MipMapCount, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new TextureDescription.

    New3D(Int32, Int32, Int32, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new TextureDescription with a single mipmap.

    NewCube(Int32, MipMapCount, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new Cube TextureDescription.

    NewCube(Int32, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new Cube TextureDescription.

    ToCloneableDescription()

    Gets a clone description of this instance (if texture is immutable, it is switched to default).

    ToStagingDescription()

    Gets the staging description for this instance..

    Operators
    Equality(TextureDescription, TextureDescription)

    Implements the operator ==.

    Implicit(ImageDescription to TextureDescription)

    Performs an explicit conversion from ImageDescription to TextureDescription.

    Implicit(TextureDescription to ImageDescription)

    Performs an explicit conversion from ImageDescription to TextureDescription.

    Inequality(TextureDescription, TextureDescription)

    Implements the operator !=.

    | Improve this Doc View Source

    Fields


    ArraySize

    Number of textures in the array. The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture1DArraySize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    public int ArraySize
    Field Value
    Type Description
    System.Int32
    Remarks

    This field is only valid for , and


    Depth

    Texture depth (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture3DSize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    public int Depth
    Field Value
    Type Description
    System.Int32
    Remarks

    This field is only valid for .


    Dimension

    The dimension of a texture.

    public TextureDimension Dimension
    Field Value
    Type Description
    TextureDimension

    Flags

    Flags (see SharpDX.Direct3D11.BindFlags) for binding to pipeline stages. The flags can be combined by a logical OR. For a 1D texture, the allowable values are: SharpDX.Direct3D11.BindFlags.ShaderResource, SharpDX.Direct3D11.BindFlags.RenderTarget and SharpDX.Direct3D11.BindFlags.DepthStencil.

    public TextureFlags Flags
    Field Value
    Type Description
    TextureFlags

    Format

    Texture format (see SharpDX.DXGI.Format).

    public PixelFormat Format
    Field Value
    Type Description
    PixelFormat

    Height

    Texture height (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture3DSize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    public int Height
    Field Value
    Type Description
    System.Int32
    Remarks

    This field is only valid for , and .


    MipLevels

    The maximum number of mipmap levels in the texture. See the remarks in SharpDX.Direct3D11.ShaderResourceViewDescription.Texture1DResource. Use 1 for a multisampled texture; or 0 to generate a full set of subtextures.

    public int MipLevels
    Field Value
    Type Description
    System.Int32

    MultisampleCount

    Structure that specifies multisampling parameters for the texture. See SharpDX.DXGI.SampleDescription.

    public MultisampleCount MultisampleCount
    Field Value
    Type Description
    MultisampleCount
    Remarks

    This field is only valid for .


    Options

    Resource options for DirectX 11 textures.

    public TextureOptions Options
    Field Value
    Type Description
    TextureOptions

    Usage

    Value that identifies how the texture is to be read from and written to. The most common value is SharpDX.Direct3D11.ResourceUsage.Default; see SharpDX.Direct3D11.ResourceUsage for all possible values.

    public GraphicsResourceUsage Usage
    Field Value
    Type Description
    GraphicsResourceUsage

    Width

    Texture width (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture1DSize (16384). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.

    public int Width
    Field Value
    Type Description
    System.Int32
    Remarks

    This field is valid for all textures: , , and .

    | Improve this Doc View Source

    Properties


    IsDepthStencil

    Gets a value indicating whether this instance is a depth stencil.

    public readonly bool IsDepthStencil { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is a depth stencil; otherwise, false.


    IsMultisample

    Gets a value indicating whether this instance is a multi sample texture.

    public readonly bool IsMultisample { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is multi sample texture; otherwise, false.


    IsRenderTarget

    Gets a value indicating whether this instance is a render target.

    public readonly bool IsRenderTarget { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is render target; otherwise, false.


    IsShaderResource

    Gets a value indicating whether this instance is a shader resource.

    public readonly bool IsShaderResource { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is a shader resource; otherwise, false.


    IsUnorderedAccess

    Gets a value indicating whether this instance is a shader resource.

    public readonly bool IsUnorderedAccess { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is a shader resource; otherwise, false.

    | Improve this Doc View Source

    Methods


    Equals(TextureDescription)

    public bool Equals(TextureDescription other)
    Parameters
    Type Name Description
    TextureDescription other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    FromDescription(TextureDescription, TextureFlags, GraphicsResourceUsage)

    Creates a new description from another description but overrides Flags and Usage.

    public static TextureDescription FromDescription(TextureDescription desc, TextureFlags textureFlags, GraphicsResourceUsage usage)
    Parameters
    Type Name Description
    TextureDescription desc

    The desc.

    TextureFlags textureFlags

    The texture flags.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    TextureDescription.


    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    New1D(Int32, MipMapCount, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage)

    Creates a new 1D TextureDescription.

    public static TextureDescription New1D(int width, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, int arraySize = 1, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    MipMapCount mipCount

    Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    System.Int32 arraySize

    Size of the texture 2D array, default to 1.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of 1D TextureDescription class.


    New1D(Int32, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new 1D TextureDescription with a single level of mipmap.

    public static TextureDescription New1D(int width, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of 1D TextureDescription class.

    Remarks

    The first dimension of mipMapTextures describes the number of array (Texture1D Array), second dimension is the mipmap, the third is the texture data for a particular mipmap.


    New1D(Int32, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage)

    Creates a new 1D TextureDescription with a single mipmap.

    public static TextureDescription New1D(int width, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, int arraySize = 1, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    System.Int32 arraySize

    Size of the texture 2D array, default to 1.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of 1D TextureDescription class.


    New2D(Int32, Int32, MipMapCount, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage, MultisampleCount, TextureOptions)

    Creates a new TextureDescription.

    public static TextureDescription New2D(int width, int height, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, int arraySize = 1, GraphicsResourceUsage usage = GraphicsResourceUsage.Default, MultisampleCount multisampleCount = MultisampleCount.None, TextureOptions textureOptions = TextureOptions.None)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    System.Int32 height

    The height.

    MipMapCount mipCount

    Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    System.Int32 arraySize

    Size of the texture 2D array, default to 1.

    GraphicsResourceUsage usage

    The usage.

    MultisampleCount multisampleCount

    The multisample count.

    TextureOptions textureOptions
    Returns
    Type Description
    TextureDescription

    A new instance of TextureDescription class.


    New2D(Int32, Int32, PixelFormat, TextureFlags, Int32, GraphicsResourceUsage, TextureOptions)

    Creates a new TextureDescription with a single mipmap.

    public static TextureDescription New2D(int width, int height, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, int arraySize = 1, GraphicsResourceUsage usage = GraphicsResourceUsage.Default, TextureOptions textureOptions = TextureOptions.None)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    System.Int32 height

    The height.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    System.Int32 arraySize

    Size of the texture 2D array, default to 1.

    GraphicsResourceUsage usage

    The usage.

    TextureOptions textureOptions
    Returns
    Type Description
    TextureDescription

    A new instance of TextureDescription class.


    New3D(Int32, Int32, Int32, MipMapCount, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new TextureDescription.

    public static TextureDescription New3D(int width, int height, int depth, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    System.Int32 height

    The height.

    System.Int32 depth

    The depth.

    MipMapCount mipCount

    Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of TextureDescription class.


    New3D(Int32, Int32, Int32, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new TextureDescription with a single mipmap.

    public static TextureDescription New3D(int width, int height, int depth, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
    Parameters
    Type Name Description
    System.Int32 width

    The width.

    System.Int32 height

    The height.

    System.Int32 depth

    The depth.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    true if the texture needs to support unordered read write.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of TextureDescription class.


    NewCube(Int32, MipMapCount, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new Cube TextureDescription.

    public static TextureDescription NewCube(int size, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
    Parameters
    Type Name Description
    System.Int32 size

    The size (in pixels) of the top-level faces of the cube texture.

    MipMapCount mipCount

    Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    The texture flags.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of TextureDescription class.


    NewCube(Int32, PixelFormat, TextureFlags, GraphicsResourceUsage)

    Creates a new Cube TextureDescription.

    public static TextureDescription NewCube(int size, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
    Parameters
    Type Name Description
    System.Int32 size

    The size (in pixels) of the top-level faces of the cube texture.

    PixelFormat format

    Describes the format to use.

    TextureFlags textureFlags

    The texture flags.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    TextureDescription

    A new instance of TextureDescription class.


    ToCloneableDescription()

    Gets a clone description of this instance (if texture is immutable, it is switched to default).

    public TextureDescription ToCloneableDescription()
    Returns
    Type Description
    TextureDescription

    A clone of this instance.


    ToStagingDescription()

    Gets the staging description for this instance..

    public TextureDescription ToStagingDescription()
    Returns
    Type Description
    TextureDescription

    A Staging description

    | Improve this Doc View Source

    Operators


    Equality(TextureDescription, TextureDescription)

    Implements the operator ==.

    public static bool operator ==(TextureDescription left, TextureDescription right)
    Parameters
    Type Name Description
    TextureDescription left

    The left.

    TextureDescription right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Implicit(ImageDescription to TextureDescription)

    Performs an explicit conversion from ImageDescription to TextureDescription.

    public static implicit operator TextureDescription(ImageDescription description)
    Parameters
    Type Name Description
    ImageDescription description

    The image description.

    Returns
    Type Description
    TextureDescription

    The result of the conversion.


    Implicit(TextureDescription to ImageDescription)

    Performs an explicit conversion from ImageDescription to TextureDescription.

    public static implicit operator ImageDescription(TextureDescription description)
    Parameters
    Type Name Description
    TextureDescription description

    The image description.

    Returns
    Type Description
    ImageDescription

    The result of the conversion.


    Inequality(TextureDescription, TextureDescription)

    Implements the operator !=.

    public static bool operator !=(TextureDescription left, TextureDescription right)
    Parameters
    Type Name Description
    TextureDescription left

    The left.

    TextureDescription right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Inherited Members

    System.ValueType.ToString()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation