[Bf-blender-cvs] [80484794165] compositor-full-frame: Avoid using `floor` function

Manuel Castilla noreply at git.blender.org
Sun Aug 8 17:13:03 CEST 2021


Commit: 80484794165c8a0a62dcb6309c111dede6f0c9be
Author: Manuel Castilla
Date:   Fri Aug 6 21:24:11 2021 +0200
Branches: compositor-full-frame
https://developer.blender.org/rB80484794165c8a0a62dcb6309c111dede6f0c9be

Avoid using `floor` function

It has an impact in performance when used in deep loops.
If area have negative coordinates it will round
toward zero but buffers should be displaced later on to always
work with positive coordinates.

===================================================================

M	source/blender/compositor/intern/COM_MemoryBuffer.h

===================================================================

diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h
index 4e27338eea1..de00ba4737b 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.h
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.h
@@ -210,7 +210,7 @@ class MemoryBuffer {
       clear_elem(out);
     }
     else {
-      read_elem(floor(x), floor(y), out);
+      read_elem(x, y, out);
     }
   }



More information about the Bf-blender-cvs mailing list