From d7cc9787d7ded36e677139cf0ec43b3888291501 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 7 Jul 2021 23:05:04 +0200 Subject: [PATCH] blitter: remove useless duplications and simplify handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/125 Signed-off-by: Gert Wollny Reviewed-by: Corentin Noël . --- src/vrend_blitter.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/vrend_blitter.c b/src/vrend_blitter.c index 188d1c9..aecec16 100644 --- a/src/vrend_blitter.c +++ b/src/vrend_blitter.c @@ -698,8 +698,6 @@ void vrend_renderer_blit_gl(ASSERTED struct vrend_context *ctx, const struct vrend_blit_info *info) { struct vrend_blitter_ctx *blit_ctx = &vrend_blit_ctx; - GLuint buffers; - GLuint prog_id; GLuint fs_id; int dst_z; @@ -717,7 +715,7 @@ void vrend_renderer_blit_gl(ASSERTED struct vrend_context *ctx, vrend_renderer_init_blit_ctx(blit_ctx); blitter_set_points(blit_ctx, &info->b, src_res, dst_res, &src0, &src1); - prog_id = glCreateProgram(); + GLuint prog_id = glCreateProgram(); glAttachShader(prog_id, blit_ctx->vs); if (blit_depth) { @@ -741,7 +739,7 @@ void vrend_renderer_blit_gl(ASSERTED struct vrend_context *ctx, glBindFramebuffer(GL_FRAMEBUFFER, blit_ctx->fb_id); vrend_fb_bind_texture_id(dst_res, info->dst_view, 0, info->b.dst.level, info->b.dst.box.z, 0); - buffers = GL_COLOR_ATTACHMENT0; + GLuint buffers = GL_COLOR_ATTACHMENT0; glDrawBuffers(1, &buffers); glBindTexture(src_res->target, info->src_view); @@ -778,11 +776,8 @@ void vrend_renderer_blit_gl(ASSERTED struct vrend_context *ctx, dst_res->target == GL_TEXTURE_1D_ARRAY || dst_res->target == GL_TEXTURE_2D_ARRAY) ? info->b.dst.box.z : dst_z; - glBindFramebuffer(GL_FRAMEBUFFER, blit_ctx->fb_id); vrend_fb_bind_texture_id(dst_res, info->dst_view, 0, info->b.dst.level, layer, 0); - buffers = GL_COLOR_ATTACHMENT0; - glDrawBuffers(1, &buffers); blitter_set_texcoords(blit_ctx, src_res, info->b.src.level, info->b.src.box.z + src_z, 0, src0.x, src0.y, src1.x, src1.y);