[Perf] (ShaderTranspiler, ProgramState): memoize the glslang parse verdict so a repeated compile skips the parse

This commit is contained in:
2026-08-20 18:53:57 -04:00
parent a8228ca287
commit 5daf7bf093
8 changed files with 380 additions and 88 deletions
+8 -7
View File
@@ -203,13 +203,14 @@ namespace MobileGL::MG_Config {
// immediately stay serial by their own construction). Off by default; never
// advertise it.
QuirkOverride AsyncOptimisticShaderStatus = QuirkOverride::Auto;
// MOBILEGL_SHADER_CACHE: the two-level, in-memory shader translation memo
// (MG_Util/ShaderTranspiler/TranslationCache.h) - L1 memoizes a linked
// program's sanitized SPIR-V, L2 memoizes DirectGLES's emitted ESSL. Auto
// is ON; ForceOff turns BOTH levels off and makes every translation run
// from scratch. The escape hatch exists because a wrong cache hit is a
// silently miscompiled shader: if a device ever renders differently with
// the cache on, one run with this falsy says so.
// MOBILEGL_SHADER_CACHE: the three-level, in-memory shader translation memo
// (MG_Util/ShaderTranspiler/TranslationCache.h). The levels follow the GL
// entry points - L1c memoizes one glCompileShader's PARSE VERDICT, L1 a
// linked program's whole front end, L2 DirectGLES's emitted ESSL. Auto is
// ON; ForceOff turns ALL THREE off and makes every translation run from
// scratch. The escape hatch exists because a wrong cache hit is a silently
// miscompiled shader: if a device ever renders differently with the cache
// on, one run with this falsy says so.
QuirkOverride ShaderTranslationCache = QuirkOverride::Auto;
};
extern FeaturesTable Features;