Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_mesh.c
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
| #include "draw_cache_impl.h" /* own include */ | #include "draw_cache_impl.h" /* own include */ | ||||
| static void mesh_batch_cache_clear(Mesh *me); | static void mesh_batch_cache_clear(Mesh *me); | ||||
| /* Return true is all layers in _b_ are inside _a_. */ | /* Return true is all layers in _b_ are inside _a_. */ | ||||
| BLI_INLINE bool mesh_cd_layers_type_overlap(DRW_MeshCDMask a, DRW_MeshCDMask b) | BLI_INLINE bool mesh_cd_layers_type_overlap(DRW_MeshCDMask a, DRW_MeshCDMask b) | ||||
| { | { | ||||
| return (*((uint32_t *)&a) & *((uint32_t *)&b)) == *((uint32_t *)&b); | return (*((uint64_t *)&a) & *((uint64_t *)&b)) == *((uint64_t *)&b); | ||||
| } | } | ||||
| BLI_INLINE bool mesh_cd_layers_type_equal(DRW_MeshCDMask a, DRW_MeshCDMask b) | BLI_INLINE bool mesh_cd_layers_type_equal(DRW_MeshCDMask a, DRW_MeshCDMask b) | ||||
| { | { | ||||
| return *((uint32_t *)&a) == *((uint32_t *)&b); | return *((uint64_t *)&a) == *((uint64_t *)&b); | ||||
| } | } | ||||
| BLI_INLINE void mesh_cd_layers_type_merge(DRW_MeshCDMask *a, DRW_MeshCDMask b) | BLI_INLINE void mesh_cd_layers_type_merge(DRW_MeshCDMask *a, DRW_MeshCDMask b) | ||||
| { | { | ||||
| atomic_fetch_and_or_uint32((uint32_t *)a, *(uint32_t *)&b); | uint32_t *a_p = (uint32_t *)a; | ||||
| uint32_t *b_p = (uint32_t *)&b; | |||||
| atomic_fetch_and_or_uint32(a_p, *b_p); | |||||
| atomic_fetch_and_or_uint32(a_p + 1, *(b_p + 1)); | |||||
| } | } | ||||
| BLI_INLINE void mesh_cd_layers_type_clear(DRW_MeshCDMask *a) | BLI_INLINE void mesh_cd_layers_type_clear(DRW_MeshCDMask *a) | ||||
| { | { | ||||
| *((uint32_t *)a) = 0; | *((uint64_t *)a) = 0; | ||||
| } | } | ||||
| static void mesh_cd_calc_edit_uv_layer(const Mesh *UNUSED(me), DRW_MeshCDMask *cd_used) | static void mesh_cd_calc_edit_uv_layer(const Mesh *UNUSED(me), DRW_MeshCDMask *cd_used) | ||||
| { | { | ||||
| cd_used->edit_uv = 1; | cd_used->edit_uv = 1; | ||||
| } | } | ||||
| BLI_INLINE const CustomData *mesh_cd_ldata_get_from_mesh(const Mesh *me) | BLI_INLINE const CustomData *mesh_cd_ldata_get_from_mesh(const Mesh *me) | ||||
| ▲ Show 20 Lines • Show All 1,450 Lines • Show Last 20 Lines | |||||