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

Fix crash on trimesh_create #34794

Merged
merged 1 commit into from
Jan 3, 2020
Merged
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
16 changes: 2 additions & 14 deletions drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2435,22 +2435,10 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS:
if (surface->blend_shape_data.size()) {
ERR_PRINT_ONCE("Blend shapes are not supported in OpenGL ES 2.0");
}
surface->data = array;
surface->index_data = p_index_array;
#else
// Even on non-tools builds, a copy of the surface->data is needed in certain circumstances.
// Rigged meshes using the USE_SKELETON_SOFTWARE path need to read bone data
// from surface->data.

// if USE_SKELETON_SOFTWARE is active
if (config.use_skeleton_software) {
// if this geometry is used specifically for skinning
if (p_format & (VS::ARRAY_FORMAT_BONES | VS::ARRAY_FORMAT_WEIGHTS))
surface->data = array;
}
// An alternative is to always make a copy of surface->data.
#endif

surface->data = array;
surface->index_data = p_index_array;
surface->total_data_size += surface->array_byte_size + surface->index_array_byte_size;

for (int i = 0; i < surface->skeleton_bone_used.size(); i++) {
Expand Down