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>
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.
Needs a miniquad release with not-fl3/miniquad#692, which adds
RenderingBackend::start_shader.Why
load_materialwaits for its shader to compile, so a game that makes its materials while it loads compiles them one after the other, even where the driver could compile them all at once. In WebKit with nothing cached, a game's (CHOMP) 36 materials took 5.1 s that way, and about 1 s started together.Change
start_material(shader, params)starts a material's shader with miniquad'sstart_shaderand returns aPendingMaterial.PendingMaterial::finishwaits for the shader, if it's still compiling, and makes the material, asload_materialwould have.PendingMaterial::is_compilingsays whetherfinishwould still wait, so a game can start every material, keep drawing its loading screen while they compile, and finish each once it's ready.QuadGlgainsstart_pipelineandfinish_pipeline, andmake_pipelineis now the two together.load_materialis nowstart_materialfollowed byfinish, so its behaviour is unchanged.Verification
aarch64-apple-darwinandwasm32-unknown-unknownagainst miniquad with gl: start compiling a shader without waiting for it miniquad#692.