Struct naga::back::glsl::TextureMapping
source · pub struct TextureMapping {
pub texture: Handle<GlobalVariable>,
pub sampler: Option<Handle<GlobalVariable>>,
}
Expand description
Mapping between a texture and its sampler, if it exists.
GLSL pre-Vulkan has no concept of separate textures and samplers. Instead, everything is a
gsamplerN
where g
is the scalar type and N
is the dimension. But naga uses separate textures
and samplers in the IR, so the backend produces a FastHashMap
with the texture name
as a key and a TextureMapping
as a value. This way, the user knows where to bind.
Storage
images produce gimageN
and don’t have an associated sampler,
so the sampler
field will be None
.
Fields§
§texture: Handle<GlobalVariable>
Handle to the image global variable.
sampler: Option<Handle<GlobalVariable>>
Handle to the associated sampler global variable, if it exists.
Trait Implementations§
source§impl Clone for TextureMapping
impl Clone for TextureMapping
source§fn clone(&self) -> TextureMapping
fn clone(&self) -> TextureMapping
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for TextureMapping
impl RefUnwindSafe for TextureMapping
impl Send for TextureMapping
impl Sync for TextureMapping
impl Unpin for TextureMapping
impl UnwindSafe for TextureMapping
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
Mutably borrows from an owned value. Read more