Fix #109662: Always use zero for retopology min offset when disabled #109658

Merged
Clément Foucault merged 1 commits from bonj/blender:fix/retopology-overlay-min-offset into main 2023-07-11 12:05:59 +02:00
1 changed files with 4 additions and 6 deletions

View File

@ -1329,17 +1329,15 @@ void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrAr
(((overlay).edit_flag & V3D_OVERLAY_EDIT_RETOPOLOGY) != 0)
#ifdef __APPLE__
/* Apple silicon tile depth test requires a higher value to reduce drawing artifacts. */
# define OVERLAY_RETOPOLOGY_MIN_OFFSET_ENABLED 0.0015f
# define OVERLAY_RETOPOLOGY_MIN_OFFSET_DISABLED 0.0015f
# define OVERLAY_RETOPOLOGY_MIN_OFFSET 0.0015f
#else
# define OVERLAY_RETOPOLOGY_MIN_OFFSET_ENABLED FLT_EPSILON
# define OVERLAY_RETOPOLOGY_MIN_OFFSET_DISABLED 0.0f
# define OVERLAY_RETOPOLOGY_MIN_OFFSET FLT_EPSILON
#endif
#define OVERLAY_RETOPOLOGY_OFFSET(overlay) \
(OVERLAY_RETOPOLOGY_ENABLED(overlay) ? \
max_ff((overlay).retopology_offset, OVERLAY_RETOPOLOGY_MIN_OFFSET_ENABLED) : \
OVERLAY_RETOPOLOGY_MIN_OFFSET_DISABLED)
max_ff((overlay).retopology_offset, OVERLAY_RETOPOLOGY_MIN_OFFSET) : \
0.0f)
#define RETOPOLOGY_ENABLED(v3d) (OVERLAY_RETOPOLOGY_ENABLED((v3d)->overlay))
#define RETOPOLOGY_OFFSET(v3d) (OVERLAY_RETOPOLOGY_OFFSET((v3d)->overlay))