* framebuffer: dont release if format or size changes
we dont have to release and recreate both the texture and framebuffer if
size or format changes, we can just bind the texture and call glTexImage2D
with the new format and size.
* framebuffer: set the alloced viewport size
if monitor size mismatch with the allocated m_size its going to set a
mismatched viewport and cause rendering issues. and if they are
mismatching there is a missing alloc call.
* renderbuffer: cleanup unneded binds
the renderbuffer is attached to the fbo and trying to rebind it in
bind() is causing unnecessery state changes, just bind the fbo.
add safeguard in the destructor, the constructor can return early on
failure and leave m_rbo empty or m_image as EGL_NO_IMAGE_KHR.
ensure framebuffer textures are detached and deleted, avoid leaving framebuffers bound when not needed
* render: avoid calling glDeleteProgram on no program
its safe to do so but it adds a bunch of unnecessery lines in apitrace
when tracing. if guard it and return early.
* opengl: ensure texture and buffers are unbound
ensure bound buffers are unbound after use, also detach textures from
framebuffer before deleting it otherwise it will become dangling and
essentially leak.
after commit 4b4971c it uses m_iFbAllocated and deletes if upon calling
release() but Renderbuffer generates directly on m_iFb without calling
alloc() meaning it wont be deleted on release(), set m_iFbAllocated to
true after generating the buffer.
* watchdog: dont detach and cause race condition
instead of detaching and causing a race condition on destruction where
the thread is alive and watchdog has been destroyed, check if its
joinable and join it on destruction.
causes heap use after free on exit of compositor.
* render: add checks for compositor shutting down
avoid member call on null pointer, if the g_pHyprRenderer is destroyed
we can call the member makeEGLCurrent on it, causes undefined behaviour
on destruction of the compositor/hyprrenderer.
found with ubsan.