summaryrefslogtreecommitdiff
path: root/drivers/gles3/rasterizer_gles3.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-24 23:33:25 +0200
committerGitHub <noreply@github.com>2022-05-24 23:33:25 +0200
commita19e02e8d8a44eca900783921f5f859b2c071772 (patch)
tree0946a15be97aeb90e78da2b1adf5d4b0911e406e /drivers/gles3/rasterizer_gles3.cpp
parent7da1c1b9fafee230f6566effd12a86b8a2d89b94 (diff)
parent3e20c1347db323438a76693bb9f7eea87f3a305d (diff)
Merge pull request #61164 from clayjohn/GLES3-2D
Diffstat (limited to 'drivers/gles3/rasterizer_gles3.cpp')
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp10
1 files changed, 2 insertions, 8 deletions
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<Image> &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<Image> &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);