Table of Contents

Struct TextureDescription

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

A structure providing a common description for all kinds of Textures.

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

Fields

ArraySize

The number of Textures in the Texture Array.

public int ArraySize

Field Value

int

Remarks

The range of this value is from 1 to the maximum supported array size, which is constrained by the graphics profile of the device.

This field is valid for Texture1D, Texture2D, and TextureCube.

See Also

Depth

The Texture depth in texels.

public int Depth

Field Value

int

Remarks

The range of this value is from 1 to the maximum supported size, which is constrained by the graphics profile of the device.

This field is valid for Texture3D.

See Also

Dimension

The dimension (type) of the Texture.

public TextureDimension Dimension

Field Value

TextureDimension

Flags

A combination of flags describing how the Texture is to be bound to the stages of the graphics pipeline.

public TextureFlags Flags

Field Value

TextureFlags

Format

The format of the Texture.

public PixelFormat Format

Field Value

PixelFormat

Height

The Texture height in texels.

public int Height

Field Value

int

Remarks

The range of this value is from 1 to the maximum supported size, which is constrained by the graphics profile of the device.

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

See Also

MipLevelCount

The number of mipmap levels in the Texture.

public int MipLevelCount

Field Value

int

Remarks

The range of this value is from 1 to MaximumMipLevels, which is constrained by the graphics profile of the device.

Use 1 for a multisampled Texture; or 0 to generate a full set of subtextures.

See Also

MultisampleCount

The level of multisampling for the Texture.

public MultisampleCount MultisampleCount

Field Value

MultisampleCount

Remarks

This field is only valid for Texture2D.

Options

A combination of flags specifying options for Textures, like creating them as shared resources.

public TextureOptions Options

Field Value

TextureOptions

Remarks

This field must be None when creating Textures with CPU access flags.

Usage

A value that indicates how the Texture is to be read from and written to.

public GraphicsResourceUsage Usage

Field Value

GraphicsResourceUsage

Remarks

The most common value is Default.

Width

The Texture width in texels.

public int Width

Field Value

int

Remarks

The range of this value is from 1 to the maximum supported size, which is constrained by the graphics profile of the device.

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

See Also

Properties

IsDepthStencil

Gets a value indicating whether the Texture is a Depth-Stencil buffer.

public readonly bool IsDepthStencil { get; }

Property Value

bool

true if the Texture is a Depth-Stencil buffer; otherwise, false.

IsMultiSampled

Gets a value indicating whether the Texture is a multi-sampled Texture.

public readonly bool IsMultiSampled { get; }

Property Value

bool

true if the Texture is multi-sampled; otherwise, false.

IsRenderTarget

Gets a value indicating whether the Texture is a Render Target.

public readonly bool IsRenderTarget { get; }

Property Value

bool

true if the Texture is a Render Target; otherwise, false.

IsShaderResource

Gets a value indicating whether the Texture is a Shader Resource.

public readonly bool IsShaderResource { get; }

Property Value

bool

true if the Texture is a Shader Resource; otherwise, false.

IsUnorderedAccess

Gets a value indicating whether the Texture is a created to allow Unordered Access when used as Shader Resource.

public readonly bool IsUnorderedAccess { get; }

Property Value

bool

true if the Texture allows Unordered Access; otherwise, false.

Methods

Equals(TextureDescription)

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

public readonly 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 readonly 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 description, TextureFlags textureFlags, GraphicsResourceUsage usage)

Parameters

description TextureDescription

The Texture Description to copy.

textureFlags TextureFlags

The new Texture flags.

usage GraphicsResourceUsage

The new usage.

Returns

TextureDescription

A modified copy of the specified description.

GetHashCode()

Returns the hash code for this instance.

public override readonly 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 TextureDescription for a one-dimensional (1D) Texture.

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 of the Texture in texels.

mipCount MipMapCount

A MipMapCount structure describing the number of mipmaps for the Texture. Specify Auto to have all mipmaps, or One to indicate a single mipmap, or any number greater than 1 for a particular mipmap count.

You can also specify a number (which will be converted implicitly) or a bool. See MipMapCount for more information about accepted values.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

arraySize int

The number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a one-dimensional Texture.

New1D(int, PixelFormat, TextureFlags, GraphicsResourceUsage)

Creates a new TextureDescription for a one-dimensional (1D) Texture with a single mipmap.

public static TextureDescription New1D(int width, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)

Parameters

width int

The width of the Texture in texels.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a one-dimensional Texture.

