mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
More documentation for TextureView. (#7069)
Explain how to make one and what its properties are.
This commit is contained in:
@@ -37,7 +37,11 @@ impl Texture {
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a view of this texture.
|
||||
/// Creates a view of this texture, specifying an interpretation of its texels and
|
||||
/// possibly a subset of its layers and mip levels.
|
||||
///
|
||||
/// Texture views are needed to use a texture as a binding in a [`BindGroup`]
|
||||
/// or as an attachment in a [`RenderPass`].
|
||||
pub fn create_view(&self, desc: &TextureViewDescriptor<'_>) -> TextureView {
|
||||
let view = self.inner.create_view(desc);
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ use crate::*;
|
||||
|
||||
/// Handle to a texture view.
|
||||
///
|
||||
/// A `TextureView` object describes a texture and associated metadata needed by a
|
||||
/// [`RenderPipeline`] or [`BindGroup`].
|
||||
/// A `TextureView` object refers to a [`Texture`], or a subset of its layers and mip levels, and
|
||||
/// specifies an interpretation of the texture’s texels, which is needed to use a texture as a
|
||||
/// binding in a [`BindGroup`] or as an attachment in a [`RenderPass`].
|
||||
/// It can be created using [`Texture::create_view()`], which accepts a [`TextureViewDescriptor`]
|
||||
/// specifying the properties of the view.
|
||||
///
|
||||
/// Corresponds to [WebGPU `GPUTextureView`](https://gpuweb.github.io/gpuweb/#gputextureview).
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
Reference in New Issue
Block a user