[−][src]Module web_glitz::extensions::texture_float_linear
Allows samplers that use linear interpolation to sample textures that use a 32-bit floating point internal format.
When this extension is available, a Sampler that uses a Linear, LinearMipmapNearest, LinearMipmapLinear or [NearestMipMapLinear] as its MinificationFilter, or that uses Linear as its MagnificationFilter, is allowed to sample textures that use one of the following internal formats:
This extension uses an Extended wrapper type to act as a type proof for the availability of this extension without requiring additional runtime checks when creating a sampled texture resource.
Example
use web_glitz::extensions::texture_float_linear::Extension as TextureFloatLinearExtension; use web_glitz::image::MipmapLevels; use web_glitz::image::format::RGBA32F; use web_glitz::image::texture_2d::Texture2DDescriptor; use web_glitz::image::sampler::{SamplerDescriptor, NearestMipmapLinear, Linear}; use web_glitz::rendering::{RenderTargetDescriptor, LoadOp, StoreOp}; let texture = context.try_create_texture_2d(&Texture2DDescriptor { format: RGBA32F, width: 500, height: 500, levels: MipmapLevels::Partial(1) }).unwrap(); let sampler = context.create_sampler(&SamplerDescriptor { minification_filter: NearestMipmapLinear, magnification_filter: Linear, ..SamplerDescriptor::default() }); let extension: Option<TextureFloatLinearExtension> = context.get_extension(); if let Some(extension) = extension { let sampled_texture_resource = texture.float_sampled(extension.extend(&sampler)); }
Here context is a [RenderingContext].
Structs
| Extended | Wrapper type for samplers that acts as a type proof for the availability of this extension, allowing the combination of samplers that use linear filtering with textures that use a floating point internal format. |
| Extension | Extension object for the [texture_float_linear] extension. |
Traits
| CompatibleFilter | Marker trait for filter-format combinations that become compatible when this extension is available. |
| Filterable | Marker trait for internal formats that become filterable when this extension is available. |