Struct TextureDescription
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
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
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
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
Format
The format of the Texture.
public PixelFormat Format
Field Value
Height
The Texture height in texels.
public int Height
Field Value
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
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
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
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
Remarks
The most common value is Default.
Width
The Texture width in texels.
public int Width
Field Value
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
IsMultiSampled
Gets a value indicating whether the Texture is a multi-sampled Texture.
public readonly bool IsMultiSampled { get; }
Property Value
IsRenderTarget
Gets a value indicating whether the Texture is a Render Target.
public readonly bool IsRenderTarget { get; }
Property Value
IsShaderResource
Gets a value indicating whether the Texture is a Shader Resource.
public readonly bool IsShaderResource { get; }
Property Value
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
Methods
Equals(TextureDescription)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(TextureDescription other)
Parameters
otherTextureDescriptionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
FromDescription(TextureDescription, TextureFlags, GraphicsResourceUsage)
public static TextureDescription FromDescription(TextureDescription description, TextureFlags textureFlags, GraphicsResourceUsage usage)
Parameters
descriptionTextureDescriptionThe Texture Description to copy.
textureFlagsTextureFlagsThe new Texture flags.
usageGraphicsResourceUsageThe 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
widthintThe width of the Texture in texels.
mipCountMipMapCountA 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.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
arraySizeintThe number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.
usageGraphicsResourceUsageA 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
widthintThe width of the Texture in texels.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
usageGraphicsResourceUsageA 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
widthintThe width of the Texture in texels.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
arraySizeintThe number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.
usageGraphicsResourceUsageA 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
widthintThe width of the Texture in texels.
heightintThe height of the Texture in texels.
mipCountMipMapCountA 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.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
arraySizeintThe number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.
usageGraphicsResourceUsageA 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.
multisampleCountMultisampleCountThe number of samples per texel the Texture will have. The default value is None, indicating a non-multisampled Texture.
textureOptionsTextureOptionsA 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
widthintThe width of the Texture in texels.
heightintThe height of the Texture in texels.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
arraySizeintThe number of array slices for the Texture. The default value is 1, indicating the Texture is not a Texture Array.
usageGraphicsResourceUsageA 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.
textureOptionsTextureOptionsA 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
widthintThe width of the Texture in texels.
heightintThe height of the Texture in texels.
depthintThe depth of the Texture in texels.
mipCountMipMapCountA 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.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
usageGraphicsResourceUsageA 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
widthintThe width of the Texture in texels.
heightintThe height of the Texture in texels.
depthintThe depth of the Texture in texels.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
usageGraphicsResourceUsageA 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
sizeintThe 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.
mipCountMipMapCountA 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.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
usageGraphicsResourceUsageA 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
sizeintThe 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.
formatPixelFormatThe format to use.
textureFlagsTextureFlagsA 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.
usageGraphicsResourceUsageA 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
leftTextureDescriptionrightTextureDescription
Returns
implicit operator TextureDescription(ImageDescription)
Performs an explicit conversion from ImageDescription to TextureDescription.
public static implicit operator TextureDescription(ImageDescription description)
Parameters
descriptionImageDescriptionThe 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
descriptionTextureDescriptionThe Texture Description to convert.
Returns
- ImageDescription
The result of the conversion.
operator !=(TextureDescription, TextureDescription)
public static bool operator !=(TextureDescription left, TextureDescription right)
Parameters
leftTextureDescriptionrightTextureDescription