New1D(int, PixelFormat, TextureFlags, int, GraphicsResourceUsage)

Creates a new TextureDescription for a one-dimensional (1D) Texture 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 of the Texture in texels.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

arraySize int

The number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a one-dimensional Texture.

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

Creates a new TextureDescription for a two-dimensional (2D) Texture.

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 of the Texture in texels.

height int

The height of the Texture in texels.

mipCount MipMapCount

A MipMapCount structure describing the number of mipmaps for the Texture. Specify Auto to have all mipmaps, or One to indicate a single mipmap, or any number greater than 1 for a particular mipmap count.

You can also specify a number (which will be converted implicitly) or a bool. See MipMapCount for more information about accepted values.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

arraySize int

The number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

multisampleCount MultisampleCount

The number of samples per texel the Texture will have. The default value is None, indicating a non-multisampled Texture.

textureOptions TextureOptions

A combination of flags indicating options about the creation of the Texture, like creating it as a shared resource. The default value is None.

Returns

TextureDescription

A new description for a two-dimensional Texture.

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

Creates a new TextureDescription for a two-dimensional (2D) Texture 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 of the Texture in texels.

height int

The height of the Texture in texels.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

arraySize int

The number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

textureOptions TextureOptions

A combination of flags indicating options about the creation of the Texture, like creating it as a shared resource. The default value is None.

Returns

TextureDescription

A new description for a two-dimensional Texture.

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

Creates a new TextureDescription for a three-dimensional (3D) Texture.

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 of the Texture in texels.

height int

The height of the Texture in texels.

depth int

The depth of the Texture in texels.

mipCount MipMapCount

A MipMapCount structure describing the number of mipmaps for the Texture. Specify Auto to have all mipmaps, or One to indicate a single mipmap, or any number greater than 1 for a particular mipmap count.

You can also specify a number (which will be converted implicitly) or a bool. See MipMapCount for more information about accepted values.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a three-dimensional Texture.

New3D(int, int, int, PixelFormat, TextureFlags, GraphicsResourceUsage)

Creates a new TextureDescription for a three-dimensional (3D) Texture 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 of the Texture in texels.

height int

The height of the Texture in texels.

depth int

The depth of the Texture in texels.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a three-dimensional Texture.

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

Creates a new TextureDescription for a cube-map composed of six two-dimensional (2D) Textures.

public static TextureDescription NewCube(int size, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)

Parameters

size int

The size in texels of the faces of the cube Texture. As the Texture is a cube, this single value specifies both the width and the height.

mipCount MipMapCount

A MipMapCount structure describing the number of mipmaps for the Texture. Specify Auto to have all mipmaps, or One to indicate a single mipmap, or any number greater than 1 for a particular mipmap count.

You can also specify a number (which will be converted implicitly) or a bool. See MipMapCount for more information about accepted values.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a cube-map Texture.

NewCube(int, PixelFormat, TextureFlags, GraphicsResourceUsage)

Creates a new TextureDescription for a cube-map composed of six two-dimensional (2D) Textures with a single mipmap.

public static TextureDescription NewCube(int size, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)

Parameters

size int

The size in texels of the faces of the cube Texture. As the Texture is a cube, this single value specifies both the width and the height.

format PixelFormat

The format to use.

textureFlags TextureFlags

A combination of flags determining what kind of Texture and how the is should behave (i.e. how it is bound, how can it be read / written, etc.). By default, it is ShaderResource.

usage GraphicsResourceUsage

A combination of flags determining how the Texture will be used during rendering. The default is Default, meaning it will need read/write access by the GPU.

Returns

TextureDescription

A new description for a cube-map Texture.

ToCloneableDescription()

Returns a copy of this Texture Description modified so if the Texture is Immutable, it is switched to Default.

public readonly TextureDescription ToCloneableDescription()

Returns

TextureDescription

A modified copy of this Texture Description.

ToStagingDescription()

Returns a copy of this Texture Description modified to describe a staging Texture.

public readonly TextureDescription ToStagingDescription()

Returns

TextureDescription

A staging Texture Description.

Operators

operator ==(TextureDescription, TextureDescription)

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

Parameters

left TextureDescription
right TextureDescription

Returns

bool

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 to convert.

Returns

TextureDescription

The result of the conversion.

implicit operator ImageDescription(TextureDescription)

Performs an implicit conversion from TextureDescription to ImageDescription.

public static implicit operator ImageDescription(TextureDescription description)

Parameters

description TextureDescription

The Texture Description to convert.

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