Skip to main content

SystemTextures

Struct SystemTextures 

Source
pub struct SystemTextures {
    pub white_2d: Tracked<TextureView>,
    pub black_2d: Tracked<TextureView>,
    pub transparent_2d: Tracked<TextureView>,
    pub normal_2d: Tracked<TextureView>,
    pub black_cube: Tracked<TextureView>,
    pub white_r8: Tracked<TextureView>,
    pub black_hdr: Tracked<TextureView>,
    pub depth_d2array: Tracked<TextureView>,
    pub screen_layout: Tracked<BindGroupLayout>,
    pub screen_sampler: Tracked<Sampler>,
    pub shadow_compare_sampler: Tracked<Sampler>,
}
Expand description

Global system fallback texture pool and Group 3 bind-group infrastructure.

Created once during renderer initialisation and shared (by reference) with all render-graph contexts. All textures are 1×1 (or 1×1×6 for cubes) and never mutated after creation.

Fields§

§white_2d: Tracked<TextureView>

1×1 RGBA8 [255,255,255,255] — multiplicative identity.

§black_2d: Tracked<TextureView>

1×1 RGBA8 [0,0,0,255] — additive identity.

§transparent_2d: Tracked<TextureView>

1×1 RGBA8 [0,0,0,0] — fully transparent / no contribution.

§normal_2d: Tracked<TextureView>

1×1 RGBA8 [128,128,255,255] — default tangent-space normal (+Z).

§black_cube: Tracked<TextureView>

1×1×6 RGBA8 all-black cube map — empty environment / IBL.

§white_r8: Tracked<TextureView>

1×1 R8Unorm [255] — SSAO fallback (AO = 1.0, fully lit).

§black_hdr: Tracked<TextureView>

1×1 Rgba16Float zero — HDR transmission fallback.

§depth_d2array: Tracked<TextureView>

1×1 Depth32Float D2Array — shadow map fallback.

§screen_layout: Tracked<BindGroupLayout>

BindGroupLayout for Group 3 (transmission, SSAO, shadow).

§screen_sampler: Tracked<Sampler>

Linear-clamp sampler shared by transmission / SSAO sampling.

§shadow_compare_sampler: Tracked<Sampler>

LessEqual comparison sampler for PCF shadow sampling.

Implementations§

Source§

impl SystemTextures

Source

pub fn new(device: &Device, queue: &Queue) -> Self

Creates all system textures and Group 3 infrastructure.

This is called once during renderer initialisation. The total GPU memory footprint is negligible (a handful of 1×1 textures).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,