-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[g-webgl] 需要正确处理 WebGL Context Lost #1362
Labels
Comments
在 interface WebGLRendererConfig extends RendererConfig {
targets: ('webgl1' | 'webgl2')[];
onContextLost: (e: Event) => void;
onContextRestored: (e: Event) => void;
onContextCreationError: (e: Event) => void;
}
interface WebGPURendererConfig extends RendererConfig {
shaderCompilerPath: string;
onContextLost: () => void;
} 使用方法如下: import { Renderer } from 'g-webgl';
new Renderer({
onContextLost: () => {}
}); |
xiaoiver
added a commit
that referenced
this issue
Jun 14, 2023
xiaoiver
added a commit
that referenced
this issue
Jun 14, 2023
* fix: WebGPU HAL & handle lost context #863 & #1362 * fix: wait for context lost promise * fix: create renderer3d component in picking plugin #1094 * feat: add onContextLost callback to constructor options of WebGL & WebGPU renderer #1362 * fix: copy glsl_wgsl_compiler_bg.wasm to dist dir of g-webgpu #1369
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.khronos.org/webgl/wiki/HandlingContextLost
当 WebGL 上下文丢失时,应该尝试恢复:
同理,WebGPU 错误处理可以参考:https://github.com/gpuweb/gpuweb/blob/main/design/ErrorHandling.md#fatal-errors-requestadapter-requestdevice-and-devicelost
The text was updated successfully, but these errors were encountered: