blender/intern/cycles/bvh
Sergey Sharybin 04d55038ee Fix size_t -> int -> size_t round trip in Cycles
There are two things achieved by this change:

- No possible downcast of size_t to int when calculating motion steps.
- Disambiguate call to `min()` which was for some reason considered
  ambiguous on 32bit platforms `min(int, unsigned int)`.
- Do the same for the `max()` call to keep them symmetrical.

On an implementation side the `min()` is defined for a fixed width
integer type to disambiguate uint from size_t on 32bit platforms,
and yet be able to use it for 32bit operands on 64bit platforms without
upcast.

This ended up in a bit bigger change as the conditional compile-in of
functions is easiest if the functions is templated. Making the functions
templated required to remove the other source of ambiguity which is
`algorithm.h` which was pulling min/max from std.

Now it is the `math.h` which is the source of truth for min/max.
It was only one place which was relying on `algorithm.h` for these
functions, hence the choice of `math.h` as the safest and least
intrusive.

Fixes 32bit platforms (such as i386) in Debian package build system.

Differential Revision: https://developer.blender.org/D14062
2022-02-10 12:39:41 +01:00
..
binning.cpp Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
binning.h Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
build.cpp Cleanup: spelling in comments, C++ style comments for disabled code 2022-01-14 11:23:46 +11:00
build.h Cycles: pointcloud rendering 2021-12-16 20:54:04 +01:00
bvh.cpp Fix T94022: Both options GPU/CPU checked under preferences cause viewport render crash. (ARM/Metal) 2021-12-13 22:34:48 +00:00
bvh.h Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
bvh2.cpp Fix Cycles OptiX crash with 3D curves after point cloud changes 2021-12-20 14:14:43 +01:00
bvh2.h Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
CMakeLists.txt Cycles: Fix Metal BVH crash caused by missing WITH_METAL define 2021-12-07 21:23:52 +00:00
embree.cpp Fix size_t -> int -> size_t round trip in Cycles 2022-02-10 12:39:41 +01:00
embree.h Cycles: pointcloud rendering 2021-12-16 20:54:04 +01:00
metal.h Cycles: Metal host-side code 2021-12-07 15:52:21 +00:00
metal.mm Cycles: Metal host-side code 2021-12-07 15:52:21 +00:00
multi.cpp Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
multi.h Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
node.cpp Cleanup: fix typos in comments and docs 2021-11-19 13:02:16 +01:00
node.h Cleanup: fix typos in comments and docs 2021-11-19 13:02:16 +01:00
optix.cpp Fix T90308: Cycles crash copying memory from device to host 2021-11-22 17:26:59 +01:00
optix.h Fix T90308: Cycles crash copying memory from device to host 2021-11-22 17:26:59 +01:00
params.h Fix uninitialized value in Cycles BVH after recent changes 2022-02-04 20:27:49 +01:00
sort.cpp Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
sort.h Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00
split.cpp Fix Cycles OptiX crash with 3D curves after point cloud changes 2021-12-20 14:14:43 +01:00
split.h Cycles: pointcloud rendering 2021-12-16 20:54:04 +01:00
unaligned.cpp Fix Cycles OptiX crash with 3D curves after point cloud changes 2021-12-20 14:14:43 +01:00
unaligned.h Cycles: remove prefix from source code file names 2021-10-26 15:37:04 +02:00