pub struct WgpuInitInfo {
pub instance: Option<Instance>,
pub adapter: Option<Adapter>,
pub device: Device,
pub queue: Queue,
pub num_frames_in_flight: u32,
pub render_target_format: TextureFormat,
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 in the C++ implementation
Fields§
§instance: Option<Instance>WGPU instance (required for multi-viewport to create per-window surfaces)
adapter: Option<Adapter>WGPU adapter (optional, but recommended for multi-viewport to query surface capabilities)
device: DeviceWGPU device
queue: QueueWGPU queue
num_frames_in_flight: u32Number of frames in flight (default: 3)
render_target_format: TextureFormatRender target format
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_frames_in_flight(self, count: u32) -> Self
pub fn with_frames_in_flight(self, count: u32) -> Self
Set the number of frames in flight
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 an adapter for querying per-surface capabilities (recommended for multi-viewport)
Trait Implementations§
Source§impl Clone for WgpuInitInfo
impl Clone for WgpuInitInfo
Source§fn clone(&self) -> WgpuInitInfo
fn clone(&self) -> WgpuInitInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WgpuInitInfo
impl !RefUnwindSafe for WgpuInitInfo
impl Send for WgpuInitInfo
impl Sync for WgpuInitInfo
impl Unpin for WgpuInitInfo
impl UnsafeUnpin for WgpuInitInfo
impl !UnwindSafe for WgpuInitInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more