Repository navigation
Fix crash on browsers with no usable GPU backend - #210
Open
sentry[bot] wants to merge 1 commit into
Open
sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes TypeError: Cannot read properties of null (reading 'getSupportedExtensions') during renderer initialization.
Root Cause
browserSupportsWebGPU()only verified"gpu" in navigator. In environments wherenavigator.gpuis exposed but no GPU adapter or WebGL2 context can actually be created (headless environments, disabled hardware acceleration, blocklisted GPUs), Three.js'sWebGPURenderer.init()silently falls back to its WebGL2 backend. Because WebGL2 context creation also returnsnull, Three.js'sWebGLExtensionsconstructor attempts to invokethis.gl.getSupportedExtensions()on thenullcontext, throwing an unhandled TypeError.Changes
src/renderer/webgpu-support.ts: AddedprobeRendererSupport()andassertRendererSupported()to probe for a WebGPU adapter and probe WebGL2 availability via a scratch canvas before attempting renderer creation. AddedRendererUnsupportedError.src/renderer/create-webgpu-renderer.ts: Asserts renderer support before instantiatingTHREE.WebGPURendererto prevent falling into the Three.js WebGL2 null-context fallback crash.src/hooks/use-editor-renderer.ts: CatchesRendererUnsupportedErrorto display the friendly unsupported banner and reports it via SentrycaptureMessagetagged withsurface: "webgpu-unsupported", avoiding boguswebgpu-initexception captures.Fixes SHADER-LAB-J
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.