Hans Goudey
f10965dcb8
Sculpt: Improve PBVH draw performance for meshes
...
Reduce overhead of copying attribute data into GPU buffers when the
PBVH is active. The existing lambda with a FunctionRef callback had
a significant overhead. While that was reduced by 25917f0165
already, even making the `foreach_faces` lambda into a template gave
significant overhead compared to simpler loops. Instead, separate
value conversion and iteration over visible triangles in a way that the
compiler is able to optimize more easily.
According to the GPU module, it's also better to use raw data access
than `GPU_vertbuf_raw_step`, since the data format strides aren't
meant to vary by platform, and the runtime stride can have a
noticeable performance impact.
Also avoid recalculating face normals, since they're already used to
calculate vertex normals anyway (since ac02f94caf ).
I tested the runtime of the initial data-upload after entering sculpt
mode with a 16 million vertex mesh. Before, that took 1350 ms, after
it took 680 ms, which is almost a 2x improvement. In my tests, the
performance improvement was only observable for the initial data
upload, theoretically it is a more general change though.
It's possible that a similar optimization could be applied to multires
or dynamic topology sculpting, but that can be looked at later too.
Pull Request: https://projects.blender.org/blender/blender/pulls/110621
2023-07-31 14:40:41 +02:00
..
2023-07-31 14:40:41 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-06-06 11:14:50 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-06-14 12:20:06 +10:00
2023-05-31 16:19:06 +02:00
2023-06-22 13:42:27 +10:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-06-08 10:11:41 +02:00
2023-06-12 15:49:50 +02:00
2023-07-11 16:50:34 -04:00
2023-06-21 11:28:58 +10:00
2023-05-31 16:19:06 +02:00
2023-07-28 18:30:32 +02:00
2023-07-28 18:30:32 +02:00
2023-07-28 18:30:32 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 10:18:09 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-27 16:21:38 +02:00
2023-05-31 16:19:06 +02:00
2023-06-23 10:09:01 +10:00
2023-05-31 16:19:06 +02:00
2023-07-10 18:12:41 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-05 20:03:41 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-11 22:36:10 +02:00
2023-07-27 12:21:06 +10:00
2023-07-04 15:15:18 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-06-08 10:20:18 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-06-12 14:26:27 -04:00
2023-06-16 08:14:25 -04:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-07-24 22:06:55 +02:00
2023-07-24 22:06:55 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-06-15 22:18:28 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-07-25 21:15:52 +02:00
2023-06-13 14:51:49 -04:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-06-15 22:18:28 +02:00
2023-06-16 09:49:58 +10:00
2023-07-26 13:59:37 +02:00
2023-07-31 13:02:30 +10:00
2023-06-15 13:35:34 +10:00
2023-06-15 13:35:34 +10:00
2023-06-29 10:56:33 +10:00
2023-07-27 22:10:16 +10:00
2023-06-15 13:35:34 +10:00
2023-06-15 13:35:34 +10:00
2023-07-31 12:23:31 +02:00
2023-05-31 16:19:06 +02:00
2023-07-27 12:21:06 +10:00
2023-05-31 16:19:06 +02:00
2023-07-11 10:53:15 -04:00
2023-07-04 17:03:02 +02:00
2023-06-15 13:35:34 +10:00
2023-05-31 16:19:06 +02:00
2023-06-15 13:35:34 +10:00
2023-07-31 13:02:30 +10:00
2023-06-15 22:18:28 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-07-31 13:02:30 +10:00
2023-07-31 13:02:30 +10:00
2023-07-28 16:37:06 +02:00
2023-07-07 15:11:19 +10:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-16 15:50:02 +10:00
2023-07-27 16:21:38 +02:00
2023-07-31 13:02:30 +10:00
2023-06-07 13:22:07 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-27 12:21:06 +10:00
2023-07-31 13:02:30 +10:00
2023-07-25 21:59:54 -04:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-07-26 00:08:31 -04:00
2023-07-24 22:06:55 +02:00
2023-07-24 22:06:55 +02:00
2023-07-27 14:16:58 +02:00
2023-07-24 22:06:55 +02:00
2023-07-31 13:02:30 +10:00
2023-07-26 17:04:13 +02:00
2023-07-31 10:20:26 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-12 16:14:12 +02:00
2023-06-14 14:04:22 +02:00
2023-06-14 12:19:13 +02:00
2023-05-31 16:19:06 +02:00
2023-06-20 10:25:41 +02:00
2023-07-24 15:36:36 +02:00
2023-06-15 16:04:23 +02:00
2023-07-27 16:06:07 +05:30
2023-07-27 12:21:06 +10:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-28 13:44:01 +02:00
2023-07-31 13:02:30 +10:00
2023-07-29 23:47:13 -04:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-06-12 14:22:11 -04:00
2023-05-31 16:19:06 +02:00
2023-06-05 10:57:34 +10:00
2023-05-31 16:19:06 +02:00
2023-07-11 12:22:44 +02:00
2023-05-31 16:19:06 +02:00
2023-07-25 12:38:47 +02:00
2023-06-14 18:36:17 +02:00
2023-07-27 22:10:16 +10:00
2023-07-24 22:06:55 +02:00
2023-07-28 18:30:32 +02:00
2023-07-28 18:30:32 +02:00
2023-05-31 16:19:06 +02:00
2023-06-14 04:47:53 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-07-24 22:06:55 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-06-10 17:35:58 +10:00
2023-07-31 13:02:30 +10:00
2023-06-07 14:17:37 +02:00
2023-06-08 10:43:55 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 13:02:30 +10:00
2023-06-26 13:09:06 +10:00
2023-05-31 16:19:06 +02:00
2023-07-11 22:36:10 +02:00
2023-06-30 08:49:53 +02:00
2023-05-31 16:19:06 +02:00
2023-07-24 22:06:55 +02:00
2023-06-30 11:39:17 +02:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-06-19 12:40:37 +10:00
2023-06-19 12:40:37 +10:00
2023-07-28 18:30:32 +02:00
2023-05-31 16:19:06 +02:00
2023-06-29 10:56:33 +10:00
2023-05-31 16:19:06 +02:00