Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Hierarchical culling: Add extra check to skeleton_attach_canvas_item #80325

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3780,6 +3780,13 @@ void RasterizerStorageGLES2::skeleton_attach_canvas_item(RID p_skeleton, RID p_c
ERR_FAIL_COND(!p_canvas_item.is_valid());

if (p_attach) {
#ifdef DEV_ENABLED
// skeleton_attach_canvas_item() is not bound,
// and checks in canvas_item_attach_skeleton() should prevent this,
// but there isn't much harm in a DEV_ENABLED check here.
int64_t found = skeleton->linked_canvas_items.find(p_canvas_item);
ERR_FAIL_COND(found != -1);
#endif
skeleton->linked_canvas_items.push_back(p_canvas_item);
} else {
int64_t found = skeleton->linked_canvas_items.find(p_canvas_item);
Expand Down
7 changes: 7 additions & 0 deletions drivers/gles3/rasterizer_storage_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5322,6 +5322,13 @@ void RasterizerStorageGLES3::skeleton_attach_canvas_item(RID p_skeleton, RID p_c
ERR_FAIL_COND(!p_canvas_item.is_valid());

if (p_attach) {
#ifdef DEV_ENABLED
// skeleton_attach_canvas_item() is not bound,
// and checks in canvas_item_attach_skeleton() should prevent this,
// but there isn't much harm in a DEV_ENABLED check here.
int64_t found = skeleton->linked_canvas_items.find(p_canvas_item);
ERR_FAIL_COND(found != -1);
#endif
skeleton->linked_canvas_items.push_back(p_canvas_item);
} else {
int64_t found = skeleton->linked_canvas_items.find(p_canvas_item);
Expand Down