Repository navigation
Conversation
`load_material` waits for its shader to compile, so a game that makes its materials as it loads compiles them one after the other, even where the driver could compile them all at once. `start_material` starts a material's shader with miniquad's `start_shader` and returns a `PendingMaterial`, whose `finish` waits for it and makes the material, as `load_material` would have. `is_compiling` says whether `finish` would still wait, so a game can start every material, keep drawing its loading screen while they compile, and finish each once it's ready. `QuadGl` gains `start_pipeline` and `finish_pipeline` to match `make_pipeline`. Needs a miniquad release with `RenderingBackend::start_shader`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`QuadGl::new` made the default pipelines' shader and the snapshotter's with `new_shader`, which waits for each to compile, so the second only started once the first had finished. Both are now started with miniquad's `start_shader` before either is finished, so they compile at once where the driver can. In WebKit with nothing cached, the two took about 0.39 s one after the other and 0.24 s together. Needs a miniquad release with `RenderingBackend::start_shader`. Co-Authored-By: Claude Opus 5.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.
Builds on #1079, whose commit it includes: only the last commit is new here. Like #1079, it needs a miniquad release with not-fl3/miniquad#692, which adds
RenderingBackend::start_shader.Why
QuadGl::newmakes two shaders, the default pipelines' and the snapshotter's, withnew_shader, which waits for each to compile. The second only starts once the first has finished, before the first frame. In WebKit with nothing cached, that took about 0.39 s, the two one after the other.Change
PipelinesStorageandMagicSnapshottereach gain astart_shader, and theirnewtakes the started shader and finishes it.QuadGl::newstarts both before finishing either, so they compile at once where the driver can: about 0.24 s together in WebKit.start_shadercompiles straight away, as on Metal, nothing changes.Verification
aarch64-apple-darwinandwasm32-unknown-unknownagainst miniquad with gl: start compiling a shader without waiting for it miniquad#692.