Skip to main content

Module gpu

Module gpu 

Source
Expand description

The GPU context and its asynchronous request.

A scene is set up once the adapter and device exist, and the setup needs a mutable world β€” so the request is a future the world itself runs, driven by whoever drives the world, and the ready callback lands as a command between two event callbacks. Nothing outside this module needs to know any of that: request_gpu runs the request and calls back when the context is ready.

Re-exportsΒ§

use std::cell::RefCell; πŸ”’
use std::rc::Rc; πŸ”’
use unlit_ecs::Command; πŸ”’
use unlit_ecs::Entity; πŸ”’
use unlit_ecs::EntityAccessError; πŸ”’
use unlit_ecs::World; πŸ”’
use crate::executor::LocalTasks; πŸ”’
use unlit_wgpu::capabilities::DeviceCapabilities; πŸ”’
use unlit_wgpu::capabilities::DeviceTier; πŸ”’
use unlit3d::frame::FrameBehaviourOrder; πŸ”’
use unlit3d::frame::OnFrame; πŸ”’
use unlit3d::winit::builtin::DisplayHandle; πŸ”’
use unlit3d::winit::builtin::ExitRequest; πŸ”’
use unlit3d::winit::builtin::Resumed; πŸ”’
use unlit3d::winit::builtin::window; πŸ”’

StructsΒ§

Gpu
The GPU context a scene draws with.
RunGpuReady πŸ”’
Run the GPU request’s ready callback with a mutable world.

EnumsΒ§

GpuRequest πŸ”’
The answer a GPU request settles on.
GpuRequestError
Why a GPU request could not start the renderer.
RequestStage πŸ”’
The stages a GPU request moves through, one per frame behaviour.

ConstantsΒ§

REQUEST_GPU_ORDER πŸ”’
The frame-behaviour order the GPU request runs at: before the default band, so the GPU is there before any behaviour that states no order runs.

FunctionsΒ§

request_adapter πŸ”’
Ask instance for a high-performance adapter that can present to surface, when one is given.
request_gpu
Start the app’s GPU request once the window exists, and run ready with the context once it lands.