Fix unnecessary buffer reallocation in sculpt mode, causing an assert
Probably did not cause an actual, the assert is a performance warning. Ref T76858
This commit is contained in:
@@ -151,7 +151,10 @@ static bool gpu_pbvh_vert_buf_data_set(GPU_PBVH_Buffers *buffers, uint vert_len)
|
||||
/* Initialize vertex buffer (match 'VertexBufferFormat'). */
|
||||
buffers->vert_buf = GPU_vertbuf_create_with_format_ex(&g_vbo_id.format, GPU_USAGE_STATIC);
|
||||
}
|
||||
GPU_vertbuf_data_alloc(buffers->vert_buf, vert_len);
|
||||
if (buffers->vert_buf->data == NULL || buffers->vert_buf->vertex_len != vert_len) {
|
||||
/* Allocate buffer if not allocated yet or size changed. */
|
||||
GPU_vertbuf_data_alloc(buffers->vert_buf, vert_len);
|
||||
}
|
||||
#endif
|
||||
|
||||
return buffers->vert_buf->data != NULL;
|
||||
|
||||
Reference in New Issue
Block a user