From 3e20c1347db323438a76693bb9f7eea87f3a305d Mon Sep 17 00:00:00 2001 From: clayjohn Date: Wed, 18 May 2022 08:04:41 -0700 Subject: Add clipping, backbuffer, and CanvasGroups to 2D GLES3 renderer As well as significant consequent cleanup in the RenderTarget, Texture, and Canvas renderer code --- drivers/gles3/rasterizer_gles3.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'drivers/gles3/rasterizer_gles3.cpp') diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 69f69099c7..c8705dc8c8 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -268,6 +268,7 @@ RasterizerGLES3::RasterizerGLES3() { mesh_storage = memnew(GLES3::MeshStorage); particles_storage = memnew(GLES3::ParticlesStorage); light_storage = memnew(GLES3::LightStorage); + copy_effects = memnew(GLES3::CopyEffects); storage = memnew(RasterizerStorageGLES3); canvas = memnew(RasterizerCanvasGLES3(storage)); scene = memnew(RasterizerSceneGLES3(storage)); @@ -281,7 +282,6 @@ void RasterizerGLES3::prepare_for_blitting_render_targets() { void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, DisplayServer::WindowID p_screen, const Rect2 &p_screen_rect) { GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); - ERR_FAIL_COND(texture_storage->frame.current_rt); GLES3::RenderTarget *rt = texture_storage->get_render_target(p_render_target); ERR_FAIL_COND(!rt); @@ -304,12 +304,9 @@ void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, Display // is this p_screen useless in a multi window environment? void RasterizerGLES3::blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const BlitToScreen *p_render_targets, int p_amount) { - // do this once off for all blits - GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + // All blits are going to the system framebuffer, so just bind once. glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo); - texture_storage->frame.current_rt = nullptr; - for (int i = 0; i < p_amount; i++) { const BlitToScreen &blit = p_render_targets[i]; @@ -339,8 +336,6 @@ void RasterizerGLES3::set_boot_image(const Ref &p_image, const Color &p_c } glClear(GL_COLOR_BUFFER_BIT); - canvas->canvas_begin(); - RID texture = texture_storage->texture_allocate(); texture_storage->texture_2d_initialize(texture, p_image); @@ -368,7 +363,6 @@ void RasterizerGLES3::set_boot_image(const Ref &p_image, const Color &p_c glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 1); glBindTexture(GL_TEXTURE_2D, t->tex_id); glBindTexture(GL_TEXTURE_2D, 0); - canvas->canvas_end(); texture_storage->texture_free(texture); -- cgit v1.2.3