Build: replace Blender specific DEBUG by standard NDEBUG #115774

Merged
Brecht Van Lommel merged 2 commits from brecht/blender:ndebug into main 2023-12-06 16:05:26 +01:00
3 changed files with 7 additions and 11 deletions
Showing only changes of commit 7bce65d0fb - Show all commits

View File

@ -664,9 +664,5 @@ typedef bool (*BMLoopPairFilterFunc)(const BMLoop *, const BMLoop *, void *user_
#define BM_LOOP_RADIAL_MAX 10000 #define BM_LOOP_RADIAL_MAX 10000
#define BM_NGON_MAX 100000 #define BM_NGON_MAX 100000
/* setting zero so we can catch bugs in OpenMP/BMesh */ /* Minimum number of elements before using threading. */
#ifdef DEBUG #define BM_THREAD_LIMIT 10000
# define BM_OMP_LIMIT 0
#else
# define BM_OMP_LIMIT 10000
#endif

View File

@ -381,7 +381,7 @@ static void bm_mesh_select_mode_flush_vert_to_edge(BMesh *bm)
TaskParallelSettings settings; TaskParallelSettings settings;
BLI_parallel_range_settings_defaults(&settings); BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = bm->totedge >= BM_OMP_LIMIT; settings.use_threading = bm->totedge >= BM_THREAD_LIMIT;
settings.userdata_chunk = &chunk_data; settings.userdata_chunk = &chunk_data;
settings.userdata_chunk_size = sizeof(chunk_data); settings.userdata_chunk_size = sizeof(chunk_data);
settings.func_reduce = bm_mesh_select_mode_flush_reduce_fn; settings.func_reduce = bm_mesh_select_mode_flush_reduce_fn;
@ -397,7 +397,7 @@ static void bm_mesh_select_mode_flush_edge_to_face(BMesh *bm)
TaskParallelSettings settings; TaskParallelSettings settings;
BLI_parallel_range_settings_defaults(&settings); BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = bm->totface >= BM_OMP_LIMIT; settings.use_threading = bm->totface >= BM_THREAD_LIMIT;
settings.userdata_chunk = &chunk_data; settings.userdata_chunk = &chunk_data;
settings.userdata_chunk_size = sizeof(chunk_data); settings.userdata_chunk_size = sizeof(chunk_data);
settings.func_reduce = bm_mesh_select_mode_flush_reduce_fn; settings.func_reduce = bm_mesh_select_mode_flush_reduce_fn;

View File

@ -212,7 +212,7 @@ static void bm_mesh_verts_calc_normals(BMesh *bm,
TaskParallelSettings settings; TaskParallelSettings settings;
BLI_parallel_mempool_settings_defaults(&settings); BLI_parallel_mempool_settings_defaults(&settings);
settings.use_threading = bm->totvert >= BM_OMP_LIMIT; settings.use_threading = bm->totvert >= BM_THREAD_LIMIT;
if (vcos == nullptr) { if (vcos == nullptr) {
BM_iter_parallel(bm, BM_VERTS_OF_MESH, bm_vert_calc_normals_cb, nullptr, &settings); BM_iter_parallel(bm, BM_VERTS_OF_MESH, bm_vert_calc_normals_cb, nullptr, &settings);
@ -242,7 +242,7 @@ void BM_mesh_normals_update_ex(BMesh *bm, const BMeshNormalsUpdate_Params *param
/* Calculate all face normals. */ /* Calculate all face normals. */
TaskParallelSettings settings; TaskParallelSettings settings;
BLI_parallel_mempool_settings_defaults(&settings); BLI_parallel_mempool_settings_defaults(&settings);
settings.use_threading = bm->totedge >= BM_OMP_LIMIT; settings.use_threading = bm->totedge >= BM_THREAD_LIMIT;
BM_iter_parallel(bm, BM_FACES_OF_MESH, bm_face_calc_normals_cb, nullptr, &settings); BM_iter_parallel(bm, BM_FACES_OF_MESH, bm_face_calc_normals_cb, nullptr, &settings);
} }
@ -1356,7 +1356,7 @@ static void bm_mesh_loops_calc_normals(BMesh *bm,
const bool do_rebuild, const bool do_rebuild,
const float split_angle_cos) const float split_angle_cos)
{ {
if (bm->totloop < BM_OMP_LIMIT) { if (bm->totloop < BM_THREAD_LIMIT) {
bm_mesh_loops_calc_normals__single_threaded(bm, bm_mesh_loops_calc_normals__single_threaded(bm,
vcos, vcos,
fnos, fnos,