mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.75k stars 439 forks source link

GL/DebugTools: read buffer data on WebGL 2.0 #560

Closed pezcode closed 2 years ago

pezcode commented 2 years ago

This became a bit of a rabbit hole :eyes:

Todos:


Post-merge todos for @mosra:

pezcode commented 2 years ago

The macos-gles3 failure seems to be a broken interaction with MagnumDebugTools and MagnumOpenGLTesterTestLib. I've read the comments about the latter, but it's not entirely clear to me why MagnumDebugTools breaks things.

mosra commented 2 years ago

Okay, seems we're at the cursed issues again. I'll take it from here :D

mosra commented 2 years ago

Ah yes, 2.0.18 doesn't die anymore, but I started hitting #507 now. Curses!

Investigating...

mosra commented 2 years ago

Ah well, and an attempted fix for the macOS global symbol mismatch, where I made MagnumDebugToolsTestLib depend on MagnumGLTestLib causes an ASan complaint due to duplicate symbols now appearing in different places. I suppose I just can't use DebugTools::bufferData() in the GL library tests, then...

pezcode commented 2 years ago

Oh dear, what have I done 🙊 sorry about this mess

mosra commented 2 years ago

All "good" for Emscripten now (see https://github.com/mosra/magnum/issues/507#issuecomment-1126975690 for details).

For the other problem, I managed to "fix" it so now it's not macOS or ASan complaining, but Linux tests failing due to asserts not being graceful anymore. I suppose this is the culprit, gotta fix that properly I guess.

mosra commented 2 years ago

Hm, reshuffled the library order once more and now it seems to work. Although it's a tower of brittle hacks and wishful thinking, hopefully not breaking again anytime soon.

Will merge once I implement the template-removal TODO as well. Tomorrow, enough suffering for a Sunday :skull:

mosra commented 2 years ago

Finally merged a subset of this as 500e41e4a87ae4cecb08afb089e5aea3fbcd887d...4350f1358ac1b6c6d806f3af8bb055923a2368c3, sorry for the extremely long delay. CircleCI macOS builds started also acting up in the meanwhile, further delaying everything.

I ended up deprecating the templated bufferData() API in 0113b34852a42ce2a507dff6c8cd3dec11ccdf3d and then rebased your commits on top of that, as that order made more sense (and allowed me to reduce the deprecated code size quite a bit). Using DebugTools inside GL tests however proved to be too cursed, so I split that off into #565 for now. Will get back to fixing that later.

Thanks for your work!