pub struct RendererConfig<'s> {
    pub texture_format: TextureFormat,
    pub depth_format: Option<TextureFormat>,
    pub sample_count: u32,
    pub shader: Option<ShaderModuleDescriptor<'s>>,
    pub vertex_shader_entry_point: Option<&'s str>,
    pub fragment_shader_entry_point: Option<&'s str>,
}
Expand description

Configuration for the renderer.

Fields§

§texture_format: TextureFormat§depth_format: Option<TextureFormat>§sample_count: u32§shader: Option<ShaderModuleDescriptor<'s>>§vertex_shader_entry_point: Option<&'s str>§fragment_shader_entry_point: Option<&'s str>

Implementations§

Create a new renderer config with custom shaders.

Examples found in repository?
src/lib.rs (line 276)
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
    pub fn new() -> Self {
        RendererConfig {
            fragment_shader_entry_point: Some(FS_ENTRY_POINT_LINEAR),
            ..Self::with_shaders(include_wgsl!("imgui.wgsl"))
        }
    }

    /// Create a new renderer config with precompiled default shaders outputting srgb color.
    ///
    /// If you write to a Bgra8Unorm framebuffer, this is what you want.
    pub fn new_srgb() -> Self {
        RendererConfig {
            fragment_shader_entry_point: Some(FS_ENTRY_POINT_SRGB),
            ..Self::with_shaders(include_wgsl!("imgui.wgsl"))
        }
    }

Create a new renderer config with precompiled default shaders outputting linear color.

If you write to a Bgra8UnormSrgb framebuffer, this is what you want.

Examples found in repository?
src/lib.rs (line 265)
264
265
266
    fn default() -> Self {
        Self::new()
    }

Create a new renderer config with precompiled default shaders outputting srgb color.

If you write to a Bgra8Unorm framebuffer, this is what you want.

Trait Implementations§

Create a new renderer config with precompiled default shaders outputting linear color.

If you write to a Bgra8UnormSrgb framebuffer, this is what you want.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.