perf: skip redundant bindTexture in setTextureAt - #12
Draft
roncarbot wants to merge 2 commits into
Draft
Conversation
When a sampler already holds the requested texture, avoid a second GL bindTexture. Diggy stress: bindTexture/frame 233 → ~0 with no visual regression on title screen.
Track the active sampler unit and skip gl.activeTexture when the unit already holds the requested texture with unchanged sampler params. Pairs with bindTexture skip; Diggy title median frame 99.9→83.4 ms on SwiftShader harness (draws unchanged).
Author
E3 follow-up (c00c1c4)Skip redundant Diggy title @ SwiftShader harness
Visual OK (title screen screenshot retained). Draws unchanged — CPU win from fewer GL state calls on software GL. |
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.
Summary
TextureContextWebGL.setTextureAt, when the sampler already holds the requested texture, callbindTexturewithcheck=trueso the GL bind is skipped.commit()so wrap/filter updates remain correct.Measurements (Diggy_fixed, coolmath pixel-federation, with renderer E1)
Frame time flat on Diggy (CPU/draw-bound at ~11 fps); clear GPU state-change proxy win.
SWF compatibility
Companion:
@awayjs/rendererPR awayjs/renderer#35Test plan