Struct TextureDescription
A Common description for all textures.
public struct TextureDescription : IEquatable<TextureDescription>
- Implements
- Inherited Members
Fields
ArraySize
Number of textures in the array. The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture1DArraySize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.
public int ArraySize
Field Value
Remarks
This field is only valid for Texture1D, Texture2D and TextureCube
Depth
Texture depth (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture3DSize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.
public int Depth
Field Value
Remarks
This field is only valid for Texture3D.
Dimension
The dimension of a texture.
public TextureDimension Dimension
Field Value
Flags
Flags (see SharpDX.Direct3D11.BindFlags) for binding to pipeline stages. The flags can be combined by a logical OR. For a 1D texture, the allowable values are: SharpDX.Direct3D11.BindFlags.ShaderResource, SharpDX.Direct3D11.BindFlags.RenderTarget and SharpDX.Direct3D11.BindFlags.DepthStencil.
public TextureFlags Flags
Field Value
Format
Texture format (see SharpDX.DXGI.Format).
public PixelFormat Format
Field Value
Height
Texture height (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture3DSize (2048). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.
public int Height
Field Value
Remarks
This field is only valid for Texture2D, Texture3D and TextureCube.
MipLevels
The maximum number of mipmap levels in the texture. See the remarks in SharpDX.Direct3D11.ShaderResourceViewDescription.Texture1DResource. Use 1 for a multisampled texture; or 0 to generate a full set of subtextures.
public int MipLevels
Field Value
MultisampleCount
Structure that specifies multisampling parameters for the texture. See SharpDX.DXGI.SampleDescription.
public MultisampleCount MultisampleCount
Field Value
Remarks
This field is only valid for Texture2D.
Options
Resource options for DirectX 11 textures.
public TextureOptions Options
Field Value
Usage
Value that identifies how the texture is to be read from and written to. The most common value is SharpDX.Direct3D11.ResourceUsage.Default; see SharpDX.Direct3D11.ResourceUsage for all possible values.
public GraphicsResourceUsage Usage
Field Value
Width
Texture width (in texels). The range is from 1 to SharpDX.Direct3D11.Resource.MaximumTexture1DSize (16384). However, the range is actually constrained by the feature level at which you create the rendering device. For more information about restrictions, see Remarks.
public int Width
Field Value
Remarks
This field is valid for all textures: Texture1D, Texture2D, Texture3D and TextureCube.
Properties
IsDepthStencil
Gets a value indicating whether this instance is a depth stencil.
public bool IsDepthStencil { get; }
Property Value
- bool
trueif this instance is a depth stencil; otherwise,false.
IsMultisample
Gets a value indicating whether this instance is a multi sample texture.
public bool IsMultisample { get; }
Property Value
- bool
trueif this instance is multi sample texture; otherwise,false.
IsRenderTarget
Gets a value indicating whether this instance is a render target.
public bool IsRenderTarget { get; }
Property Value
- bool
trueif this instance is render target; otherwise,false.
IsShaderResource
Gets a value indicating whether this instance is a shader resource.
public bool IsShaderResource { get; }
Property Value
- bool
trueif this instance is a shader resource; otherwise,false.
IsUnorderedAccess
Gets a value indicating whether this instance is a shader resource.
public bool IsUnorderedAccess { get; }
Property Value
- bool
trueif this instance is a shader resource; otherwise,false.
Methods
Equals(TextureDescription)
Indicates whether the current object is equal to another object of the same type.
public 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 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 desc, TextureFlags textureFlags, GraphicsResourceUsage usage)
Parameters
descTextureDescriptionThe desc.
textureFlagsTextureFlagsThe texture flags.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
TextureDescription.
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.
New1D(int, MipMapCount, PixelFormat, TextureFlags, int, GraphicsResourceUsage)
Creates a new 1D TextureDescription.
public static TextureDescription New1D(int width, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, int arraySize = 1, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
widthintThe width.
mipCountMipMapCountNumber of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
arraySizeintSize of the texture 2D array, default to 1.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of 1D TextureDescription class.
New1D(int, PixelFormat, TextureFlags, GraphicsResourceUsage)
Creates a new 1D TextureDescription with a single level of mipmap.
public static TextureDescription New1D(int width, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Immutable)
Parameters
widthintThe width.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of 1D TextureDescription class.
Remarks
The first dimension of mipMapTextures describes the number of array (Texture1D Array), second dimension is the mipmap, the third is the texture data for a particular mipmap.
New1D(int, PixelFormat, TextureFlags, int, GraphicsResourceUsage)
Creates a new 1D TextureDescription 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.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
arraySizeintSize of the texture 2D array, default to 1.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of 1D TextureDescription class.
New2D(int, int, MipMapCount, PixelFormat, TextureFlags, int, GraphicsResourceUsage, MultisampleCount, TextureOptions)
Creates a new TextureDescription.
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.
heightintThe height.
mipCountMipMapCountNumber of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
arraySizeintSize of the texture 2D array, default to 1.
usageGraphicsResourceUsageThe usage.
multisampleCountMultisampleCountThe multisample count.
textureOptionsTextureOptions
Returns
- TextureDescription
A new instance of TextureDescription class.
New2D(int, int, PixelFormat, TextureFlags, int, GraphicsResourceUsage, TextureOptions)
Creates a new TextureDescription 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.
heightintThe height.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
arraySizeintSize of the texture 2D array, default to 1.
usageGraphicsResourceUsageThe usage.
textureOptionsTextureOptions
Returns
- TextureDescription
A new instance of TextureDescription class.
New3D(int, int, int, MipMapCount, PixelFormat, TextureFlags, GraphicsResourceUsage)
Creates a new TextureDescription.
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.
heightintThe height.
depthintThe depth.
mipCountMipMapCountNumber of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of TextureDescription class.
New3D(int, int, int, PixelFormat, TextureFlags, GraphicsResourceUsage)
Creates a new TextureDescription 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.
heightintThe height.
depthintThe depth.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagstrue if the texture needs to support unordered read write.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of TextureDescription class.
NewCube(int, MipMapCount, PixelFormat, TextureFlags, GraphicsResourceUsage)
Creates a new Cube TextureDescription.
public static TextureDescription NewCube(int size, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
sizeintThe size (in pixels) of the top-level faces of the cube texture.
mipCountMipMapCountNumber of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagsThe texture flags.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of TextureDescription class.
NewCube(int, PixelFormat, TextureFlags, GraphicsResourceUsage)
Creates a new Cube TextureDescription.
public static TextureDescription NewCube(int size, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
Parameters
sizeintThe size (in pixels) of the top-level faces of the cube texture.
formatPixelFormatDescribes the format to use.
textureFlagsTextureFlagsThe texture flags.
usageGraphicsResourceUsageThe usage.
Returns
- TextureDescription
A new instance of TextureDescription class.
ToCloneableDescription()
Gets a clone description of this instance (if texture is immutable, it is switched to default).
public TextureDescription ToCloneableDescription()
Returns
- TextureDescription
A clone of this instance.
ToStagingDescription()
Gets the staging description for this instance..
public TextureDescription ToStagingDescription()
Returns
- TextureDescription
A Staging description
Operators
operator ==(TextureDescription, TextureDescription)
Implements the operator ==.
public static bool operator ==(TextureDescription left, TextureDescription right)
Parameters
leftTextureDescriptionThe left.
rightTextureDescriptionThe right.
Returns
- bool
The result of the operator.
implicit operator TextureDescription(ImageDescription)
Performs an explicit conversion from ImageDescription to TextureDescription.
public static implicit operator TextureDescription(ImageDescription description)
Parameters
descriptionImageDescriptionThe image description.
Returns
- TextureDescription
The result of the conversion.
implicit operator ImageDescription(TextureDescription)
Performs an explicit conversion from ImageDescription to TextureDescription.
public static implicit operator ImageDescription(TextureDescription description)
Parameters
descriptionTextureDescriptionThe image description.
Returns
- ImageDescription
The result of the conversion.
operator !=(TextureDescription, TextureDescription)
Implements the operator !=.
public static bool operator !=(TextureDescription left, TextureDescription right)
Parameters
leftTextureDescriptionThe left.
rightTextureDescriptionThe right.
Returns
- bool
The result of the operator.