Table of Contents

Struct TextureDescription

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

A Common description for all textures.

public struct TextureDescription : IEquatable<TextureDescription>
Implements
Inherited Members

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

int

Remarks

This field is only valid for Texture1D, Texture2D and TextureCube

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

int

Remarks

This field is only valid for Texture3D.

Dimension

The dimension of a texture.

public TextureDimension Dimension

Field Value

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

TextureFlags

Format

Texture format (see SharpDX.DXGI.Format).

public PixelFormat Format

Field Value

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

int

Remarks

This field is only valid for Texture2D, Texture3D and TextureCube.

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

int

MultisampleCount

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

public MultisampleCount MultisampleCount

Field Value

MultisampleCount

Remarks

This field is only valid for Texture2D.

Options

Resource options for DirectX 11 textures.

public TextureOptions Options

Field Value

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

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

int

Remarks

This field is valid for all textures: Texture1D, Texture2D, Texture3D and TextureCube.

Properties

IsDepthStencil

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

public bool IsDepthStencil { get; }

Property Value

bool

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

IsMultisample

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

public bool IsMultisample { get; }

Property Value

bool

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

IsRenderTarget

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

public bool IsRenderTarget { get; }

Property Value

bool

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

IsShaderResource

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

public bool IsShaderResource { get; }

Property Value

bool

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

IsUnorderedAccess

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

public bool IsUnorderedAccess { get; }

Property Value

bool

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

Methods

Equals(TextureDescription)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(TextureDescription other)

Parameters

other TextureDescription

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

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

desc TextureDescription

The desc.

textureFlags TextureFlags

The texture flags.

usage GraphicsResourceUsage

The usage.

Returns

TextureDescription

TextureDescription.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

New1D(int, MipMapCount, PixelFormat, TextureFlags, int, 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

width int

The width.

mipCount MipMapCount

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

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

arraySize int

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

usage GraphicsResourceUsage

The usage.

Returns

TextureDescription

A new instance of 1D TextureDescription class.

New1D(int, 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

width int

The width.

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

usage GraphicsResourceUsage

The usage.

Returns

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(int, PixelFormat, TextureFlags, int, 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

width int

The width.

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

arraySize int

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

usage GraphicsResourceUsage

The usage.

Returns

TextureDescription

A new instance of 1D TextureDescription class.

New2D(int, int, MipMapCount, PixelFormat, TextureFlags, int, 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

width int

The width.

height int

The height.

mipCount MipMapCount

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

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

arraySize int

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

usage GraphicsResourceUsage

The usage.

multisampleCount MultisampleCount

The multisample count.

textureOptions TextureOptions

Returns

TextureDescription

A new instance of TextureDescription class.

New2D(int, int, PixelFormat, TextureFlags, int, 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

width int

The width.

height int

The height.

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

arraySize int

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

usage GraphicsResourceUsage

The usage.

textureOptions TextureOptions

Returns

TextureDescription

A new instance of TextureDescription class.

New3D(int, int, int, 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

width int

The width.

height int

The height.

depth int

The depth.

mipCount MipMapCount

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

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

usage GraphicsResourceUsage

The usage.

Returns

TextureDescription

A new instance of TextureDescription class.

New3D(int, int, int, 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

width int

The width.

height int

The height.

depth int

The depth.

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

true if the texture needs to support unordered read write.

usage GraphicsResourceUsage

The usage.

Returns

TextureDescription

A new instance of TextureDescription class.

NewCube(int, 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

size int

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

mipCount MipMapCount

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

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

The texture flags.

usage GraphicsResourceUsage

The usage.

Returns

TextureDescription

A new instance of TextureDescription class.

NewCube(int, 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

size int

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

format PixelFormat

Describes the format to use.

textureFlags TextureFlags

The texture flags.

usage GraphicsResourceUsage

The usage.

Returns

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

TextureDescription

A clone of this instance.

ToStagingDescription()

Gets the staging description for this instance..

public TextureDescription ToStagingDescription()

Returns

TextureDescription

A Staging description

Operators

operator ==(TextureDescription, TextureDescription)

Implements the operator ==.

public static bool operator ==(TextureDescription left, TextureDescription right)

Parameters

left TextureDescription

The left.

right TextureDescription

The right.

Returns

bool

The result of the operator.

implicit operator TextureDescription(ImageDescription)

Performs an explicit conversion from ImageDescription to TextureDescription.

public static implicit operator TextureDescription(ImageDescription description)

Parameters

description ImageDescription

The image description.

Returns

TextureDescription

The result of the conversion.

implicit operator ImageDescription(TextureDescription)

Performs an explicit conversion from ImageDescription to TextureDescription.

public static implicit operator ImageDescription(TextureDescription description)

Parameters

description TextureDescription

The image description.

Returns

ImageDescription

The result of the conversion.

operator !=(TextureDescription, TextureDescription)

Implements the operator !=.

public static bool operator !=(TextureDescription left, TextureDescription right)

Parameters

left TextureDescription

The left.

right TextureDescription

The right.

Returns

bool

The result of the operator.