Skip to content

Commit bb785cf

Browse files
ChibiDenDenakien-mga
authored andcommitted
Fix gles3 rendering on android studio emulator
Use a temporary framebuffer for screen copy from rendertarget to screen. This solves GLES3 rendering in android studio emulator (before this change there is just a black screen) Based on discussion in: godotengine#74828 (cherry picked from commit 5956aa1)
1 parent cf0bd38 commit bb785cf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gles3/rasterizer_gles3.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,13 @@ void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, Display
300300
}
301301

302302
GLuint read_fbo = 0;
303+
glGenFramebuffers(1, &read_fbo);
304+
glBindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo);
305+
303306
if (rt->view_count > 1) {
304-
glGenFramebuffers(1, &read_fbo);
305-
glBindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo);
306307
glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, rt->color, 0, p_layer);
307308
} else {
308-
glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->fbo);
309+
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0);
309310
}
310311

311312
glReadBuffer(GL_COLOR_ATTACHMENT0);

0 commit comments

Comments
 (0)