Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Avoid additional shaders creation caused by out of order lights #5550

Merged
merged 3 commits into from Aug 4, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Aug 4, 2023

Fixes #5542

When lights stored by the Layer were in different order, a different key would be generated causing new shaders to be created.

To avoid this, the lights the Layer stores are sorted by their key.

Additionally, small refactor related to shader key generation has been done, making those multiline and easier to read, and storing those on the Shader instance in debug mode, to allow us to easily compare why a shader was generated (see the generation and processing keys)

Screenshot 2023-08-04 at 14 25 05

@mvaligursky mvaligursky self-assigned this Aug 4, 2023
@mvaligursky mvaligursky added bug area: graphics Graphics related issue labels Aug 4, 2023
src/platform/graphics/shader-processor-options.js Outdated Show resolved Hide resolved
src/scene/shader-lib/program-library.js Outdated Show resolved Hide resolved
@mvaligursky mvaligursky merged commit 864b4bd into main Aug 4, 2023
7 checks passed
@mvaligursky mvaligursky deleted the mv-shader-gen-keys branch August 4, 2023 15:52
mvaligursky added a commit that referenced this pull request Aug 16, 2023
…#5550)

* [Fix] Avoid additional shaders creation caused by out of order lights

* don’t include vertex format to be part of processing key on WebGL

* updates

---------

Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LitShader recompile
2 participants