summaryrefslogtreecommitdiff
path: root/src/render/Framebuffer.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-11-24 10:54:21 +0000
committerGitHub <noreply@github.com>2023-11-24 10:54:21 +0000
commit2ebfd0c7456eff7e9c03d379d1dfbc611dc26672 (patch)
tree9fa0d65224283e717ef7a06bb60870a5d319e13e /src/render/Framebuffer.cpp
parente40e486f61f2643578b9977b86f408799dbc75fd (diff)
renderer: Move to a full Hyprland GL rendering pipeline (#3920)
Also updates wlroots
Diffstat (limited to 'src/render/Framebuffer.cpp')
-rw-r--r--src/render/Framebuffer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/render/Framebuffer.cpp b/src/render/Framebuffer.cpp
index 1ebbc585..94b3f64a 100644
--- a/src/render/Framebuffer.cpp
+++ b/src/render/Framebuffer.cpp
@@ -62,6 +62,21 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
return true;
}
+void CFramebuffer::addStencil() {
+ glBindTexture(GL_TEXTURE_2D, m_pStencilTex->m_iTexID);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, m_vSize.x, m_vSize.y, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0);
+
+ glBindFramebuffer(GL_FRAMEBUFFER, m_iFb);
+
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_pStencilTex->m_iTexID, 0);
+
+ auto status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ RASSERT((status == GL_FRAMEBUFFER_COMPLETE), "Failed adding a stencil to fbo!", status);
+
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, g_pHyprOpenGL->m_iCurrentOutputFb);
+}
+
void CFramebuffer::bind() {
#ifndef GLES2
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_iFb);