From 5acb21dd7bfc2800f469b03814853501076b6ace Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sun, 18 Aug 2019 21:50:33 -0700 Subject: [PATCH] check if skeleton texture is already allocated before reallocating (cherry picked from commit 99de3906ba1a42f1279634bc23258ce39828c5f6) --- drivers/gles2/rasterizer_storage_gles2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index bbae657cefb..1cf5c119345 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -3466,6 +3466,8 @@ RID RasterizerStorageGLES2::skeleton_create() { Skeleton *skeleton = memnew(Skeleton); + glGenTextures(1, &skeleton->tex_id); + return skeleton_owner.make_rid(skeleton); } @@ -3483,7 +3485,6 @@ void RasterizerStorageGLES2::skeleton_allocate(RID p_skeleton, int p_bones, bool skeleton->use_2d = p_2d_skeleton; if (config.float_texture_supported) { - glGenTextures(1, &skeleton->tex_id); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, skeleton->tex_id);