summaryrefslogtreecommitdiff
path: root/src/render/Framebuffer.hpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-02-08 01:46:26 +0100
committerGitHub <noreply@github.com>2025-02-08 01:46:26 +0100
commitf7fcbe32c9f66bcfc86853a5cda95edcf481f573 (patch)
treec3e352ff73a41995159adb13ed0c900ad789d01f /src/render/Framebuffer.hpp
parenta724332eb82c33308a8cb6127172f128e3afe14c (diff)
renderer: various fixes towards improving gpu calls robustness (#9188)
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.
Diffstat (limited to 'src/render/Framebuffer.hpp')
-rw-r--r--src/render/Framebuffer.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/render/Framebuffer.hpp b/src/render/Framebuffer.hpp
index 84dfeef1..092e548e 100644
--- a/src/render/Framebuffer.hpp
+++ b/src/render/Framebuffer.hpp
@@ -11,6 +11,7 @@ class CFramebuffer {
bool alloc(int w, int h, uint32_t format = GL_RGBA);
void addStencil(SP<CTexture> tex);
void bind();
+ void unbind();
void release();
void reset();
bool isAllocated();
@@ -28,4 +29,4 @@ class CFramebuffer {
SP<CTexture> m_pStencilTex;
friend class CRenderbuffer;
-}; \ No newline at end of file
+};