diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-14 14:13:10 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-14 14:13:10 +0300 |
commit | 728f43d5850940b5469ff24064ae2a418e1f02f0 (patch) | |
tree | 4a9bf788d22fd82dca4475ab217ac3a9b577ed2c /intern/cycles/kernel | |
parent | a6b2ec0bc2315103717a75e7f0f3b3ccfad1ce63 (diff) | |
parent | 10fa3b790fb8fec3c99666fa1e3f2ca21773642b (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/filter/filter_nlm_gpu.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/kernel/filter/filter_nlm_gpu.h b/intern/cycles/kernel/filter/filter_nlm_gpu.h index cffd61cb7d1..058afb34a92 100644 --- a/intern/cycles/kernel/filter/filter_nlm_gpu.h +++ b/intern/cycles/kernel/filter/filter_nlm_gpu.h @@ -39,8 +39,11 @@ ccl_device_inline bool get_nlm_coords_window(int w, int h, int r, int stride, /* Pixels still need to lie inside the denoising buffer after applying the offset, * so determine the area for which this is the case. */ - *rect = make_int4(max(0, -co->z), max(0, -co->w), - w - max(0, co->z), h - max(0, co->w)); + int dx = sx - r; + int dy = sy - r; + + *rect = make_int4(max(0, -dx), max(0, -dy), + w - max(0, dx), h - max(0, dy)); /* Find the intersection of the area that we want to process (window) and the area * that can be processed (rect) to get the final area for this offset. */ @@ -58,7 +61,7 @@ ccl_device_inline bool get_nlm_coords_window(int w, int h, int r, int stride, return false; } - *co = make_int4(x, y, sx - r, sy - r); + *co = make_int4(x, y, dx, dy); *ofs = (sy*s + sx) * stride; |