Closed adamkewley closed 7 months ago
This bug has been in OSC for a couple of years now so it's non-fatal and non-blocking, but I'm documenting it here as something that is also related to the fact that ImGui is using a separate rendering backend from OSC (osc uses oscar
's renderer whereas ImGui uses its own one that's packaged with ImGui).
The "hollistic" approach here is to write an oscar
backend to ImGui
, so that all GPU interactions go through one managed graphics API.
This is now fixed because OSC now uses its own ImGui backend, which includes lifetime management for any submitted texture handles.
Debugging OpenGL via WSL2 with this repro:
About > Debug Mode
)Error message:
The reason that this happens is because ImGui's texture renderer does not manage the lifetime of the texture. So the sequence of events is something like:
No
in the save dialogosc::Tab
is destructed, killing the textureThe solution is to either:
osc::Texture2D
s andosc::RenderTexture
s stored in a datastructure that sits next to ImGui, and isclear
ed only after ImGui draws its render queueosc::Tab
after ImGui has flushed its internal render queue