Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-02-26 00:04:10 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-02-26 00:04:10 +0300
commita911f075d7aa823b215d4e7baf91ea4f5bd6099c (patch)
tree3d7c8cdfd02962c480b2f209ac88e9606fe38eba /source/blender/draw/intern/draw_cache_impl_mesh.c
parent72a286760f3f2e759839c63a2a1b588aeca17e9d (diff)
Fix T93123: viewport lags with custom attributes
The check to see if newly requested attributes are not already in the cache was not taking into account the possibility that we do not have new requested attributes (`num_requests == 0`). In this case, if `attr_used` already had attributes, but `attr_requested` is empty, we would consider the cache as dirty, and needlessly rebuild the attribute VBOs.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 71f13fe9423..a47fd0c9067 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -355,11 +355,7 @@ static void drw_mesh_attributes_merge(DRW_MeshAttributes *dst,
/* Return true if all requests in b are in a. */
static bool drw_mesh_attributes_overlap(DRW_MeshAttributes *a, DRW_MeshAttributes *b)
{
- if (a->num_requests != b->num_requests) {
- return false;
- }
-
- for (int i = 0; i < a->num_requests; i++) {
+ for (int i = 0; i < b->num_requests; i++) {
if (!has_request(a, b->requests[i])) {
return false;
}