Move framebuffer blit mapping to renderer gl

This commit is contained in:
2026-06-02 06:25:14 +02:00
parent 36fea6b870
commit 9ce49ef19c
6 changed files with 55 additions and 16 deletions

View File

@@ -85,7 +85,17 @@ bool RTT::resize(int width, int height)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, new_rtt.fboID);
glBindFramebuffer(GL_READ_FRAMEBUFFER, fboID);
glBlitFramebuffer(0, 0, w, h, 0, 0, new_rtt.w, new_rtt.h, GL_COLOR_BUFFER_BIT, GL_LINEAR);
glBlitFramebuffer(
0,
0,
w,
h,
0,
0,
new_rtt.w,
new_rtt.h,
static_cast<GLbitfield>(pp::renderer::gl::framebuffer_color_buffer_mask()),
static_cast<GLenum>(pp::renderer::gl::framebuffer_blit_filter(true)));
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, oldDFboID);
glBindFramebuffer(GL_READ_FRAMEBUFFER, oldRFboID);
@@ -147,7 +157,8 @@ void RTT::copy(const RTT & source)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fboID);
glBindFramebuffer(GL_READ_FRAMEBUFFER, source.fboID);
glBlitFramebuffer(0, 0, source.w, source.h, 0, 0, w, h,
GL_COLOR_BUFFER_BIT, GL_LINEAR);
static_cast<GLbitfield>(pp::renderer::gl::framebuffer_color_buffer_mask()),
static_cast<GLenum>(pp::renderer::gl::framebuffer_blit_filter(true)));
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, old_draw);
glBindFramebuffer(GL_READ_FRAMEBUFFER, old_read);
@@ -170,7 +181,8 @@ void RTT::copy(const RTT& source, const glm::vec4& rect)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fboID);
glBindFramebuffer(GL_READ_FRAMEBUFFER, source.fboID);
glBlitFramebuffer(r.x, r.y, r.z, r.w, r.x, r.y, r.z, r.w,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
static_cast<GLbitfield>(pp::renderer::gl::framebuffer_color_buffer_mask()),
static_cast<GLenum>(pp::renderer::gl::framebuffer_blit_filter(false)));
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, old_draw);
glBindFramebuffer(GL_READ_FRAMEBUFFER, old_read);