Make the PixiJS renderer preference configurable - #35
Open
soulrap wants to merge 1 commit into
Open
Conversation
`preference` was hardcoded to 'webgpu'. On machines where WebGPU is available but renders nothing, the game is a black screen with no error - the scene graph builds and the ticker runs, only no pixels come out. PixiJS falls back to WebGL when WebGPU is *unavailable*, so it cannot detect this case on its own. Expose an optional `rendererPreference` prop on App/InitialiseApplication, defaulting to 'webgpu' so current behaviour is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
InitialiseApplication.sveltehardcodes the PixiJS renderer preference:On a machine where WebGPU is available but produces no output, every sample
game is a black screen. There is no error, in the console or anywhere else —
the app authenticates, assets load, the scene graph builds and the ticker runs.
Only nothing is drawn.
Observed on Windows 11 / Chrome, with the
scattersample connected to a liveRGS session:
preference: 'webgpu'preference: 'webgl'webgpuwebgl2renderer.typestage.childrenticker.startedThe state that makes this hard to diagnose is the middle rows: the renderer
reports the right size, the stage has children, and the ticker is running, so
every health check short of looking at the pixels passes.
PixiJS already falls back to WebGL when WebGPU is unavailable. It cannot
fall back here, because WebGPU reports itself as working — so the choice has to
be made from outside.
Change
Expose an optional
rendererPreferenceprop, threaded fromAppthrough toInitialiseApplication:Nothing changes by default. A game that hits this can now opt out with
instead of patching
pixi-svelteinnode_modulesor forking the package,which is what is required today.
Notes
The default stays
'webgpu'deliberately — this is not an argument that WebGPUis the wrong default, only that there needs to be a way out of it that does not
involve editing the package. If you would rather this were driven by an env var
(
PUBLIC_RENDERER_PREFERENCE) or auto-detected with a render probe, I am happyto redo it that way.
Two files, +2 −2.