[Bf-blender-cvs] [db8be0cdfba] blender-v3.0-release: Cleanup: compiler warnings in with Cycles OSL and clang

Brecht Van Lommel noreply at git.blender.org
Thu Oct 28 16:01:58 CEST 2021


Commit: db8be0cdfbaf9346af931a56da8df92f84845db3
Author: Brecht Van Lommel
Date:   Thu Oct 28 15:51:40 2021 +0200
Branches: blender-v3.0-release
https://developer.blender.org/rBdb8be0cdfbaf9346af931a56da8df92f84845db3

Cleanup: compiler warnings in with Cycles OSL and clang

===================================================================

M	intern/cycles/util/defines.h

===================================================================

diff --git a/intern/cycles/util/defines.h b/intern/cycles/util/defines.h
index 9b1698d461a..a778bef52b2 100644
--- a/intern/cycles/util/defines.h
+++ b/intern/cycles/util/defines.h
@@ -33,21 +33,14 @@
 /* Qualifiers for kernel code shared by CPU and GPU */
 
 #ifndef __KERNEL_GPU__
+
+/* Leave inlining decisions to compiler for these, the inline keyword here
+ * is not about performance but including function definitions in headers. */
 #  define ccl_device static inline
-#  define ccl_device_noinline static
+#  define ccl_device_noinline static inline
 #  define ccl_device_noinline_cpu ccl_device_noinline
-#  define ccl_global
-#  define ccl_static_constant static const
-#  define ccl_constant const
-#  define ccl_local
-#  define ccl_local_param
-#  define ccl_private
-#  define ccl_restrict __restrict
-#  define ccl_optional_struct_init
-#  define ccl_loop_no_unroll
-#  define ccl_attr_maybe_unused [[maybe_unused]]
-#  define __KERNEL_WITH_SSE_ALIGN__
 
+/* Forced inlining. */
 #  if defined(_WIN32) && !defined(FREE_WINDOWS)
 #    define ccl_device_inline static __forceinline
 #    define ccl_device_forceinline static __forceinline
@@ -75,6 +68,18 @@
 #    define ccl_never_inline __attribute__((noinline))
 #  endif /* _WIN32 && !FREE_WINDOWS */
 
+/* Address spaces for GPU. */
+#  define ccl_global
+#  define ccl_static_constant static const
+#  define ccl_constant const
+#  define ccl_private
+
+#  define ccl_restrict __restrict
+#  define ccl_optional_struct_init
+#  define ccl_loop_no_unroll
+#  define ccl_attr_maybe_unused [[maybe_unused]]
+#  define __KERNEL_WITH_SSE_ALIGN__
+
 /* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */
 #  ifndef ATTR_FALLTHROUGH
 #    if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */



More information about the Bf-blender-cvs mailing list