Refactor: Remove _DEBUG, use WITH_DRAW_DEBUG instead

The `_DEBUG` flag is interfering with oneTBB, and now that there is a
`WITH_DRAW_DEBUG` option this is more appropriate.

See #115774 for more context.

Pull Request: https://projects.blender.org/blender/blender/pulls/133950
This commit is contained in:
Brecht Van Lommel
2025-02-03 12:32:04 +01:00
committed by Brecht Van Lommel
parent 68c7d93b5f
commit c7eb2f4204
4 changed files with 6 additions and 18 deletions

View File

@@ -54,11 +54,6 @@ endif()
# quiet output for Makefiles, 'make -s' helps too
# set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
# Global compile definitions since add_definitions() adds for all.
# _DEBUG is a Visual Studio define, enabled for all platforms.
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
$<$<CONFIG:Debug>:_DEBUG>
)
# -----------------------------------------------------------------------------
# Set policy

View File

@@ -20,13 +20,6 @@
#include "draw_shader.hh"
#include "draw_shader_shared.hh"
#if defined(_DEBUG) || defined(WITH_DRAW_DEBUG)
# define DRAW_DEBUG
#else
/* Uncomment to forcibly enable debug draw in release mode. */
// #define DRAW_DEBUG
#endif
namespace blender::draw {
/* -------------------------------------------------------------------- */
@@ -301,7 +294,7 @@ blender::draw::DebugDraw *DRW_debug_get()
void drw_debug_draw()
{
#ifdef DRAW_DEBUG
#ifdef WITH_DRAW_DEBUG
if (DST.debug == nullptr) {
return;
}
@@ -316,7 +309,7 @@ void drw_debug_init()
/* Module should not be used in release builds. */
/* TODO(@fclem): Hide the functions declarations without using `ifdefs` everywhere. */
#ifdef DRAW_DEBUG
#ifdef WITH_DRAW_DEBUG
/* TODO(@fclem): Convenience for now. Will have to move to #DRWManager. */
if (DST.debug == nullptr) {
DST.debug = reinterpret_cast<DRWDebugModule *>(new blender::draw::DebugDraw());
@@ -350,7 +343,7 @@ void DRW_debug_modelmat_reset()
void DRW_debug_modelmat(const float modelmat[4][4])
{
#ifdef DRAW_DEBUG
#ifdef WITH_DRAW_DEBUG
reinterpret_cast<blender::draw::DebugDraw *>(DST.debug)->modelmat_set(modelmat);
#else
UNUSED_VARS(modelmat);
@@ -384,7 +377,7 @@ void DRW_debug_m4_as_bbox(const float m[4][4], bool invert, const float color[4]
void DRW_debug_bbox(const BoundBox *bbox, const float color[4])
{
#ifdef DRAW_DEBUG
#ifdef WITH_DRAW_DEBUG
reinterpret_cast<blender::draw::DebugDraw *>(DST.debug)->draw_bbox(*bbox, color);
#else
UNUSED_VARS(bbox, color);

View File

@@ -141,7 +141,7 @@ void Manager::end_sync()
void Manager::debug_bind()
{
#ifdef _DEBUG
#ifdef WITH_DRAW_DEBUG
if (DST.debug == nullptr) {
return;
}

View File

@@ -262,7 +262,7 @@ void View::compute_visibility(ObjectBoundsBuf &bounds,
culling_freeze_[0] = static_cast<ViewCullingData>(culling_[0]);
culling_freeze_.push_update();
}
#ifdef _DEBUG
#ifdef WITH_DRAW_DEBUG
if (debug_freeze) {
float4x4 persmat = data_freeze_[0].winmat * data_freeze_[0].viewmat;
drw_debug_matrix_as_bbox(math::invert(persmat), float4(0, 1, 0, 1));