diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-04-27 16:30:17 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-04-27 16:30:17 +0300 |
commit | 163f6a17e4fe60ce917715afc5bb5eae3d5ff07a (patch) | |
tree | f4ccaf95ae9ca893582805a5f433ab2ee1bec042 /source/blender/makesdna/DNA_mesh_types.h | |
parent | 08731d70bf667a7179a3ea4c29aa9d81b019d4ee (diff) |
Fix T96434: bad performance with viewport statistics and GPU subdivision
The subdivision is always recomputed on the CPU when displaying stats
if the mesh is animated which leads to bad performance.
This caches the subdivision topology counters from the draw code in the
mesh runtime and uses them for the viewport statistics.
Differential Revision: https://developer.blender.org/D14774
Diffstat (limited to 'source/blender/makesdna/DNA_mesh_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 0d57afe4225..b98c9dd2886 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -128,10 +128,16 @@ typedef struct Mesh_Runtime { SessionUUID subsurf_session_uuid; char subsurf_resolution; char subsurf_do_loop_normals; - char _pad3[2]; char subsurf_apply_render; char subsurf_use_optimal_display; + /* Cached from the draw code for stats display. */ + int subsurf_totvert; + int subsurf_totedge; + int subsurf_totpoly; + int subsurf_totloop; + char _pad2[2]; + /** * Caches for lazily computed vertex and polygon normals. These are stored here rather than in * #CustomData because they can be calculated on a const mesh, and adding custom data layers on a |