3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2026-03-01 04:48:25 +00:00

core: drop the legacy renderer (#10408)

* core: drop the legacy renderer

the legacy renderer is broken and barely used, drop it.

* Nix: drop support for legacyRenderer

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
This commit is contained in:
Tom Englund
2025-05-15 11:13:24 +02:00
committed by GitHub
parent f707d86912
commit 5ceb0ec15d
20 changed files with 50 additions and 270 deletions

View File

@ -40,14 +40,11 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
glBindFramebuffer(GL_FRAMEBUFFER, m_fb);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_tex->m_texID, 0);
// TODO: Allow this with gles2
#ifndef GLES2
if (m_stencilTex) {
glBindTexture(GL_TEXTURE_2D, m_stencilTex->m_texID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, w, h, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_stencilTex->m_texID, 0);
}
#endif
auto status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
RASSERT((status == GL_FRAMEBUFFER_COMPLETE), "Framebuffer incomplete, couldn't create! (FB status: {}, GL Error: 0x{:x})", status, (int)glGetError());
@ -64,8 +61,6 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
}
void CFramebuffer::addStencil(SP<CTexture> tex) {
// TODO: Allow this with gles2
#ifndef GLES2
m_stencilTex = tex;
glBindTexture(GL_TEXTURE_2D, m_stencilTex->m_texID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, m_size.x, m_size.y, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, nullptr);
@ -79,15 +74,10 @@ void CFramebuffer::addStencil(SP<CTexture> tex) {
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif
}
void CFramebuffer::bind() {
#ifndef GLES2
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fb);
#else
glBindFramebuffer(GL_FRAMEBUFFER, m_iFb);
#endif
if (g_pHyprOpenGL)
glViewport(0, 0, g_pHyprOpenGL->m_renderData.pMonitor->m_pixelSize.x, g_pHyprOpenGL->m_renderData.pMonitor->m_pixelSize.y);
@ -96,11 +86,7 @@ void CFramebuffer::bind() {
}
void CFramebuffer::unbind() {
#ifndef GLES2
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
#else
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif
}
void CFramebuffer::release() {