diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-14 21:58:02 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-14 21:59:08 +0400 |
commit | 8fd6879b88273ded24ab647ee76a116efb4a18c2 (patch) | |
tree | 0fa904aed80b1242d538bf9c02b7f1761b7e56f2 /source/blender | |
parent | 4f00737f4b0457e31611f32bcafbf78867487c85 (diff) |
Fix T39700: Plane deform still works forever
Clamped the EWA sampling region to buffer size now. Solves the issue,
but needs more tests to be sure weights are correct.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 74991738d7a..aa2a5475d38 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -295,7 +295,12 @@ void MemoryBuffer::readEWA(float result[4], const float uv[2], const float deriv zero_v4(result); return; } - /* TODO(sergey): Consider clamping u1/v1/u2/v2 to the m_rect. */ + + /* Clamp sampling rectagle to the buffer dimensions. */ + u1 = max_ii(u1, m_rect.xmin); + u2 = min_ii(u2, m_rect.xmax); + v1 = max_ii(v1, m_rect.ymin); + v2 = min_ii(v2, m_rect.ymax); float DDQ = 2.0f * A; float U = u1 - U0; |