Skip to main content

Module shared_context

Module shared_context 

Source
Expand description

共享 wgpu GPU 上下文(跨 crate 复用) 进程级共享的 wgpu GPU 上下文。

当 rgpui 平台创建第一个 WgpuContext 时,会在此处注册共享的 wgpu::Devicewgpu::Queuergpui-3d 等第三方渲染器 可以获取这些共享资源,避免创建多个 wgpu::Instance

Structs§

SharedGpuContext
共享的 wgpu GPU 上下文,用于跨 crate 复用同一 wgpu 实例。

Functions§

register
注册共享的 wgpu GPU 上下文。仅第一次调用生效,后续调用被忽略。
try_get
获取共享的 wgpu GPU 上下文(如果已注册)。