Skip to content

fix(gl): heap slots readable until their submission; blending on ES 3.0 - #17

Merged
turbo-devv merged 3 commits into
mainfrom
fix/gl-heap-slots-blending
Nov 24, 2026
Merged

turbo-devv merged 3 commits into
mainfrom
fix/gl-heap-slots-blending

Conversation

@turbo-devv

Copy link
Copy Markdown
Contributor

OpenGL fixes found with openOMSI on ANGLE (macOS, OpenGL ES 3.0). They came after #16 was merged.

  • A dropped view's heap slot stays readable until its submission is done. GL replays command buffers at submit, but the slot's entry was cleared when the view dropped. A draw recorded before the drop then bound an empty slot: openOMSI's GPU mip chain (each level rendered from a view of the one above, dropped before the submit) came out black. Reuse was already deferred; now the entry is kept until reclaim too. Test: a_removed_slot_reads_until_reclaimed.
  • Blending works on ES 3.0. glow calls the ES 3.2 names glEnablei / glBlendFuncSeparatei / glColorMaski, which ANGLE's ES 3.0 context refuses, although it has the extension. So blending stayed off, and openOMSI's interface text drew as transparent boxes. Pipelines whose targets blend alike (nearly all) now use the plain calls. Others use OES_draw_buffers_indexed's own entry points, loaded through EGL (IndexedOes), on ES 3.0 and 3.1, and the core ones elsewhere. Clears set the colour mask for all buffers.

Checked: cargo test -p mx-gl; openOMSI's renderer GPU tests on ANGLE go from 48 to 50 of 90 (the smoke puffs and the LED glow mask); openOMSI's headless_mx interface picture matches Metal on ANGLE.

…on is done

GL replays command buffers at submission, so the entry was gone when a draw recorded
before the drop bound it: openOMSI's GPU mip chain (each level from a view of the one
above, dropped before the submit) read empty slots and left the levels black.
…e where they agree

glEnablei / glBlendFunci / glColorMaski are GL 4.0 and ES 3.2; on ES 3.0 (ANGLE on macOS)
they failed and left blending off, so an interface's text punched transparent holes in the
picture under it. Pipelines whose targets blend alike (nearly all) now use the plain calls;
the per-buffer ones only where the context has them (indexed_draw_buffers).
…n ES 3.0 and 3.1

glow loads only glEnablei / glBlendFuncSeparatei / glColorMaski, which ANGLE's ES 3.0
context refuses although it has the extension: pipelines whose targets blend differently
(openOMSI's enhanced pass with its screen mask) now call the OES entry points there.
turbo-devv added a commit to openOMSI-org/openOMSI that referenced this pull request Nov 24, 2026
* perf(render-mx): the temporal motion group read from the heap

The motion vectors' uniform and the last frame's model places are read at the scene
shader's lights and grid places, which the motion pipelines do not otherwise read
(MotionHeap); no group 3 for them.

* build(mx): pin mX aca1cb9 (MS depth, storage textures and acceleration structures in the heap; openOMSI-org/mX#16)

* perf(render-mx): the last bind groups go: ray tracing and the multisampled pane depth through the heap

- groups_to_heap reads storage textures (one heap array a format, mX's bindings 12-15),
  acceleration structures (mx_tlas, binding 11), multisampled depth (mx_texdepth_ms) and
  writable buffers (read-write typed views; HeapGroup makes writable views for them), and
  keeps a module's enable directives first.
- The ray tracing's modules (lighting, texture means, coordinates, reflections, denoiser)
  read everything from the heap (RT_LIGHTING, RT_AVG, RT_UV, RT_REFLECT, RT_DENOISE).
- The masked prefill reads the panes' multisampled depth at the frame's ground place.
- every_module_in_the_heap_validates covers the ray tracing and the scene shader.

* build(mx): pin mX 8118158 (GL heap slots stay readable until their submission is done)

* build(mx): pin mX a78aa1a (OpenGL ES 3.0 blends: no per-buffer calls where the targets agree)

* perf(ui-mx, xr-mx): the interface and the headset's mirror read their pictures from the heap

A layer's numbers and the picture's and sampler's places are a draw's 128 bytes of
immediates; the per-layer uniform buffer and the bind groups go. No bind groups are left in
openOMSI's mX crates.

* docs(mx): no bind groups left; the GL fixes

* build(mx): pin mX eaa7aa1 (per-buffer blending through OES_draw_buffers_indexed on ES 3.0)

* build(mx): pin mX c447f0b (openOMSI-org/mX#17: the GL fixes on top of main)
@turbo-devv
turbo-devv merged commit 6c4437a into main Nov 24, 2026
4 checks passed
turbo-devv added a commit to turbo-devv/openOMSI-fork that referenced this pull request Nov 24, 2026
turbo-devv added a commit to openOMSI-org/openOMSI that referenced this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant