summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/storage_rd
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2022-11-18 16:12:48 -0800
committerclayjohn <claynjohn@gmail.com>2022-11-18 23:36:40 -0800
commit0e5a98cdd833dbaeefaf3c640b0f1e3ef535e523 (patch)
treed4b0fd5de8c78de9c89cf7e1288f77a7c2bceaf2 /servers/rendering/renderer_rd/storage_rd
parentc9c09ad608754a9025ca227358fca5a02553f2cb (diff)
Fix drawing of 2D skeletons in the RD renderer.
Also clean up skeleton code in preparation for adding them to GLES3 Properly update Mesh2D AABBs when skeleton is updated
Diffstat (limited to 'servers/rendering/renderer_rd/storage_rd')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp3
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 1e74d31383..adb882986f 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -616,7 +616,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
Skeleton *skeleton = skeleton_owner.get_or_null(p_skeleton);
- if (!skeleton || skeleton->size == 0) {
+ if (!skeleton || skeleton->size == 0 || mesh->skeleton_aabb_version == skeleton->version) {
return mesh->aabb;
}
@@ -708,6 +708,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
}
}
+ mesh->skeleton_aabb_version = skeleton->version;
return aabb;
}
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
index 6a7400631d..4765475804 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
@@ -144,6 +144,7 @@ private:
AABB aabb;
AABB custom_aabb;
+ uint64_t skeleton_aabb_version = 0;
Vector<RID> material_cache;