pub struct TextureView {
view: TextureView,
format: TextureFormat,
}Expand description
A texture view together with the format it views its texture as.
wgpu exposes no view format, and a view may be created with one besides its
texture’s — an sRGB view over a non-sRGB swap-chain image, for example — so
the format a view was created with is tracked next to it rather than
assumed from the texture. This is the kind a
ResHandle<TextureView> names, and
TextureExt::create_view builds one from a descriptor, so the format and
the view cannot disagree.
A view wgpu itself handed out states its format explicitly with
TextureView::new: there is no way to recover it afterwards, which is
exactly why this wrapper exists.
Fields§
§view: TextureViewThe view.
format: TextureFormatThe format the view was created with.
Implementations§
Source§impl TextureView
impl TextureView
Trait Implementations§
Source§impl Clone for TextureView
impl Clone for TextureView
Source§impl Debug for TextureView
impl Debug for TextureView
impl Eq for TextureView
Source§impl From<TextureView> for TextureView
impl From<TextureView> for TextureView
Source§fn from(value: TextureView) -> Self
fn from(value: TextureView) -> Self
Source§impl From<TextureView> for Resource
impl From<TextureView> for Resource
Source§fn from(value: TextureView) -> Self
fn from(value: TextureView) -> Self
Source§impl PartialEq for TextureView
Two views are equal when they are the same view of the same texture.
impl PartialEq for TextureView
Two views are equal when they are the same view of the same texture.
Written out rather than derived because the derive expands to a comparison
of the bare [wgpu::TextureView] in generated code the struct’s own
#[expect] does not cover. Going through TextureView::view and
TextureView::format keeps the bare type named only in the wrapper, which
is the whole point of it.
Source§impl ResourceKind for TextureView
impl ResourceKind for TextureView
Source§fn borrow_from(resource: &Resource) -> Option<&Self>
fn borrow_from(resource: &Resource) -> Option<&Self>
Resource, or None when that
resource is of another kind.Source§fn take_from(resource: Resource) -> Option<Self>
fn take_from(resource: Resource) -> Option<Self>
Resource, or None when that
resource is of another kind.Source§fn into_resource(self) -> Resource
fn into_resource(self) -> Resource
Resource.Auto Trait Implementations§
impl !RefUnwindSafe for TextureView
impl !UnwindSafe for TextureView
impl Forget for TextureView
impl Freeze for TextureView
impl Send for TextureView
impl Sync for TextureView
impl Unpin for TextureView
impl UnsafeUnpin for TextureView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more