Struct imgui_wgpu::RendererConfig
source · 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§
source§impl<'s> RendererConfig<'s>
impl<'s> RendererConfig<'s>
sourcepub fn with_shaders(shader: ShaderModuleDescriptor<'s>) -> Self
pub fn with_shaders(shader: ShaderModuleDescriptor<'s>) -> Self
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"))
}
}