From 0b7a5b84255a53138b3a092175de7b6b9f32b058 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Fri, 19 Dec 2014 13:08:48 +0800 Subject: Fix RasterizerGLES2::canvas_draw_polygon can't work correct at some devices(like Sumsung Note2) in some devices, gpu doe's not support uint(32bit) indies --- drivers/gles2/rasterizer_gles2.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 9f2fd032fa..79d163b019 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -8142,7 +8142,14 @@ void RasterizerGLES2::canvas_draw_polygon(int p_vertex_count, const int* p_indic if (p_indices) { - glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_INT, p_indices ); + static const int _max_draw_poly_indices = 8*1024; // change this size if needed!!! + ERR_FAIL_COND(p_vertex_count > _max_draw_poly_indices); + static uint16_t _draw_poly_indices[_max_draw_poly_indices]; + for (int i=0; i