swr: [rasterizer common] make disabled asserts always print (but not break)
authorTim Rowley <timothy.o.rowley@intel.com>
Tue, 2 Aug 2016 00:10:18 +0000 (18:10 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Wed, 10 Aug 2016 16:07:00 +0000 (11:07 -0500)
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/rasterizer/common/swr_assert.cpp

index 49587d097c0a6c093d9ccad988927abe4a963bf0..72501014de4734da6052cec108c576a1966fa83e 100644 (file)
@@ -121,8 +121,6 @@ bool SwrAssert(
     const char* pFmtString /* = nullptr */,
     ...)
 {
-    if (!enabled) return false;
-
     SetTextColor(stderr, TEXT_CYAN, TEXT_NORMAL);
 
     fprintf(stderr, "%s(%d): ", pFileName, lineNum);
@@ -182,7 +180,7 @@ bool SwrAssert(
         OutputDebugStringA("\n");
     }
 
-    if (KNOB_ENABLE_ASSERT_DIALOGS)
+    if (enabled && KNOB_ENABLE_ASSERT_DIALOGS)
     {
         int retval = sprintf_s(
             &msgBuf[offset],
@@ -228,11 +226,11 @@ bool SwrAssert(
     }
     else
     {
-        return IsDebuggerPresent() || !chkDebugger;
+        return (IsDebuggerPresent() || !chkDebugger) && enabled;
     }
 #endif // _WIN32
 
-    return true;
+    return enabled;
 }
 
 #endif // SWR_ENABLE_ASSERTS