diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2020-07-06 09:41:28 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-07-14 18:41:05 +0300 |
commit | 6cc88e330bf1fb34aecd7a5ecba53910db59d8cb (patch) | |
tree | 5c3b2b393aa2715449ba55e59d434381c2c9fd82 /source/blender/draw/intern/draw_cache_extract.h | |
parent | 2ba1cf4b40fc2ec92c1ef2ad17df70ed8859a1b0 (diff) |
Fix T78431: Update mesh_cd_layers_type_ to support 8 bytes.
Sculpt vertex colors changed the `DRW_MeshCDMask` from 4 bytes to 8 bytes, but
the functions assumed it still was 4 bytes. This patch updates the functions and
adds a compile time check.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D8215
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract.h b/source/blender/draw/intern/draw_cache_extract.h index 302f9a0d3a8..f05e8e2f9d6 100644 --- a/source/blender/draw/intern/draw_cache_extract.h +++ b/source/blender/draw/intern/draw_cache_extract.h @@ -60,6 +60,10 @@ typedef struct DRW_MeshCDMask { * modifiers could remove it. (see T68857) */ uint32_t edit_uv : 1; } DRW_MeshCDMask; +/* Keep `DRW_MeshCDMask` struct within an `uint64_t`. + * bit-wise and atomic operations are used to compare and update the struct. + * See `mesh_cd_layers_type_*` functions. */ +BLI_STATIC_ASSERT(sizeof(DRW_MeshCDMask) <= sizeof(uint64_t), "DRW_MeshCDMask exceeds 64 bits") typedef enum eMRIterType { MR_ITER_LOOPTRI = 1 << 0, |