-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblender.patch
More file actions
51 lines (47 loc) · 2.02 KB
/
blender.patch
File metadata and controls
51 lines (47 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/intern/cycles/kernel/film/data_passes.h b/intern/cycles/kernel/film/data_passes.h
index 0105ccdfbb9..acbc4fa0192 100644
--- a/intern/cycles/kernel/film/data_passes.h
+++ b/intern/cycles/kernel/film/data_passes.h
@@ -50,10 +50,6 @@ ccl_device_inline void film_write_data_passes(KernelGlobals kg,
if (!(path_flag & PATH_RAY_SINGLE_PASS_DONE)) {
if (INTEGRATOR_STATE(state, path, sample) == 0) {
- if (flag & PASSMASK(DEPTH)) {
- const float depth = camera_z_depth(kg, sd->P);
- film_overwrite_pass_float(buffer + kernel_data.film.pass_depth, depth);
- }
if (flag & PASSMASK(OBJECT_ID)) {
const float id = object_pass_id(kg, sd->object);
film_overwrite_pass_float(buffer + kernel_data.film.pass_object_id, id);
@@ -93,6 +89,13 @@ ccl_device_inline void film_write_data_passes(KernelGlobals kg,
}
}
+ if (flag & PASSMASK(DEPTH)) {
+ float old_depth = atomic_add_and_fetch_float(buffer + kernel_data.film.pass_depth, 0);
+ while (old_depth == 0.0f) {
+ old_depth = atomic_compare_and_swap_float(buffer + kernel_data.film.pass_depth, old_depth, camera_z_depth(kg, sd->P));
+ }
+ }
+
if (kernel_data.film.cryptomatte_passes) {
const Spectrum throughput = INTEGRATOR_STATE(state, path, throughput);
const float matte_weight = average(throughput) *
diff --git a/source/blender/python/intern/bpy_app.cc b/source/blender/python/intern/bpy_app.cc
index 14c6178bd48..eb3317a5abe 100644
--- a/source/blender/python/intern/bpy_app.cc
+++ b/source/blender/python/intern/bpy_app.cc
@@ -120,6 +120,8 @@ static PyStructSequence_Field app_info_fields[] = {
/* Modules (not struct sequence). */
{"icons", "Manage custom icons"},
{"timers", "Manage timers"},
+
+ {"tsr_depth", "Exists if built with TS1 Renderers depth patch"},
{nullptr},
};
@@ -207,6 +209,8 @@ static PyObject *make_app_info()
SetObjItem(BPY_app_icons_module());
SetObjItem(BPY_app_timers_module());
+ SetIntItem(1);
+
#undef SetIntItem
#undef SetStrItem
#undef SetBytesItem