summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d12/d3d12-device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/d3d12/d3d12-device.cpp')
-rw-r--r--tools/gfx/d3d12/d3d12-device.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/gfx/d3d12/d3d12-device.cpp b/tools/gfx/d3d12/d3d12-device.cpp
index efc1beb22..e682764f5 100644
--- a/tools/gfx/d3d12/d3d12-device.cpp
+++ b/tools/gfx/d3d12/d3d12-device.cpp
@@ -471,12 +471,15 @@ Result DeviceImpl::initialize(const Desc& desc)
// TODO: we should probably provide a command-line option
// to override UseDebug of default rather than leave it
// up to each back-end to specify.
-#if ENABLE_DEBUG_LAYER
- combiner.add(
- DeviceCheckFlag::UseDebug, ChangeType::OnOff); ///< First try debug then non debug
-#else
- combiner.add(DeviceCheckFlag::UseDebug, ChangeType::Off); ///< Don't bother with debug
-#endif
+ if (ENABLE_DEBUG_LAYER || isGfxDebugLayerEnabled())
+ {
+ combiner.add(
+ DeviceCheckFlag::UseDebug, ChangeType::OnOff); ///< First try debug then non debug
+ }
+ else
+ {
+ combiner.add(DeviceCheckFlag::UseDebug, ChangeType::Off); ///< Don't bother with debug
+ }
combiner.add(
DeviceCheckFlag::UseHardwareDevice,
ChangeType::OnOff); ///< First try hardware, then reference