bdk-blender/source/blender/draw
Hans Goudey c8c6f62cf3 Fix #109583: Avoid non-threadsafe writing to custom normals data
Currently, while calculating face corner normals, Blender retrieves
custom normal data with write access. When the the custom normals in a
single smooth corner fan don't match, they are reset to the average
value.

This behavior is very old, but it comes from when Blender didn't have a
strong idea of const correctness. Indeed, modifying custom normal data
while calculating normals isn't threadsafe, which is important because
normals are calculated for viewport drawing, for example. And in the
future, properly caching face corner normals (see #93551) will require
the ability to calculate normals on a properly const mesh.

The fix is to still use the average of custom normals in a fan, but
not write that back to the custom data array. In my testing the results
are the same. Setting custom normals still fills the same value for all
corners in a fan.

Pull Request: blender/blender#110478

Pull Request: blender/blender#112055
2023-09-06 22:19:08 +02:00
..
engines GPU: Fix signed/unsigned mismatches in shader code 2023-09-05 10:00:31 +02:00
intern Fix #109583: Avoid non-threadsafe writing to custom normals data 2023-09-06 22:19:08 +02:00
tests Cleanup: Move BKE_node.h to C++ 2023-05-15 15:14:22 +02:00
CMakeLists.txt EEVEE: Add Transparent Render-Pass option 2023-05-17 11:57:36 +02:00
DRW_engine.h Cleanup: move doc-strings into headers, remove duplicates 2023-03-29 14:37:34 +11:00
DRW_pbvh.hh Mesh: Split MLoopTri poly indices into a separate array 2023-05-04 15:39:10 +02:00
DRW_select_buffer.h Cleanup: format, reduce line length & strip trailing space 2022-05-19 11:17:01 +10:00