summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2019-08-18 21:50:33 -0700
committerclayjohn <claynjohn@gmail.com>2019-08-18 22:02:57 -0700
commit99de3906ba1a42f1279634bc23258ce39828c5f6 (patch)
treeaa5c91f452c32a0477e7bd633d522158b88dad3e /drivers/gles2
parent86371b7298e32356c8ce892f768c56bec7088292 (diff)
check if skeleton texture is already allocated before reallocating
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index fd856e5fd7..8e026b96ce 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -3496,6 +3496,8 @@ RID RasterizerStorageGLES2::skeleton_create() {
Skeleton *skeleton = memnew(Skeleton);
+ glGenTextures(1, &skeleton->tex_id);
+
return skeleton_owner.make_rid(skeleton);
}
@@ -3513,7 +3515,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);