[Mesa-dev] [PATCH 09/10] swr: [rasterizer core] Disable inline function expansion
Tim Rowley
timothy.o.rowley at intel.com
Sat Mar 25 12:01:01 UTC 2017
Disable expansion in windows Debug builds.
---
src/gallium/drivers/swr/rasterizer/common/os.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h
index 71c4da3..ef00a25 100644
--- a/src/gallium/drivers/swr/rasterizer/common/os.h
+++ b/src/gallium/drivers/swr/rasterizer/common/os.h
@@ -47,7 +47,19 @@
#endif
#define OSALIGN(RWORD, WIDTH) __declspec(align(WIDTH)) RWORD
+
+#if defined(_DEBUG)
+// We compile Debug builds with inline function expansion enabled. This allows
+// functions compiled with __forceinline to be inlined even in Debug builds.
+// The inline_depth(0) pragma below will disable inline function expansion for
+// normal INLINE / inline functions, but not for __forceinline functions.
+// Our SIMD function wrappers (see simdlib.hpp) use __forceinline even in
+// Debug builds.
+#define INLINE inline
+#pragma inline_depth(0)
+#else
#define INLINE __forceinline
+#endif
#define DEBUGBREAK __debugbreak()
#define PRAGMA_WARNING_PUSH_DISABLE(...) \
--
2.7.4
More information about the mesa-dev
mailing list