From 55fc56bfd4161cbb03818e235220cb72e9373b34 Mon Sep 17 00:00:00 2001 From: Brecht Kuppens Date: Thu, 22 Jun 2023 23:01:09 +0200 Subject: [PATCH] Moved variables closer to usage to fix unused variable warning --- drivers/gles3/rasterizer_scene_gles3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 6ed5b3b2f80..e6e7dd6f171 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2063,8 +2063,6 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, GLES3::MeshStorage *mesh_storage = GLES3::MeshStorage::get_singleton(); GLES3::ParticlesStorage *particles_storage = GLES3::ParticlesStorage::get_singleton(); GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton(); - GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); - GLES3::Config *config = GLES3::Config::get_singleton(); GLuint prev_vertex_array_gl = 0; GLuint prev_index_array_gl = 0; @@ -2097,6 +2095,8 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, } if constexpr (p_pass_mode == PASS_MODE_COLOR || p_pass_mode == PASS_MODE_COLOR_TRANSPARENT) { + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + GLES3::Config *config = GLES3::Config::get_singleton(); glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 2); GLuint texture_to_bind = texture_storage->get_texture(texture_storage->texture_gl_get_default(GLES3::DEFAULT_GL_TEXTURE_CUBEMAP_BLACK))->tex_id; if (p_render_data->environment.is_valid()) {