Voxy leaves GL_PARAMETER_BUFFER bound: Flywheel indirect draws render nothing on AMD

Aperta Adatta ai principianti
#765 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Inizia in MDICSectionRenderer, dove viewport.drawCountCallBuffer è associato a GL_PARAMETER_BUFFER_ARB per i draw con conteggio indiretto, poi leggi il blocco 'Reset state manager stuffs' alla fine di VoxyRenderSystem.renderOpaque. La correzione minima è scollegare il buffer dei parametri dopo quei draw o in quel blocco di reset. Fatto significa che le parti del backend Indirect di Flywheel sono visibili vicino alla camera con Voxy abilitato e che Voxy non lascia alcun binding del buffer dei parametri.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Symptoms (vith Voxy 0.2.20-beta)

With Voxy rendering enabled, every Create part drawn by Flywheel (shafts, cogs, water wheels, gantry shafts, rotors) is invisible near the camera. The parts show up again past a certain distance.
• Turning Voxy rendering off brings them back at once.
• Switching Flywheel to its Instancing backend also brings them back, at a performance cost with many machines.
• It happens without shaders (flywheel:indirect) and with Iris and a shader pack (colorwheel:indirect).
• It happens on every frame: unbinding the buffer below shows the parts, and they vanish again as soon as it stays bound.

Root cause

MDICSectionRenderer binds viewport.drawCountCallBuffer to GL_PARAMETER_BUFFER_ARB for its glMultiDrawElementsIndirectCountARB calls and never unbinds it. The end-of-render reset in VoxyRenderSystem.renderOpaque does not cover that target either.

Later in the frame, Flywheel's Indirect backend draws with glMultiDrawElementsIndirect, the variant without a count buffer. By the spec it should ignore GL_PARAMETER_BUFFER, but on radeonsi those draws render nothing while Voxy's buffer stays bound. It looks like a Mesa quirk, yet Voxy can avoid it with one call.

It was isolated in game with switches that each reset one piece of state right after Voxy rendered:

Reset after Voxy's render
Parts visible?
GL_PARAMETER_BUFFER unbound
Yes
GL_DRAW_INDIRECT_BUFFER and GL_DISPATCH_INDIRECT_BUFFER unbound
No
Generic array, copy, uniform and storage bindings unbound
No
Image units 0 to 7 unbound
No
Program and VAO reset through GlStateManager
No
Full memory barrier and texture barrier
No
Voxy's LOD depth not written to the main depth buffer
No

Fix

Unbind GL_PARAMETER_BUFFER once Voxy has drawn. Upstream, the natural place is the "Reset state manager stuffs" block at the end of VoxyRenderSystem.renderOpaque. Unbinding right after each glMultiDrawElementsIndirectCountARB in MDICSectionRenderer works too.

Lingua principale
Java
Stelle
1.4k
Fork
1.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MCRcortex/voxy

Tutte le issue di MCRcortex/voxy

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.