From 6e6569aa784ac81384330a6c62605f05be9edec3 Mon Sep 17 00:00:00 2001 From: LinuxUserGD Date: Mon, 25 Jul 2022 17:14:33 +0200 Subject: fix 'Comparison result is always the same' warnings --- drivers/gles3/rasterizer_canvas_gles3.cpp | 6 ++---- drivers/gles3/storage/material_storage.cpp | 24 ------------------------ 2 files changed, 2 insertions(+), 28 deletions(-) (limited to 'drivers/gles3') diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index abbc11847f..d4ac3c993a 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -815,10 +815,8 @@ void RasterizerCanvasGLES3::_render_item(RID p_render_target, const Item *p_item _bind_canvas_texture(texture, current_filter, current_repeat, r_index); if (instance_count == 1) { GLES3::MaterialStorage::get_singleton()->shaders.canvas_shader.version_bind_shader(state.current_shader_version, CanvasShaderGLES3::MODE_ATTRIBUTES); - } else if (instance_count > 1) { - GLES3::MaterialStorage::get_singleton()->shaders.canvas_shader.version_bind_shader(state.current_shader_version, CanvasShaderGLES3::MODE_INSTANCED); } else { - ERR_PRINT("Must have at least one mesh instance to draw mesh"); + GLES3::MaterialStorage::get_singleton()->shaders.canvas_shader.version_bind_shader(state.current_shader_version, CanvasShaderGLES3::MODE_INSTANCED); } uint32_t surf_count = mesh_storage->mesh_get_surface_count(mesh); @@ -882,7 +880,7 @@ void RasterizerCanvasGLES3::_render_item(RID p_render_target, const Item *p_item } else { glDrawArrays(primitive_gl, 0, mesh_storage->mesh_surface_get_vertices_drawn_count(surface)); } - } else if (instance_count > 1) { + } else { if (use_index_buffer) { glDrawElementsInstanced(primitive_gl, mesh_storage->mesh_surface_get_vertices_drawn_count(surface), mesh_storage->mesh_surface_get_index_type(surface), 0, instance_count); } else { diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 117481faf5..68045930b0 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -180,10 +180,6 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy if (p_array_size > 0) { Vector iv = value; int s = iv.size(); - - if (p_array_size <= 0) { - p_array_size = 1; - } int count = 2 * p_array_size; const int *r = iv.ptr(); @@ -210,10 +206,6 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy if (p_array_size > 0) { Vector iv = value; int s = iv.size(); - - if (p_array_size <= 0) { - p_array_size = 1; - } int count = 3 * p_array_size; const int *r = iv.ptr(); @@ -242,10 +234,6 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy if (p_array_size > 0) { Vector iv = value; int s = iv.size(); - - if (p_array_size <= 0) { - p_array_size = 1; - } int count = 4 * p_array_size; const int *r = iv.ptr(); @@ -298,10 +286,6 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy if (p_array_size > 0) { Vector iv = value; int s = iv.size(); - - if (p_array_size <= 0) { - p_array_size = 1; - } int count = 2 * p_array_size; const int *r = iv.ptr(); @@ -328,10 +312,6 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy if (p_array_size > 0) { Vector iv = value; int s = iv.size(); - - if (p_array_size <= 0) { - p_array_size = 1; - } int count = 3 * p_array_size; const int *r = iv.ptr(); @@ -360,10 +340,6 @@ _FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataTy if (p_array_size > 0) { Vector iv = value; int s = iv.size(); - - if (p_array_size <= 0) { - p_array_size = 1; - } int count = 4 * p_array_size; const int *r = iv.ptr(); -- cgit v1.2.3