pub struct WgpuInitInfo {
pub instance: Option<Instance>,
pub adapter: Option<Adapter>,
pub device: Device,
pub queue: Queue,
pub render_target_format: TextureFormat,
pub viewport_surface_config: WgpuViewportSurfaceConfig,
pub depth_stencil_format: Option<TextureFormat>,
pub pipeline_multisample_state: MultisampleState,
}Expand description
Initialization data for ImGui WGPU renderer.
This corresponds to ImGui_ImplWGPU_InitInfo plus Rust-owned multi-viewport policy.
Fields§
§instance: Option<Instance>WGPU instance (required for multi-viewport to create per-window surfaces)
adapter: Option<Adapter>WGPU adapter (required by multi-viewport; optional for single-window rendering)
device: DeviceWGPU device
queue: QueueWGPU queue
render_target_format: TextureFormatRender target format
viewport_surface_config: WgpuViewportSurfaceConfigPresentation policy for secondary viewport surfaces.
depth_stencil_format: Option<TextureFormat>Depth stencil format (None if no depth buffer)
pipeline_multisample_state: MultisampleStatePipeline multisample state
Implementations§
Source§impl WgpuInitInfo
impl WgpuInitInfo
Sourcepub fn new(
device: Device,
queue: Queue,
render_target_format: TextureFormat,
) -> Self
pub fn new( device: Device, queue: Queue, render_target_format: TextureFormat, ) -> Self
Create new initialization info with required parameters
Sourcepub fn with_depth_stencil_format(self, format: TextureFormat) -> Self
pub fn with_depth_stencil_format(self, format: TextureFormat) -> Self
Set the depth stencil format
Sourcepub fn with_multisample_state(self, state: MultisampleState) -> Self
pub fn with_multisample_state(self, state: MultisampleState) -> Self
Set the multisample state
Sourcepub fn with_instance(self, instance: Instance) -> Self
pub fn with_instance(self, instance: Instance) -> Self
Provide an instance for creating per-window surfaces (multi-viewport)
Sourcepub fn with_adapter(self, adapter: Adapter) -> Self
pub fn with_adapter(self, adapter: Adapter) -> Self
Provide the adapter required to negotiate multi-viewport surface capabilities
Sourcepub fn with_viewport_surface_config(
self,
config: WgpuViewportSurfaceConfig,
) -> Self
pub fn with_viewport_surface_config( self, config: WgpuViewportSurfaceConfig, ) -> Self
Set the complete presentation policy for secondary viewport surfaces.
Trait Implementations§
Source§impl Clone for WgpuInitInfo
impl Clone for WgpuInitInfo
Source§fn clone(&self) -> WgpuInitInfo
fn clone(&self) -> WgpuInitInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more