Table of Contents

Struct TextureDescription

Namespace
NeoVeldrid
Assembly
NeoVeldrid.dll

Describes a Texture, for creation using a ResourceFactory.

public struct TextureDescription : IEquatable<TextureDescription>
Implements
Inherited Members

Constructors

TextureDescription(uint, uint, uint, uint, uint, PixelFormat, TextureUsage, TextureType)

Contsructs a new TextureDescription describing a non-multisampled Texture.

public TextureDescription(uint width, uint height, uint depth, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage, TextureType type)

Parameters

width uint

The total width, in texels.

height uint

The total height, in texels.

depth uint

The total depth, in texels.

mipLevels uint

The number of mipmap levels.

arrayLayers uint

The number of array layers.

format PixelFormat

The format of individual texture elements.

usage TextureUsage

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.

type TextureType

The type of Texture to create.

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

Contsructs a new TextureDescription.

public TextureDescription(uint width, uint height, uint depth, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage, TextureType type, TextureSampleCount sampleCount)

Parameters

width uint

The total width, in texels.

height uint

The total height, in texels.

depth uint

The total depth, in texels.

mipLevels uint

The number of mipmap levels.

arrayLayers uint

The number of array layers.

format PixelFormat

The format of individual texture elements.

usage TextureUsage

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.

type TextureType

The type of Texture to create.

sampleCount TextureSampleCount

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.

public uint ArrayLayers

Field Value

uint

Depth

The total depth, in texels.

public uint Depth

Field Value

uint

Format

The format of individual texture elements.

public PixelFormat Format

Field Value

PixelFormat

Height

The total height, in texels.

public uint Height

Field Value

uint

MipLevels

The number of mipmap levels.

public uint MipLevels

Field Value

uint

SampleCount

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

public TextureSampleCount SampleCount

Field Value

TextureSampleCount

Type

The type of Texture to create.

public TextureType Type

Field Value

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.

public TextureUsage Usage

Field Value

TextureUsage

Width

The total width, in texels.

public uint Width

Field Value

uint

Methods

Equals(TextureDescription)

Element-wise equality.

public bool Equals(TextureDescription other)

Parameters

other TextureDescription

The instance to compare to.

Returns

bool

True if all elements are equal; false otherswise.

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.

Texture1D(uint, uint, uint, PixelFormat, TextureUsage)

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

public static TextureDescription Texture1D(uint width, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage)

Parameters

width uint

The total width, in texels.

mipLevels uint

The number of mipmap levels.

arrayLayers uint

The number of array layers.

format PixelFormat

The format of individual texture elements.

usage TextureUsage

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

TextureDescription

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

Texture2D(uint, uint, uint, uint, PixelFormat, TextureUsage)

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

public static TextureDescription Texture2D(uint width, uint height, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage)

Parameters

width uint

The total width, in texels.

height uint

The total height, in texels.

mipLevels uint

The number of mipmap levels.

arrayLayers uint

The number of array layers.

format PixelFormat

The format of individual texture elements.

usage TextureUsage

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

TextureDescription

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

Texture2D(uint, uint, uint, uint, PixelFormat, TextureUsage, TextureSampleCount)

Creates a description for a 2D Texture.

public static TextureDescription Texture2D(uint width, uint height, uint mipLevels, uint arrayLayers, PixelFormat format, TextureUsage usage, TextureSampleCount sampleCount)

Parameters

width uint

The total width, in texels.

height uint

The total height, in texels.

mipLevels uint

The number of mipmap levels.

arrayLayers uint

The number of array layers.

format PixelFormat

The format of individual texture elements.

usage TextureUsage

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.

sampleCount TextureSampleCount

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

Returns

TextureDescription

A new TextureDescription for a 2D Texture.

Texture3D(uint, uint, uint, uint, PixelFormat, TextureUsage)

Creates a description for a 3D Texture.

public static TextureDescription Texture3D(uint width, uint height, uint depth, uint mipLevels, PixelFormat format, TextureUsage usage)

Parameters

width uint

The total width, in texels.

height uint

The total height, in texels.

depth uint

The total depth, in texels.

mipLevels uint

The number of mipmap levels.

format PixelFormat

The format of individual texture elements.

usage TextureUsage

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

TextureDescription

A new TextureDescription for a 3D Texture.