Repository navigation
fix(hands): keep the picture when the resolution scaler reaches its bottom tier - #297
Merged
Merged
Conversation
…ottom tier - At the low tier the key light's shadow map was disposed and left null. three then binds a stand-in depth texture with no comparison function to the shadow sampler, which ANGLE refuses, so every lit mesh (ring, crowd, fighters) stopped drawing on a slow or busy client. - The shadow map is now swapped for a 16 pixel one drawn once, never left null; castShadow is still untouched, so no program is recompiled.
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
On a client slow or busy enough for the dynamic resolution scaler to reach its bottom tier, the whole lit scene stopped drawing: the ring, the crowd and both fighters vanished and only the backdrop and the HUD were left. The console filled with
GL_INVALID_OPERATION: glDrawElements: Mismatch between texture format and sampler type.Cause
At the low tier
setKeyShadowTierdisposed the key light's shadow map and left it null whilecastShadowstayed on (so that no program is recompiled). With no map, three 0.186 binds its stand-in depth texture to thesampler2DShadowarray without setting a comparison function, and ANGLE refuses every draw that samples it.Fix
The shadow map is never left null: turned off, it is swapped for a 16 pixel map that is drawn once and kept. The large depth target is still freed and
castShadowis still untouched, so nothing is recompiled.Verification
mainin Chromium (ANGLE Metal) with?fixture=1andr=__fixtureRenderer; r.scaler.record=()=>false; r.scaler.scale=0.55; r.applyResolutionScale(): empty arena and the GL error flood. With the fix the same steps draw the whole scene with no console errors or warnings.renderer-gpu.test.tsnow pins that a live depth target is bound after every frame through repeated down and up tier changes, that the large one is freed, that the small one is drawn once and kept, and that no program is compiled.npm run typecheck,npm run build,npm run scan:build,npm run audit:highpass. The GPU, gore, pose and injury-pose test files pass locally; the whole suite is left to CI because this machine is under load.