summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2020-02-21 08:51:57 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2020-09-13 16:15:46 +0800
commit38147da8198162d1a48775dfd9da6cff598d557a (patch)
tree44bfc01f4a1b752c0192469c68ad409d12f6022a /servers/rendering
parent43725691b917a76151f74a82c4be016ce9838f8a (diff)
Fixes crash when saving scene
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
index 9e3335b05b..a13e7d786b 100644
--- a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -3208,9 +3208,9 @@ Vector<float> RasterizerStorageRD::multimesh_get_buffer(RID p_multimesh) const {
Vector<uint8_t> buffer = RD::get_singleton()->buffer_get_data(multimesh->buffer);
Vector<float> ret;
- ret.resize(multimesh->instances);
+ ret.resize(multimesh->instances * multimesh->stride_cache);
{
- float *w = multimesh->data_cache.ptrw();
+ float *w = ret.ptrw();
const uint8_t *r = buffer.ptr();
copymem(w, r, buffer.size());
}