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
widthuintThe total width, in texels.
heightuintThe total height, in texels.
depthuintThe total depth, in texels.
mipLevelsuintThe number of mipmap levels.
arrayLayersuintThe number of array layers.
formatPixelFormatThe format of individual texture elements.
usageTextureUsageControls 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.
typeTextureTypeThe 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
widthuintThe total width, in texels.
heightuintThe total height, in texels.
depthuintThe total depth, in texels.
mipLevelsuintThe number of mipmap levels.
arrayLayersuintThe number of array layers.
formatPixelFormatThe format of individual texture elements.
usageTextureUsageControls 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.
typeTextureTypeThe type of Texture to create.
sampleCountTextureSampleCountThe 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
Depth
The total depth, in texels.
public uint Depth
Field Value
Format
The format of individual texture elements.
public PixelFormat Format
Field Value
Height
The total height, in texels.
public uint Height
Field Value
MipLevels
The number of mipmap levels.
public uint MipLevels
Field Value
SampleCount
public TextureSampleCount SampleCount
Field Value
Type
The type of Texture to create.
public TextureType Type
Field Value
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
Width
The total width, in texels.
public uint Width
Field Value
Methods
Equals(TextureDescription)
Element-wise equality.
public bool Equals(TextureDescription other)
Parameters
otherTextureDescriptionThe 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
widthuintThe total width, in texels.
mipLevelsuintThe number of mipmap levels.
arrayLayersuintThe number of array layers.
formatPixelFormatThe format of individual texture elements.
usageTextureUsageControls 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
widthuintThe total width, in texels.
heightuintThe total height, in texels.
mipLevelsuintThe number of mipmap levels.
arrayLayersuintThe number of array layers.
formatPixelFormatThe format of individual texture elements.
usageTextureUsageControls 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
widthuintThe total width, in texels.
heightuintThe total height, in texels.
mipLevelsuintThe number of mipmap levels.
arrayLayersuintThe number of array layers.
formatPixelFormatThe format of individual texture elements.
usageTextureUsageControls 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.
sampleCountTextureSampleCountThe 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
widthuintThe total width, in texels.
heightuintThe total height, in texels.
depthuintThe total depth, in texels.
mipLevelsuintThe number of mipmap levels.
formatPixelFormatThe format of individual texture elements.
usageTextureUsageControls 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.