Class TextureView
A view into a texture. The main characteristics of a TextureView are:
- TextureViews can reference a subrange within a texture.
- TextureViews allow reinterpreting the data in a texture with a different PixelFormat, as long as the formats are compatible.
- TextureViews tell us the structure of the texture data (1D, 2D, 3D, cubemap, array, etc.).
- TextureViews are used to bind textures to the pipeline, as most APIs require a view to bind a texture, instead of binding the texture directly.
Inherited Members
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public abstract class TextureView : GraphicsResource
Constructors
TextureView(Texture, PixelFormat, uint, uint, uint, uint, TextureType?)
Initializes a new instance of the TextureView class.
Declaration
protected TextureView(Texture texture, PixelFormat pixelFormat = PixelFormat.Unknown, uint baseMip = 0, uint mipCount = 4294967295, uint baseLayer = 0, uint layerCount = 4294967295, TextureType? viewType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | texture | The associated Texture. |
| PixelFormat | pixelFormat | The PixelFormat of the view. This may be different from the texture's PixelFormat, as some APIs allow creating views with a different format, as long as they are compatible. If null, the view will use the texture's PixelFormat. |
| uint | baseMip | First mip level index of this texture view. |
| uint | mipCount | Number of mip levels in this texture view. |
| uint | baseLayer | First array layer index of this texture view. |
| uint | layerCount | Number of array layers in this texture view. |
| TextureType? | viewType | The type of the TextureView. If null, the view type will be inferred from the texture's description and the other parameters (baseMip, mipCount, baseLayer, layerCount). |
Fields
BaseLayer
First array layer index of this texture view.
Declaration
public readonly uint BaseLayer
Field Value
| Type | Description |
|---|---|
| uint |
BaseMip
First mip level index of this texture view.
Declaration
public readonly uint BaseMip
Field Value
| Type | Description |
|---|---|
| uint |
LayerCount
Number of array layers in this texture view.
Declaration
public readonly uint LayerCount
Field Value
| Type | Description |
|---|---|
| uint |
MipCount
Number of mip levels in this texture view.
Declaration
public readonly uint MipCount
Field Value
| Type | Description |
|---|---|
| uint |
PixelFormat
The PixelFormat of the view. This may be different from the texture's PixelFormat, as some APIs allow creating views with a different format, as long as they are compatible.
Declaration
public readonly PixelFormat PixelFormat
Field Value
| Type | Description |
|---|---|
| PixelFormat |
Texture
The associated texture.
Declaration
public readonly Texture Texture
Field Value
| Type | Description |
|---|---|
| Texture |
ViewType
The type of the TextureView.
Declaration
public readonly TextureType ViewType
Field Value
| Type | Description |
|---|---|
| TextureType |
Properties
Description
Gets the description of the underlying Texture.
Declaration
public TextureDescription Description { get; }
Property Value
| Type | Description |
|---|---|
| TextureDescription |