pub struct WgpuBackendData {
pub init_info: WgpuInitInfo,
pub instance: Option<Instance>,
pub adapter: Option<Adapter>,
pub device: Device,
pub queue: Queue,
pub render_target_format: TextureFormat,
pub depth_stencil_format: Option<TextureFormat>,
pub pipeline_state: Option<RenderPipeline>,
pub render_resources: RenderResources,
pub frame_resources: Vec<FrameResources>,
pub num_frames_in_flight: u32,
pub frame_index: u32,
}Expand description
Main backend data structure
This corresponds to ImGui_ImplWGPU_Data in the C++ implementation
Fields§
§init_info: WgpuInitInfoInitialization info
instance: Option<Instance>WGPU instance (if provided)
adapter: Option<Adapter>WGPU adapter (if provided)
device: DeviceWGPU device
queue: QueueDefault queue
render_target_format: TextureFormatRender target format
depth_stencil_format: Option<TextureFormat>Depth stencil format
pipeline_state: Option<RenderPipeline>Render pipeline
render_resources: RenderResourcesRender resources (samplers, uniforms, bind groups)
frame_resources: Vec<FrameResources>Frame resources (per-frame buffers)
num_frames_in_flight: u32Number of frames in flight
frame_index: u32Current frame index
Implementations§
Source§impl WgpuBackendData
impl WgpuBackendData
Sourcepub fn new(init_info: WgpuInitInfo) -> Self
pub fn new(init_info: WgpuInitInfo) -> Self
Create new backend data from initialization info
Sourcepub fn current_frame_resources(&mut self) -> &mut FrameResources
pub fn current_frame_resources(&mut self) -> &mut FrameResources
Get the current frame resources
Sourcepub fn frame_resources_at(
&mut self,
index: usize,
) -> Option<&mut FrameResources>
pub fn frame_resources_at( &mut self, index: usize, ) -> Option<&mut FrameResources>
Get frame resources by index
Sourcepub fn next_frame(&mut self)
pub fn next_frame(&mut self)
Advance to the next frame
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the backend is initialized
Auto Trait Implementations§
impl Freeze for WgpuBackendData
impl !RefUnwindSafe for WgpuBackendData
impl Send for WgpuBackendData
impl Sync for WgpuBackendData
impl Unpin for WgpuBackendData
impl UnsafeUnpin for WgpuBackendData
impl !UnwindSafe for WgpuBackendData
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