From ce97ddbcb125228cc88fbfdcae932e110ee7daee Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 27 Sep 2021 01:07:10 +0200 Subject: Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3 - Use lowercase driver names for the `--rendering-driver` command line argument. --- .../renderer_rd/forward_clustered/render_forward_clustered.cpp | 2 +- .../renderer_rd/forward_mobile/render_forward_mobile.cpp | 2 +- servers/rendering/renderer_viewport.cpp | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'servers/rendering') diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index 0f5af96417..ce3620b2d0 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -2722,7 +2722,7 @@ void RenderForwardClustered::_geometry_instance_update(GeometryInstance *p_geome } break; #if 0 case RS::INSTANCE_IMMEDIATE: { - RasterizerStorageGLES3::Immediate *immediate = storage->immediate_owner.get_or_null(inst->base); + RasterizerStorageOpenGL::Immediate *immediate = storage->immediate_owner.get_or_null(inst->base); ERR_CONTINUE(!immediate); _add_geometry(immediate, inst, nullptr, -1, p_depth_pass, p_shadow_pass); diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index 95f5b46831..7716705666 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -2440,7 +2440,7 @@ void RenderForwardMobile::_geometry_instance_update(GeometryInstance *p_geometry } break; #if 0 case RS::INSTANCE_IMMEDIATE: { - RasterizerStorageGLES3::Immediate *immediate = storage->immediate_owner.get_or_null(inst->base); + RasterizerStorageOpenGL::Immediate *immediate = storage->immediate_owner.get_or_null(inst->base); ERR_CONTINUE(!immediate); _add_geometry(immediate, inst, nullptr, -1, p_depth_pass, p_shadow_pass); diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index f312c2501f..723c5ada3f 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -129,8 +129,10 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport) { timestamp_vp_map[rt_id] = p_viewport->self; } - // This is currently needed for GLES to keep the current window being rendered to up to date - DisplayServer::get_singleton()->gl_window_make_current(p_viewport->viewport_to_screen); + if (OS::get_singleton()->get_current_rendering_driver_name() == "opengl") { + // This is currently needed for GLES to keep the current window being rendered to up to date + DisplayServer::get_singleton()->gl_window_make_current(p_viewport->viewport_to_screen); + } /* Camera should always be BEFORE any other 3D */ @@ -750,7 +752,7 @@ void RendererViewport::viewport_attach_to_screen(RID p_viewport, const Rect2 &p_ ERR_FAIL_COND(!viewport); if (p_screen != DisplayServer::INVALID_WINDOW_ID) { - // If using GLES2 we can optimize this operation by rendering directly to system_fbo + // If using OpenGL we can optimize this operation by rendering directly to system_fbo // instead of rendering to fbo and copying to system_fbo after if (RSG::rasterizer->is_low_end() && viewport->viewport_render_direct_to_screen) { RSG::storage->render_target_set_size(viewport->render_target, p_rect.size.x, p_rect.size.y, viewport->get_view_count()); -- cgit v1.2.3