0
0
forked from blender/blender
blender/intern/cycles/util
Weizhen Huang 9eabc20a48 Fix #126799: undefined behavior of shader node Arctan2 at (0, 0)
`atan2(0, 0)` is undefined on many platforms. To ensure consistent
result across platforms, we return `0` in this case.

Note only the behavior of the shader node `Artan2` is changed here.
During shading, we might still produce `atan2(0, 0)` internally and
cause different results across platforms, but that usually happens with
single samples and is not obvious, plus checking this condition all the
time is costly. If later we find out it's indeed necessary to change all
the invocation of `atan2(0, 0)`, we could change the wrapper functions
in `metal/compat.h` and `mtl_shader_defines.msl`.

Pull Request: blender/blender#126951
2024-09-12 15:08:41 +02:00
..
algorithm.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
aligned_malloc.cpp Build: fixes for OpenBSD 2023-05-09 13:19:16 +02:00
aligned_malloc.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
args.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
array.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
atomic.h Cycles: oneAPI: use local memory for faster shader sorting 2023-05-17 11:07:57 +02:00
boundbox.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
CMakeLists.txt Cycles: Remove OpenGL header 2022-12-02 17:19:00 +01:00
color.h Cycles: Avoid overhead from RNA when extracting mesh data 2023-04-03 17:04:58 +02:00
debug.cpp Cycles: Remove redundant MetalRT workaround & add two useful DebugFlags 2023-05-30 11:12:05 +02:00
debug.h Cycles: Remove redundant MetalRT workaround & add two useful DebugFlags 2023-05-30 11:12:05 +02:00
defines.h Cycles: Add basic support for using OSL with OptiX 2022-11-09 15:30:21 +01:00
deque.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
disjoint_set.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
foreach.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
function.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
guarded_allocator.cpp Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
guarded_allocator.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
guiding.h Cycles: add Path Guiding on CPU through Intel OpenPGL 2022-09-27 15:56:32 +02:00
half.h Cleanup: fix various Cycles compilar warnings 2023-04-05 19:48:19 +02:00
hash.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
ies.cpp Fix #106945: IES file parsing failures 2023-04-28 23:29:04 +02:00
ies.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
image_impl.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
image.h Cycles: load 8 bit image textures as half float for some color spaces 2022-06-02 18:04:38 +02:00
list.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
log.cpp Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
log.h Fix build error using WITH_CYCLES_LOGGING=OFF 2023-04-17 20:36:18 +02:00
map.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
math_cdf.cpp Cycles: Fix recently introduced off-by-one error in an assert 2023-01-10 02:10:20 +01:00
math_cdf.h Fix T88849: Motion blur in cycles leaves bright edge on trailing end of blur 2023-01-09 03:08:36 +01:00
math_fast.h Cycles: use intrinsics for fast_rint 2023-04-28 18:49:46 +02:00
math_float2.h Refactor: add reduce functions for float2 for consistency 2023-05-16 13:56:08 +02:00
math_float3.h Cycles: reduce mesh memory usage by unflattening 2023-02-27 10:39:19 +01:00
math_float4.h Fix mistake in Cycles float4 pow 2023-04-25 20:19:43 +02:00
math_float8.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
math_int2.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
math_int3.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
math_int4.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
math_int8.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
math_intersect.h Fix #107725: ray-offset was incorrectly applied on motion triangles 2023-05-08 19:11:11 +02:00
math_matrix.h Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
math.h Fix #126799: undefined behavior of shader node Arctan2 at (0, 0) 2024-09-12 15:08:41 +02:00
md5.cpp Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
md5.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
murmurhash.cpp Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
murmurhash.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
openimagedenoise.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
openvdb.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
optimization.h Cycles: remove SSE3 and AVX kernel optimization levels 2023-01-16 17:53:36 +01:00
param.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
path.cpp Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
path.h Cycles: Cache only up to 5 kernels of each type on Metal 2022-11-11 18:10:29 +00:00
profiling.cpp Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
profiling.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
progress.h Cycles: take into account time limit for progress bar 2022-08-11 19:37:18 +02:00
projection.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
queue.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
rect.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
semaphore.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
set.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
simd.cpp Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
simd.h Cycles: Support newer version of sse2neon 2023-04-28 17:36:02 +02:00
stack_allocator.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
static_assert.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
stats.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
string.cpp Cycles: Apple Silicon optimization to specialize intersection kernels 2022-07-15 13:40:04 +02:00
string.h Cycles: Apple Silicon optimization to specialize intersection kernels 2022-07-15 13:40:04 +02:00
system.cpp Cleanup: remove unused functions 2023-01-16 19:40:25 +01:00
system.h Cycles: remove SSE3 and AVX kernel optimization levels 2023-01-16 17:53:36 +01:00
task.cpp Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
task.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
tbb.h Fix T97498, T97651: crash in Cycles with TBB 2021 after recent changes 2022-04-28 00:24:13 +02:00
texture.h Images: add mirror extension type 2022-12-14 19:27:29 +01:00
thread.cpp Fix: Increase thread stack size for musl libc 2023-11-22 19:47:18 +01:00
thread.h Fix: Increase thread stack size for musl libc 2023-11-22 19:47:18 +01:00
time.cpp Cycles: unify math functions names 2022-06-23 15:02:53 +02:00
time.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
transform_avx2.cpp Cycles: make transform inverse match Embree exactly 2022-08-09 16:59:05 +02:00
transform_inverse.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
transform_sse41.cpp Cycles: make transform inverse match Embree exactly 2022-08-09 16:59:05 +02:00
transform.cpp Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
transform.h Cleanup: remove redundant lerp function, mix already does the same 2023-05-12 21:00:52 +02:00
types_float2_impl.h Cleanup: make vector types make/print functions consistent between CPU and GPU 2022-08-09 16:07:23 +02:00
types_float2.h Cleanup: make vector types make/print functions consistent between CPU and GPU 2022-08-09 16:07:23 +02:00
types_float3_impl.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_float3.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_float4_impl.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_float4.h Cleanup: make vector types make/print functions consistent between CPU and GPU 2022-08-09 16:07:23 +02:00
types_float8_impl.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_float8.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
types_int2_impl.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_int2.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_int3_impl.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_int3.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_int4_impl.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_int4.h Cleanup: make vector types make/print functions consistent between CPU and GPU 2022-08-09 16:07:23 +02:00
types_int8_impl.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_int8.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
types_spectrum.h Cycles: add new Spectrum and PackedSpectrum types 2022-08-09 16:49:34 +02:00
types_uchar2_impl.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uchar2.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uchar3_impl.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uchar3.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uchar4_impl.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uchar4.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uint2_impl.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uint2.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uint3_impl.h Cycles: reduce mesh memory usage by unflattening 2023-02-27 10:39:19 +01:00
types_uint3.h Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
types_uint4_impl.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_uint4.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types_ushort4.h Cleanup: simplifications and consistency for vector types 2022-07-28 21:27:13 +02:00
types.h Refactor: replace Cycles sse/avx types by vectorized float4/int4/float8/int8 2022-11-08 12:28:40 +01:00
unique_ptr.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
vector.h Cycles: add hardware raytracing support to oneAPI device 2023-04-18 22:09:42 +02:00
version.h Cycles: bump version to 3.6.0 2023-04-03 17:32:35 +02:00
windows.cpp Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
windows.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
xml.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00