BabylonJS / BabylonJS/BabylonNative

Shader cache

Open
#1,407 0 comments 1 reaction 1 assignee Claimed by @CedricGuillemet View on GitHub
Dominant language
C++
Stars
919
Forks
162
Avg merge
1d 15h
Merged PRs (30d)
19

Description

Parse and convert shader once during app lifetime or bundle the cache with the app. This implies a fixed number of shaders and variations.
Performance gain are noticeable on BN validation tests or with users app.

This works at Native level. I don't see a need to expose it to JS.
- 1 cache per engine. Construct it once per App, then add a reference in engine
- Use (optional?) compressor like LZ4 for extra compression
- Store API in cache header so it's not possible to mismatch
- It makes sense to use UnitTests to generate the cache and inject it back in the build. How to do it efficiently on the CI? Is it possible to generate GLSL on win32 platform. Or Metal from a MacOS CI agent? -> leave the work to users
- Logging/exception when a shader is not found in cache and GLSLANG/SPIRV is disabled
- Add build options to disable SPIRV/GLSlang build and link.

PR : https://github.com/BabylonJS/BabylonNative/pull/1402

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.