diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-28 17:02:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-28 17:02:06 +0300 |
commit | ec9357a94ed41b5972733df7f04220c0883cc8e1 (patch) | |
tree | adb32abbec07127e2d01a2e6c18a81df96021871 | |
parent | 60b278a3bb74f5fd253d2c40d166d97554629e4d (diff) | |
parent | db8be0cdfbaf9346af931a56da8df92f84845db3 (diff) |
Merge branch 'blender-v3.0-release'
-rw-r--r-- | intern/cycles/scene/film.cpp | 1 | ||||
-rw-r--r-- | intern/cycles/scene/osl.cpp | 11 | ||||
-rw-r--r-- | intern/cycles/util/defines.h | 29 |
3 files changed, 26 insertions, 15 deletions
diff --git a/intern/cycles/scene/film.cpp b/intern/cycles/scene/film.cpp index b6480fa64f1..591f309384e 100644 --- a/intern/cycles/scene/film.cpp +++ b/intern/cycles/scene/film.cpp @@ -194,6 +194,7 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) /* Mark passes as unused so that the kernel knows the pass is inaccessible. */ kfilm->pass_denoising_normal = PASS_UNUSED; kfilm->pass_denoising_albedo = PASS_UNUSED; + kfilm->pass_denoising_depth = PASS_UNUSED; kfilm->pass_sample_count = PASS_UNUSED; kfilm->pass_adaptive_aux_buffer = PASS_UNUSED; kfilm->pass_shadow_catcher = PASS_UNUSED; diff --git a/intern/cycles/scene/osl.cpp b/intern/cycles/scene/osl.cpp index 09626cb48bb..c5f38d4f270 100644 --- a/intern/cycles/scene/osl.cpp +++ b/intern/cycles/scene/osl.cpp @@ -326,17 +326,22 @@ bool OSLShaderManager::osl_compile(const string &inputfile, const string &output string stdosl_path; string shader_path = path_get("shader"); - /* specify output file name */ + /* Specify output file name. */ options.push_back("-o"); options.push_back(outputfile); - /* specify standard include path */ + /* Specify standard include path. */ string include_path_arg = string("-I") + shader_path; options.push_back(include_path_arg); stdosl_path = path_join(shader_path, "stdcycles.h"); - /* compile */ + /* Compile. + * + * Mutex protected because the OSL compiler does not appear to be thread safe, see T92503. */ + static thread_mutex osl_compiler_mutex; + thread_scoped_lock lock(osl_compiler_mutex); + OSL::OSLCompiler *compiler = new OSL::OSLCompiler(&OSL::ErrorHandler::default_handler()); bool ok = compiler->compile(string_view(inputfile), options, string_view(stdosl_path)); delete compiler; 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 */ |