Low priority: OpenGL error every frame in missions with a volumetric nebula
I maintainer di solito rispondono entro 2 giorni
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
- cpp
- Ambito
- computer-graphics
Direzione di ricerca
Inizia in code/graphics/opengl/gropengldeferred.cpp al ripristino della texture emissiva dopo il passaggio della nebulosa volumetrica ed esamina le chiamate OpenGL circostanti relative allo stato delle texture. Riproduci il problema con una missione contenente una nebulosa volumetrica in una build di debug, quindi verifica che fs2_open.log non riporti più l’errore GL_INVALID_OPERATION a ogni frame e che il filtro della texture emissiva sia ripristinato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Low priority: nothing looks wrong on screen, it only shows up as an OpenGL error in debug logs. Found while testing another PR.
Problem
On OpenGL, a mission with a volumetric nebula logs GL_INVALID_OPERATION in glBindTexture(target mismatch) about once per frame in a debug build. Missions without a volumetric nebula don't log it, and it goes away with -no_deferred.
After the volumetric nebula draws, the code switches back to the emissive texture with the one-argument GL_state.Texture.Enable(Scene_emissive_texture) (code/graphics/opengl/gropengldeferred.cpp, line 656 on master). That binds to whichever texture unit was active last, which is the unit the nebula's 3D volume texture was just bound to. So OpenGL is asked to bind a 2D texture as a 3D one and refuses. The glTexParameteri on the next line, which is meant to put the emissive texture's filter back to GL_LINEAR, then doesn't reach the emissive texture either.
Steps to reproduce
- Build current master (I used 12a36dc1a, Debug, Linux).
- Use MediaVPs 5.0.2 and a mission with a volumetric nebula. I copied MediaVPs' SM1-01 and added a
+Volumetric Nebula:block usingvolume_noise_sphere.poffrom Beyond the Aftermath 2.2.0 (any volumetric nebula should do). - Run it on OpenGL and fly for a few seconds.
- Open
fs2_open.log.
Expected vs. actual behavior
Expected: no OpenGL errors.
Actual: OpenGL Debug: ... Type:Error ... GL_INVALID_OPERATION in glBindTexture(target mismatch) every frame (19 in the first 5 seconds). A debugger breakpoint on the error puts it in opengl_texture_state::Enable(GLuint) called from gr_opengl_deferred_lighting_finish. Seen on Mesa's software OpenGL; I haven't checked a hardware OpenGL driver.
Proposed fixes
- Name the unit and target on that line:
GL_state.Texture.Enable(1, GL_TEXTURE_2D, Scene_emissive_texture). Unit 1 is where the emissive texture was bound for the nebula pass, so the filter reset after it lands on the right texture. - Set the emissive texture's filter back without depending on which unit is active, for example by binding it explicitly first in its own small helper, so later edits to the nebula pass can't break it again.
- Make the one-argument
Enablecheck that the active unit's target matches the texture it's asked to bind (and complain in debug builds), which would catch this pattern anywhere else in the OpenGL code.
- Lingua principale
- C++
- Stelle
- 488
- Fork
- 184
- Merge medio
- 2g 9h
- PR unite (30g)
- 43
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di scp-fs2open/fs2open.github.com
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
scp-fs2open/fs2open.github.com#7899 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
scp-fs2open/fs2open.github.com#7890 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
scp-fs2open/fs2open.github.com#7900 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
scp-fs2open/fs2open.github.com#7891 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
scp-fs2open/fs2open.github.com#7889 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di scp-fs2open/fs2open.github.com
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
rocketride-org/rocketride-server#2705 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ROCm/rocm-systems#13754 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
neutralinojs/neutralinojs#1861 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
raspberrypi/libpisp#80 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
nanoporetech/pod5-file-format#198 ·