summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/storage
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/storage')
-rw-r--r--drivers/gles3/storage/mesh_storage.cpp19
-rw-r--r--drivers/gles3/storage/texture_storage.cpp2
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp
index e073db3cfd..d8a5b960b8 100644
--- a/drivers/gles3/storage/mesh_storage.cpp
+++ b/drivers/gles3/storage/mesh_storage.cpp
@@ -1936,6 +1936,11 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
glBindBuffer(GL_ARRAY_BUFFER, 0);
} else {
+ // If we have a data cache, just update it.
+ if (multimesh->data_cache.size()) {
+ multimesh->data_cache = p_buffer;
+ }
+
// Only Transform is being used, so we can upload directly.
ERR_FAIL_COND(p_buffer.size() != (multimesh->instances * (int)multimesh->stride_cache));
const float *r = p_buffer.ptr();
@@ -1947,16 +1952,12 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
multimesh->buffer_set = true;
if (multimesh->data_cache.size() || multimesh->uses_colors || multimesh->uses_custom_data) {
- //if we have a data cache, just update it
- multimesh->data_cache = multimesh->data_cache;
- {
- //clear dirty since nothing will be dirty anymore
- uint32_t data_cache_dirty_region_count = Math::division_round_up(multimesh->instances, MULTIMESH_DIRTY_REGION_SIZE);
- for (uint32_t i = 0; i < data_cache_dirty_region_count; i++) {
- multimesh->data_cache_dirty_regions[i] = false;
- }
- multimesh->data_cache_used_dirty_regions = 0;
+ // Clear dirty since nothing will be dirty anymore.
+ uint32_t data_cache_dirty_region_count = Math::division_round_up(multimesh->instances, MULTIMESH_DIRTY_REGION_SIZE);
+ for (uint32_t i = 0; i < data_cache_dirty_region_count; i++) {
+ multimesh->data_cache_dirty_regions[i] = false;
}
+ multimesh->data_cache_used_dirty_regions = 0;
_multimesh_mark_all_dirty(multimesh, false, true); //update AABB
} else if (multimesh->mesh.is_valid()) {
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp
index 68d10b0c39..2dcf623995 100644
--- a/drivers/gles3/storage/texture_storage.cpp
+++ b/drivers/gles3/storage/texture_storage.cpp
@@ -1391,7 +1391,7 @@ void TextureStorage::texture_debug_usage(List<RS::TextureInfo> *r_info) {
tinfo.format = t->format;
tinfo.width = t->alloc_width;
tinfo.height = t->alloc_height;
- tinfo.depth = 0;
+ tinfo.depth = t->depth;
tinfo.bytes = t->total_data_size;
r_info->push_back(tinfo);
}