mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 12:18:30 +09:00
Bind a fragment output to both a color number and a color index (0 or 1 for dual-source blending), and report the bound index back through glGetFragDataIndex. - ProgramObject now tracks a per-output color index alongside the location: SetExplicitFragmentOutIndex stores it, it is snapshotted into the linked map at link time (like the location map), and GetFragmentDataIndex returns it (0 by default) for an active output. - glBindFragDataLocation becomes glBindFragDataLocationIndexed with index 0, matching the GL definition, so it also resets a previously-bound index to 0. - Validation: index must be 0 or 1 (GL_INVALID_VALUE); colorNumber is bounded by GL_MAX_DRAW_BUFFERS for index 0 and GL_MAX_DUAL_SOURCE_DRAW_BUFFERS (reported as 1) for index 1 (GL_INVALID_VALUE); a gl_ name is GL_INVALID_OPERATION. - glGetFragDataIndex now returns the real bound index instead of a hardcoded 0. The index is tracked for reflection but is not yet plumbed into dual-source blend rendering, and shader-side layout(index=) qualifiers are not reflected -- both documented at the call sites. Tests: index round-trip through a re-link (bind 1 -> GetFragDataIndex == 1; glBindFragDataLocation resets to 0), plus the validation error table; mutation-verified end to end. ProgramTest 24/24.