diff --git a/intern/cycles/device/cpu/device_impl.cpp b/intern/cycles/device/cpu/device_impl.cpp index 83c261919d9..e9f0f56ed0c 100644 --- a/intern/cycles/device/cpu/device_impl.cpp +++ b/intern/cycles/device/cpu/device_impl.cpp @@ -187,15 +187,11 @@ void CPUDevice::const_copy_to(const char *name, void *host, const size_t size) if (strcmp(name, "data") == 0) { assert(size <= sizeof(KernelData)); - // Update scene handle (since it is different for each device on multi devices) + /* Update scene handle (since it is different for each device on multi devices). + * This must be a raw pointer copy since at some points during scene update this + * pointer may be invalid. */ KernelData *const data = (KernelData *)host; - data->device_bvh = -# if RTC_VERSION >= 40400 - rtcGetSceneTraversable(embree_scene) -# else - embree_scene -# endif - ; + data->device_bvh = embree_traversable; } #endif kernel_const_copy(&kernel_globals, name, host, size); @@ -272,7 +268,11 @@ void CPUDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) } if (bvh->params.top_level) { - embree_scene = bvh_embree->scene; +# if RTC_VERSION >= 40400 + embree_traversable = rtcGetSceneTraversable(bvh_embree->scene); +# else + embree_traversable = bvh_embree->scene; +# endif } } else diff --git a/intern/cycles/device/cpu/device_impl.h b/intern/cycles/device/cpu/device_impl.h index e63a9bce014..bb5939d3d01 100644 --- a/intern/cycles/device/cpu/device_impl.h +++ b/intern/cycles/device/cpu/device_impl.h @@ -45,7 +45,11 @@ class CPUDevice : public Device { OSLGlobals osl_globals; #endif #ifdef WITH_EMBREE - RTCScene embree_scene = nullptr; +# if RTC_VERSION >= 40400 + RTCTraversable embree_traversable = nullptr; +# else + RTCScene embree_traversable = nullptr; +# endif RTCDevice embree_device; #endif #if defined(WITH_PATH_GUIDING) diff --git a/intern/cycles/device/oneapi/device_impl.cpp b/intern/cycles/device/oneapi/device_impl.cpp index dfa46924975..9064b8d41a0 100644 --- a/intern/cycles/device/oneapi/device_impl.cpp +++ b/intern/cycles/device/oneapi/device_impl.cpp @@ -46,15 +46,7 @@ static void queue_error_cb(const char *message, void *user_ptr) } OneapiDevice::OneapiDevice(const DeviceInfo &info, Stats &stats, Profiler &profiler, bool headless) - : GPUDevice(info, stats, profiler, headless), - device_queue_(nullptr), -# ifdef WITH_EMBREE_GPU - embree_device(nullptr), - embree_scene(nullptr), -# endif - kg_memory_(nullptr), - kg_memory_device_(nullptr), - kg_memory_size_(0) + : GPUDevice(info, stats, profiler, headless) { /* Verify that base class types can be used with specific backend types */ static_assert(sizeof(texMemObject) == @@ -189,7 +181,11 @@ void OneapiDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) # endif if (bvh->params.top_level) { - embree_scene = bvh_embree->scene; +# if RTC_VERSION >= 40400 + embree_traversable = rtcGetSceneTraversable(bvh_embree->scene); +# else + embree_traversable = bvh_embree->scene; +# endif # if RTC_VERSION >= 40302 RTCError error_code = bvh_embree->offload_scenes_to_gpu(all_embree_scenes); if (error_code != RTC_ERROR_NONE) { @@ -593,18 +589,14 @@ void OneapiDevice::const_copy_to(const char *name, void *host, const size_t size << string_human_readable_size(size) << ")"; # ifdef WITH_EMBREE_GPU - if (embree_scene != nullptr && strcmp(name, "data") == 0) { + if (embree_traversable != nullptr && strcmp(name, "data") == 0) { assert(size <= sizeof(KernelData)); - /* Update scene handle(since it is different for each device on multi devices) */ + /* Update scene handle(since it is different for each device on multi devices). + * This must be a raw pointer copy since at some points during scene update this + * pointer may be invalid. */ KernelData *const data = (KernelData *)host; - data->device_bvh = -# if RTC_VERSION >= 40400 - rtcGetSceneTraversable(embree_scene) -# else - embree_scene -# endif - ; + data->device_bvh = embree_traversable; /* We need this number later for proper local memory allocation. */ scene_max_shaders_ = data->max_shaders; diff --git a/intern/cycles/device/oneapi/device_impl.h b/intern/cycles/device/oneapi/device_impl.h index 5871c3282f2..bf93f9e48a9 100644 --- a/intern/cycles/device/oneapi/device_impl.h +++ b/intern/cycles/device/oneapi/device_impl.h @@ -20,10 +20,14 @@ using OneAPIDeviceIteratorCallback = class OneapiDevice : public GPUDevice { private: - SyclQueue *device_queue_; + SyclQueue *device_queue_ = nullptr; # ifdef WITH_EMBREE_GPU - RTCDevice embree_device; - RTCScene embree_scene; + RTCDevice embree_device = nullptr; +# if RTC_VERSION >= 40400 + RTCTraversable embree_traversable = nullptr; +# else + RTCScene embree_traversable = nullptr; +# endif # if RTC_VERSION >= 40302 thread_mutex scene_data_mutex; vector all_embree_scenes; @@ -31,10 +35,10 @@ class OneapiDevice : public GPUDevice { # endif using ConstMemMap = map>>; ConstMemMap const_mem_map_; - void *kg_memory_; - void *kg_memory_device_; - size_t kg_memory_size_ = (size_t)0; - size_t max_memory_on_device_ = (size_t)0; + void *kg_memory_ = nullptr; + void *kg_memory_device_ = nullptr; + size_t kg_memory_size_ = 0; + size_t max_memory_on_device_ = 0; std::string oneapi_error_string_; bool use_hardware_raytracing = false; unsigned int kernel_features = 0; diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio index 1a3c5d14f00..ff19bbe9b51 100644 --- a/release/datafiles/colormanagement/config.ocio +++ b/release/datafiles/colormanagement/config.ocio @@ -95,7 +95,7 @@ colorspaces: - ! name: Linear CIE-XYZ D65 - aliases: [cie_xyz_d65, CIE-XYZ-D65, XYZ, Linear CIE-XYZ I-D65] + aliases: [cie_xyz_d65, CIE-XYZ-D65, XYZ, Linear CIE-XYZ I-D65, lin_ciexyzd65_scene] family: Chromaticity equalitygroup: bitdepth: 32f @@ -106,7 +106,7 @@ colorspaces: - ! name: Linear Rec.709 - aliases: [Linear, Linear BT.709, Linear BT.709 I-D65, Linear Tristimulus, linrec709, Utility - Linear - sRGB, Utility - Linear - Rec.709, lin_srgb, Linear Rec.709 (sRGB), lin_rec709_srgb, lin_rec709, lin_srgb, "CGI: Linear - Rec.709"] + aliases: [Linear, Linear BT.709, Linear BT.709 I-D65, Linear Tristimulus, linrec709, Utility - Linear - sRGB, Utility - Linear - Rec.709, lin_srgb, Linear Rec.709 (sRGB), lin_rec709_srgb, lin_rec709, lin_srgb, lin_rec709_scene, "CGI: Linear - Rec.709"] family: Linear equalitygroup: bitdepth: 32f @@ -120,7 +120,7 @@ colorspaces: - ! name: Linear DCI-P3 D65 - aliases: [Linear DCI-P3 I-D65, Linear P3-D65, lin_p3d65, Utility - Linear - P3-D65, Apple DCI-P3 D65] + aliases: [Linear DCI-P3 I-D65, Linear P3-D65, lin_p3d65, lin_p3d65_scene, Utility - Linear - P3-D65, Apple DCI-P3 D65] family: Linear equalitygroup: bitdepth: 32f @@ -134,7 +134,7 @@ colorspaces: - ! name: Linear Rec.2020 - aliases: [Linear BT.2020 I-D65, Linear BT.2020, lin_rec2020, Utility - Linear - Rec.2020] + aliases: [Linear BT.2020 I-D65, Linear BT.2020, lin_rec2020, lin_rec2020_scene, Utility - Linear - Rec.2020] family: Linear equalitygroup: bitdepth: 32f @@ -148,7 +148,7 @@ colorspaces: - ! name: ACES2065-1 - aliases: [Linear ACES, aces2065_1, ACES - ACES2065-1, lin_ap0, "ACES: Linear - AP0"] + aliases: [Linear ACES, aces2065_1, ACES - ACES2065-1, lin_ap0, lin_ap0_scene, "ACES: Linear - AP0"] family: Linear equalitygroup: bitdepth: 32f @@ -162,7 +162,7 @@ colorspaces: - ! name: ACEScg - aliases: [Linear ACEScg, lin_ap1, ACES - ACEScg, "ACEScg: Linear - AP1"] + aliases: [Linear ACEScg, lin_ap1, lin_ap1_scene, ACES - ACEScg, "ACEScg: Linear - AP1"] family: Linear equalitygroup: bitdepth: 32f @@ -190,7 +190,7 @@ colorspaces: - ! name: sRGB - aliases: [sRGB 2.2, sRGB I-D65, srgb_display, sRGB - Display, g22_rec709, Utility - Gamma 2.2 - Rec.709 - Texture, Utility - sRGB - Texture, sRGB - Texture, srgb_tx, srgb_texture, Input - Generic - sRGB - Texture, "sRGB Display: 2.2 Gamma - Rec.709"] + aliases: [sRGB 2.2, sRGB I-D65, srgb_display, srgb_rec709_scene, sRGB - Display, g22_rec709, Utility - Gamma 2.2 - Rec.709 - Texture, Utility - sRGB - Texture, sRGB - Texture, srgb_tx, srgb_texture, Input - Generic - sRGB - Texture, "sRGB Display: 2.2 Gamma - Rec.709"] family: Display equalitygroup: bitdepth: 32f @@ -758,4 +758,4 @@ looks: style: log contrast: {rgb: [0.7, 0.7, 0.7], master: 1} saturation: 1.15 - pivot: {contrast: -0.2} \ No newline at end of file + pivot: {contrast: -0.2}