[Fix] (CMakeLists.txt, MG_Backend/DirectGLES, MG_Pipe, MG_Test/Backend, MG_Test/ShaderTranspiler, MG_Util/ShaderTranspiler): give integer attributes their GL value in Espryt

- every integer array reaches the driver with its input's signedness, at the pointer, zero-stride and client-memory call sites, so each fetch is one ES defines
- 8/16-bit data of the other signedness is widened back by the program's runtime-width seeds, armed on the first draw that needs them and set as two uniforms per draw
- capture programs with integer inputs are armed at their first build; arming is part of the ESSL translation key
- a build whose seeds cannot be verified keeps the driver's own value for narrow data; one that fails to link is rebuilt without them
- the program's integer input masks are memoized on its shader record
This commit is contained in:
2026-10-19 02:53:01 -04:00
parent 381124a0b6
commit d1293354d1
18 changed files with 747 additions and 55 deletions
@@ -208,6 +208,7 @@ namespace MobileGL::MG_Util::ShaderTranspiler {
builder.StringMap(inputs.outputBlockRenames ? *inputs.outputBlockRenames : kEmptyRenames);
builder.Value(static_cast<Uint8>(inputs.stripInputBlockLocations));
builder.Value(static_cast<Uint8>(inputs.stripOutputBlockLocations));
builder.Value(static_cast<Uint8>(inputs.narrowIntegerSeedsArmed));
static const Vector<Uint32> kEmptyWords;
builder.Words(inputs.spirv ? *inputs.spirv : kEmptyWords);
return MakeTranslationCacheKey(builder);
@@ -670,6 +670,10 @@ namespace MobileGL::MG_Util::ShaderTranspiler {
// other end is in a different program must keep its location.
Bool stripInputBlockLocations = false;
Bool stripOutputBlockLocations = false;
// Whether this (vertex) stage carries the narrow-integer seeds - a per-program arming, set
// only once some draw fed the program 8/16-bit data of the other signedness, which changes
// the emitted ESSL of the same module.
Bool narrowIntegerSeedsArmed = false;
// The top of the reserved storage-block window atomic-counter blocks are moved into
// (`top - N` for GL binding N). Derived from the driver's