Show / Hide Table of Contents

Struct TextureDescription

Describes a Texture, for creation using a ResourceFactory.

Implements
System.IEquatable<TextureDescription>
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Veldrid
Assembly: cs.temp.dll.dll
Syntax
public struct TextureDescription : IEquatable<TextureDescription>

Constructors

TextureDescription(UInt32, UInt32, UInt32, UInt32, UInt32, PixelFormat, TextureUsage, TextureType)

Contsructs a new TextureDescription describing a non-multisampled Texture.

Declaration
public TextureDescription(uint width, uint height, uint depth, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage, TextureType type)
Parameters
Type Name Description
System.UInt32 width

The total width, in texels.

System.UInt32 height

The total height, in texels.

System.UInt32 depth

The total depth, in texels.

System.UInt32 mipLevels

The number of mipmap levels.

System.UInt32 arrayLayers

The number of array layers.

PixelFormat format

The format of individual texture elements.

TextureUsage usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included. If the Texture will be used as a 2D cubemap, then Cubemap must be included.

TextureType type

The type of Texture to create.

TextureDescription(UInt32, UInt32, UInt32, UInt32, UInt32, PixelFormat, TextureUsage, TextureType, TextureSampleCount)

Contsructs a new TextureDescription.

Declaration
public TextureDescription(uint width, uint height, uint depth, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage, TextureType type, TextureSampleCount sampleCount)
Parameters
Type Name Description
System.UInt32 width

The total width, in texels.

System.UInt32 height

The total height, in texels.

System.UInt32 depth

The total depth, in texels.

System.UInt32 mipLevels

The number of mipmap levels.

System.UInt32 arrayLayers

The number of array layers.

PixelFormat format

The format of individual texture elements.

TextureUsage usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included. If the Texture will be used as a 2D cubemap, then Cubemap must be included.

TextureType type

The type of Texture to create.

TextureSampleCount sampleCount

The number of samples. If any other value than Count1 is provided, then this describes a multisample texture.

Fields

ArrayLayers

The number of array layers.

Declaration
public uint ArrayLayers
Field Value
Type Description
System.UInt32

Depth

The total depth, in texels.

Declaration
public uint Depth
Field Value
Type Description
System.UInt32

Format

The format of individual texture elements.

Declaration
public PixelFormat Format
Field Value
Type Description
PixelFormat

Height

The total height, in texels.

Declaration
public uint Height
Field Value
Type Description
System.UInt32

MipLevels

The number of mipmap levels.

Declaration
public uint MipLevels
Field Value
Type Description
System.UInt32

SampleCount

The number of samples. If equal to Count1, this instance does not describe a multisample Texture.

Declaration
public TextureSampleCount SampleCount
Field Value
Type Description
TextureSampleCount

Type

The type of Texture to create.

Declaration
public TextureType Type
Field Value
Type Description
TextureType

Usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included. If the Texture will be used as a 2D cubemap, then Cubemap must be included.

Declaration
public TextureUsage Usage
Field Value
Type Description
TextureUsage

Width

The total width, in texels.

Declaration
public uint Width
Field Value
Type Description
System.UInt32

Methods

Equals(TextureDescription)

Element-wise equality.

Declaration
public bool Equals(TextureDescription other)
Parameters
Type Name Description
TextureDescription other

The instance to compare to.

Returns
Type Description
System.Boolean

True if all elements are equal; false otherswise.

GetHashCode()

Returns the hash code for this instance.

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

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

Overrides
System.ValueType.GetHashCode()

Texture1D(UInt32, UInt32, UInt32, PixelFormat, TextureUsage)

Creates a description for a non-multisampled 1D Texture.

Declaration
public static TextureDescription Texture1D(uint width, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage)
Parameters
Type Name Description
System.UInt32 width

The total width, in texels.

System.UInt32 mipLevels

The number of mipmap levels.

System.UInt32 arrayLayers

The number of array layers.

PixelFormat format

The format of individual texture elements.

TextureUsage usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included.

Returns
Type Description
TextureDescription

A new TextureDescription for a non-multisampled 1D Texture.

Texture2D(UInt32, UInt32, UInt32, UInt32, PixelFormat, TextureUsage)

Creates a description for a non-multisampled 2D Texture.

Declaration
public static TextureDescription Texture2D(uint width, uint height, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage)
Parameters
Type Name Description
System.UInt32 width

The total width, in texels.

System.UInt32 height

The total height, in texels.

System.UInt32 mipLevels

The number of mipmap levels.

System.UInt32 arrayLayers

The number of array layers.

PixelFormat format

The format of individual texture elements.

TextureUsage usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included. If the Texture will be used as a 2D cubemap, then Cubemap must be included.

Returns
Type Description
TextureDescription

A new TextureDescription for a non-multisampled 2D Texture.

Texture2D(UInt32, UInt32, UInt32, UInt32, PixelFormat, TextureUsage, TextureSampleCount)

Creates a description for a 2D Texture.

Declaration
public static TextureDescription Texture2D(uint width, uint height, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage, TextureSampleCount sampleCount)
Parameters
Type Name Description
System.UInt32 width

The total width, in texels.

System.UInt32 height

The total height, in texels.

System.UInt32 mipLevels

The number of mipmap levels.

System.UInt32 arrayLayers

The number of array layers.

PixelFormat format

The format of individual texture elements.

TextureUsage usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included. If the Texture will be used as a 2D cubemap, then Cubemap must be included.

TextureSampleCount sampleCount

The number of samples. If any other value than Count1 is provided, then this describes a multisample texture.

Returns
Type Description
TextureDescription

A new TextureDescription for a 2D Texture.

Texture3D(UInt32, UInt32, UInt32, UInt32, PixelFormat, TextureUsage)

Creates a description for a 3D Texture.

Declaration
public static TextureDescription Texture3D(uint width, uint height, uint depth, uint mipLevels, PixelFormat format, TextureUsage usage)
Parameters
Type Name Description
System.UInt32 width

The total width, in texels.

System.UInt32 height

The total height, in texels.

System.UInt32 depth

The total depth, in texels.

System.UInt32 mipLevels

The number of mipmap levels.

PixelFormat format

The format of individual texture elements.

TextureUsage usage

Controls how the Texture is permitted to be used. If the Texture will be sampled from a shader, then Sampled must be included. If the Texture will be used as a depth target in a Framebuffer, then DepthStencil must be included. If the Texture will be used as a color target in a Framebuffer, then RenderTarget must be included.

Returns
Type Description
TextureDescription

A new TextureDescription for a 3D Texture.

Implements

System.IEquatable<T>
Back to top