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.
This commit is contained in:
Kévin Dietrich 2022-02-25 22:04:10 +01:00
parent 72a286760f
commit a911f075d7
Notes: blender-bot 2023-02-14 07:18:54 +01:00
Referenced by issue #93440, Viewport performance drops drastically after switching from atributte visualization to solid view
Referenced by issue #93123, Massive lag when enabling Viewport Shading -> Color -> Vertex and using Sculpt Vertex Colors
1 changed files with 1 additions and 5 deletions

View File

@ -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;
}