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-05-31 16:19:06 +02:00
2023-07-22 11:27:25 +10:00
2023-07-31 13:02:30 +10:00
2023-07-22 11:43:01 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:43:01 +10:00
2023-07-22 11:27:25 +10:00
2023-07-31 13:02:30 +10:00
2023-07-17 10:46:26 +02:00
2023-05-31 16:19:06 +02:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-06-03 08:54:37 +10:00
2023-05-31 16:19:06 +02:00
2023-06-19 20:40:49 +10:00
2023-07-22 11:43:01 +10:00
2023-07-22 11:46:41 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-06-08 10:11:41 +02:00
2023-05-31 16:19:06 +02:00
2023-06-14 13:59:38 +02:00
2023-06-12 15:49:50 +02:00
2023-07-25 21:15:52 +02:00
2023-07-22 11:27:25 +10: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-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-27 16:21:38 +02:00
2023-07-22 11:27:25 +10:00
2023-07-31 10:18:09 +10:00
2023-07-24 11:04:19 +10:00
2023-06-15 13:35:34 +10:00
2023-07-22 11:27:25 +10:00
2023-07-10 05:01:58 -07:00
2023-07-31 13:02:30 +10:00
2023-07-25 13:32:21 +10:00
2023-07-20 11:55:34 +10:00
2023-07-22 11:27:25 +10:00
2023-07-17 10:46:26 +02:00
2023-07-31 20:01:40 +10:00
2023-07-27 12:21:06 +10:00
2023-07-27 12:21:06 +10:00
2023-07-27 12:21:06 +10:00
2023-05-31 16:19:06 +02:00
2023-07-25 21:15:52 +02:00
2023-07-25 21:15:52 +02:00
2023-07-31 13:02:30 +10:00
2023-05-31 16:19:06 +02:00
2023-07-20 11:55:34 +10:00
2023-07-31 13:02:30 +10:00
2023-07-11 22:36:10 +02:00
2023-07-31 13:02:30 +10:00
2023-07-04 14:46:19 +02:00
2023-06-15 22:18:28 +02:00
2023-07-28 16:32:42 +02:00
2023-06-15 13:35:34 +10:00
2023-06-03 08:54:37 +10:00
2023-07-22 11:27:25 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-17 10:46:26 +02:00
2023-07-20 11:55:34 +10:00
2023-07-22 11:27:25 +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-25 21:15:52 +02:00
2023-07-11 14:40:47 +10:00
2023-07-31 13:02:30 +10:00
2023-06-16 08:14:25 -04:00
2023-07-09 20:00:17 -04:00
2023-05-31 16:19:06 +02:00
2023-07-27 12:21:06 +10:00
2023-07-22 11:27:25 +10:00
2023-07-31 13:02:30 +10:00
2023-07-31 13:02:30 +10:00
2023-07-26 17:04:13 +02:00
2023-07-24 22:06:55 +02:00
2023-07-27 12:21:06 +10:00
2023-07-27 12:21:06 +10:00
2023-07-25 21:59:54 -04:00
2023-07-17 10:46:26 +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-27 12:21:06 +10:00
2023-07-27 12:21:06 +10:00
2023-07-22 11:27:25 +10:00
2023-07-18 14:18:07 +10:00
2023-06-15 13:35:34 +10:00
2023-07-27 15:11:30 +02:00
2023-07-27 12:21:06 +10:00
2023-07-27 12:21:06 +10:00
2023-07-20 11:55:34 +10:00
2023-06-15 22:18:28 +02:00
2023-06-15 22:18:28 +02:00
2023-07-26 13:59:37 +02:00
2023-06-15 22:18:28 +02:00
2023-07-25 21:15:52 +02:00
2023-06-15 22:18:28 +02:00
2023-06-15 22:18:28 +02:00
2023-07-26 13:59:37 +02:00
2023-06-15 22:18:28 +02:00
2023-07-26 13:59:37 +02:00
2023-07-22 11:27:25 +10:00
2023-07-31 13:02:30 +10:00
2023-07-22 11:43:01 +10:00
2023-07-31 19:57:32 +10:00
2023-07-22 11:27:25 +10:00
2023-07-13 18:24:19 +02:00
2023-07-28 16:32:42 +02:00
2023-07-31 12:23:31 +02:00
2023-07-20 11:55:34 +10:00
2023-06-03 08:54:37 +10:00
2023-06-15 13:35:34 +10:00
2023-06-15 13:35:34 +10:00
2023-06-15 13:35:34 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-04 17:03:02 +02:00
2023-07-31 13:02:30 +10:00
2023-06-23 15:55:42 +02:00
2023-06-15 13:35:34 +10:00
2023-06-15 13:35:34 +10:00
2023-07-28 09:38:07 +10:00
2023-06-15 13:35:34 +10:00
2023-07-11 10:53:15 -04:00
2023-06-15 22:18:28 +02:00
2023-07-22 11:27:25 +10:00
2023-07-24 11:04:19 +10:00
2023-07-26 17:04:13 +02:00
2023-07-22 11:27:25 +10:00
2023-06-19 20:40:49 +10:00
2023-07-25 21:15:52 +02:00
2023-07-27 12:21:06 +10:00
2023-06-15 13:35:34 +10:00
2023-07-22 11:27:25 +10:00
2023-07-04 12:02:25 +10:00
2023-07-20 11:55:34 +10:00
2023-07-17 10:46:26 +02:00
2023-06-15 13:35:34 +10:00
2023-07-02 19:54:27 +10:00
2023-07-11 15:30:30 +02:00
2023-07-22 11:27:25 +10:00
2023-05-31 16:19:06 +02:00
2023-07-17 10:46:26 +02:00
2023-07-28 16:37:06 +02:00
2023-07-22 11:27:25 +10:00
2023-06-15 13:35:34 +10:00
2023-07-24 10:13:31 +10:00
2023-07-20 11:55:34 +10:00
2023-06-04 19:27:38 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-06-03 08:54:37 +10:00
2023-07-22 11:27:25 +10:00
2023-07-11 15:30:30 +02:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:43:01 +10:00
2023-07-22 11:43:01 +10:00
2023-07-09 21:22:45 +10:00
2023-07-24 22:06:55 +02:00
2023-06-16 08:14:25 -04:00
2023-07-26 15:23:26 +10:00
2023-07-25 21:15:52 +02:00
2023-07-25 15:23:56 -04:00
2023-07-25 21:15:52 +02:00
2023-07-25 15:23:56 -04:00
2023-07-24 22:06:55 +02:00
2023-07-27 12:21:06 +10:00
2023-07-31 13:02:30 +10:00
2023-07-26 15:23:26 +10:00
2023-07-25 21:15:52 +02:00
2023-07-26 17:04:13 +02:00
2023-07-31 13:02:30 +10:00
2023-07-26 17:04:13 +02:00
2023-07-25 15:23:56 -04:00
2023-07-26 00:08:31 -04:00
2023-07-24 22:06:55 +02:00
2023-07-25 21:15:52 +02:00
2023-07-31 13:02:30 +10:00
2023-07-25 21:15:52 +02:00
2023-07-26 00:08:31 -04:00
2023-07-26 17:04:13 +02:00
2023-07-31 13:02:30 +10:00
2023-07-24 10:13:31 +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-24 22:06:55 +02:00
2023-07-25 21:15:52 +02:00
2023-07-25 15:23:56 -04:00
2023-07-24 22:06:55 +02:00
2023-07-25 21:15:52 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-07-25 15:23:56 -04: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-05-31 16:19:06 +02:00
2023-07-22 11:43:01 +10:00
2023-07-11 22:36:10 +02:00
2023-07-11 22:36:10 +02:00
2023-06-16 10:53:11 +02:00
2023-07-11 22:36:10 +02:00
2023-07-11 22:36:10 +02:00
2023-07-11 22:36:10 +02:00
2023-07-31 13:02:30 +10:00
2023-07-27 16:06:07 +05:30
2023-07-25 21:15:52 +02:00
2023-06-13 20:23:39 +02:00
2023-07-28 14:25:38 +02:00
2023-05-31 16:19:06 +02:00
2023-07-17 10:46:26 +02:00
2023-07-22 11:27:25 +10:00
2023-05-31 16:19:06 +02:00
2023-07-22 11:27:25 +10:00
2023-07-25 21:15:52 +02:00
2023-07-22 11:27:25 +10:00
2023-07-29 23:47:13 -04:00
2023-07-22 11:43:01 +10:00
2023-07-25 21:59:54 -04:00
2023-07-27 12:21:06 +10:00
2023-07-25 21:15:52 +02:00
2023-07-28 13:44:01 +02:00
2023-07-27 17:47:34 -04:00
2023-07-28 13:44:01 +02:00
2023-07-27 17:47:34 -04:00
2023-06-15 13:35:34 +10:00
2023-07-27 17:47:34 -04:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-31 14:40:41 +02:00
2023-07-24 11:04:19 +10:00
2023-07-27 12:21:06 +10:00
2023-07-17 10:46:26 +02:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-25 21:59:54 -04:00
2023-06-23 08:39:46 +02:00
2023-07-25 20:51:32 +10:00
2023-07-31 13:02:30 +10:00
2023-07-25 21:59:54 -04:00
2023-07-28 18:30:32 +02:00
2023-07-29 15:32:45 +10:00
2023-07-25 21:15:52 +02:00
2023-07-22 11:27:25 +10:00
2023-07-17 10:46:26 +02:00
2023-07-20 11:55:34 +10:00
2023-07-25 21:15:52 +02:00
2023-07-25 21:15:52 +02:00
2023-07-24 22:06:55 +02:00
2023-07-25 21:15:52 +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-05-31 16:19:06 +02:00
2023-07-25 21:15:52 +02:00
2023-07-24 22:06:55 +02:00
2023-05-31 16:19:06 +02:00
2023-07-25 15:23:56 -04:00
2023-07-25 21:15:52 +02:00
2023-07-22 11:27:25 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-25 21:15:52 +02:00
2023-07-22 11:27:25 +10:00
2023-07-26 15:23:26 +10:00
2023-07-02 19:54:27 +10:00
2023-07-31 13:02:30 +10:00
2023-06-03 08:54:37 +10:00
2023-05-31 16:19:06 +02:00
2023-05-31 16:19:06 +02:00
2023-07-22 11:27:25 +10:00
2023-07-24 11:04:19 +10:00
2023-05-31 16:19:06 +02:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-05-31 16:19:06 +02:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-24 10:13:31 +10:00
2023-07-07 20:37:33 +10:00
2023-07-11 22:36:10 +02:00
2023-06-30 08:49:53 +02:00
2023-07-24 22:06:55 +02:00
2023-07-27 12:21:06 +10:00
2023-07-04 12:02:25 +10:00
2023-07-22 11:27:25 +10:00
2023-07-22 11:46:41 +10:00
2023-06-19 12:40:37 +10:00