Table of Contents

Struct TextureDescription

Namespace
SharpDX.Toolkit.Graphics
Assembly
HelixToolkit.SharpDX.dll

A Common description for all textures.

public struct TextureDescription : IEquatable<TextureDescription>
Implements
Inherited Members
Extension Methods

Remarks

This class exposes the union of all fields exposed by fields in SharpDX.Direct3D11.Texture1DDescription, SharpDX.Direct3D11.Texture2DDescription, SharpDX.Direct3D11.Texture3DDescription. It provides also 2-way implicit conversions for 1D, 2D, 3D textures descriptions.

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

BindFlags

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 BindFlags BindFlags

Field Value

BindFlags

CpuAccessFlags

Flags (see SharpDX.Direct3D11.CpuAccessFlags) to specify the types of CPU access allowed. Use 0 if CPU access is not required. These flags can be combined with a logical OR.

public CpuAccessFlags CpuAccessFlags

Field Value

CpuAccessFlags

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

Format

Texture format (see SharpDX.DXGI.Format).

public Format Format

Field Value

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.

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

OptionFlags

Flags (see SharpDX.Direct3D11.ResourceOptionFlags) that identify other, less common resource options. Use 0 if none of these flags apply. These flags can be combined with a logical OR.

public ResourceOptionFlags OptionFlags

Field Value

ResourceOptionFlags

SampleDescription

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

public SampleDescription SampleDescription

Field Value

SampleDescription

Remarks

This field is only valid for Texture2D.

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 ResourceUsage Usage

Field Value

ResourceUsage

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.

Methods

Equals(TextureDescription)

public bool Equals(TextureDescription other)

Parameters

other TextureDescription

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToStagingDescription()

Gets the staging description for this instance..

public TextureDescription ToStagingDescription()

Returns

TextureDescription

A Staging description

Operators

operator ==(TextureDescription, TextureDescription)

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

Parameters

left TextureDescription
right TextureDescription

Returns

bool

implicit operator TextureDescription(Texture1DDescription)

Performs an explicit conversion from SharpDX.Direct3D11.Texture2DDescription to TextureDescription.

public static implicit operator TextureDescription(Texture1DDescription description)

Parameters

description Texture1DDescription

The texture description.

Returns

TextureDescription

The result of the conversion.

implicit operator TextureDescription(Texture2DDescription)

Performs an explicit conversion from SharpDX.Direct3D11.Texture2DDescription to TextureDescription.

public static implicit operator TextureDescription(Texture2DDescription description)

Parameters

description Texture2DDescription

The texture description.

Returns

TextureDescription

The result of the conversion.

implicit operator TextureDescription(Texture3DDescription)

Performs an explicit conversion from SharpDX.Direct3D11.Texture2DDescription to TextureDescription.

public static implicit operator TextureDescription(Texture3DDescription description)

Parameters

description Texture3DDescription

The texture description.

Returns

TextureDescription

The result of the conversion.

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 Texture1DDescription(TextureDescription)

Performs an explicit conversion from TextureDescription to SharpDX.Direct3D11.Texture2DDescription.

public static implicit operator Texture1DDescription(TextureDescription description)

Parameters

description TextureDescription

The texture description.

Returns

Texture1DDescription

The result of the conversion.

implicit operator Texture2DDescription(TextureDescription)

Performs an explicit conversion from TextureDescription to SharpDX.Direct3D11.Texture2DDescription.

public static implicit operator Texture2DDescription(TextureDescription description)

Parameters

description TextureDescription

The texture description.

Returns

Texture2DDescription

The result of the conversion.

implicit operator Texture3DDescription(TextureDescription)

Performs an explicit conversion from TextureDescription to SharpDX.Direct3D11.Texture3DDescription.

public static implicit operator Texture3DDescription(TextureDescription description)

Parameters

description TextureDescription

The texture description.

Returns

Texture3DDescription

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)

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

Parameters

left TextureDescription
right TextureDescription

Returns

bool