Fix multimesh buffer overflow in RendererStorageRD
This commit is contained in:
parent
d6f972fad4
commit
6b04f08b28
@ -4419,7 +4419,8 @@ void RendererStorageRD::_update_dirty_multimeshes() {
|
||||
if (multimesh->data_cache_dirty_regions[i]) {
|
||||
uint32_t offset = i * region_size;
|
||||
uint32_t size = multimesh->stride_cache * (uint32_t)multimesh->instances * (uint32_t)sizeof(float);
|
||||
RD::get_singleton()->buffer_update(multimesh->buffer, offset, MIN(region_size, size - offset), &data[i * region_size]);
|
||||
uint32_t region_start_index = multimesh->stride_cache * MULTIMESH_DIRTY_REGION_SIZE * i;
|
||||
RD::get_singleton()->buffer_update(multimesh->buffer, offset, MIN(region_size, size - offset), &data[region_start_index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user