Skip to content

Commit

Permalink
Merge pull request #74945 from ChibiDenDen/patch-3
Browse files Browse the repository at this point in the history
Fix gles3 rendering on android studio emulator
  • Loading branch information
akien-mga committed May 8, 2023
2 parents 7f6b283 + 5956aa1 commit e370b35
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,13 @@ void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, Display
}

GLuint read_fbo = 0;
glGenFramebuffers(1, &read_fbo);
glBindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo);

if (rt->view_count > 1) {
glGenFramebuffers(1, &read_fbo);
glBindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo);
glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, rt->color, 0, p_layer);
} else {
glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->fbo);
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0);
}

glReadBuffer(GL_COLOR_ATTACHMENT0);
Expand Down

0 comments on commit e370b35

Please sign in to comment.