From 28f93d544301b3dd8201350dc0cdd70bfdd3f29c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 19 Aug 2025 18:41:53 +0200 Subject: [PATCH] Fix #144569: Cycles NanoVDB rendering broken with oneAPI Wrong assumption about packed_int3, and not caught because the assert was in the wrong place. Pull Request: https://projects.blender.org/blender/blender/pulls/144803 --- intern/cycles/util/types_int3.h | 6 +++--- intern/cycles/util/types_uint3.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/intern/cycles/util/types_int3.h b/intern/cycles/util/types_int3.h index 745c7de4e46..d170c066a0b 100644 --- a/intern/cycles/util/types_int3.h +++ b/intern/cycles/util/types_int3.h @@ -98,8 +98,8 @@ ccl_device_inline void print_int3(const ccl_private char *label, const int3 a) #if defined(__KERNEL_METAL__) /* Metal has native packed_int3. */ -#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_ONEAPI__) -/* CUDA and oneAPI int3 are already packed. */ +#elif defined(__KERNEL_CUDA__) +/* CUDA is already packed. */ typedef int3 packed_int3; #else /* HIP int3 is not packed (https://github.com/ROCm-Developer-Tools/HIP/issues/706). */ @@ -140,9 +140,9 @@ struct packed_int3 { } # endif }; +#endif static_assert(sizeof(packed_int3) == 12, "packed_int3 expected to be exactly 12 bytes"); -#endif ccl_device_inline packed_int3 make_packed_int3(const int x, const int y, int z) { diff --git a/intern/cycles/util/types_uint3.h b/intern/cycles/util/types_uint3.h index c78d2f00c19..7b9dda8022b 100644 --- a/intern/cycles/util/types_uint3.h +++ b/intern/cycles/util/types_uint3.h @@ -36,8 +36,8 @@ ccl_device_inline uint3 make_uint3(const uint x, const uint y, uint z) #if defined(__KERNEL_METAL__) /* Metal has native packed_float3. */ -#elif defined(__KERNEL_CUDA__) || defined(__KERNEL_ONEAPI__) -/* CUDA and oneAPI uint3 are already packed. */ +#elif defined(__KERNEL_CUDA__) +/* CUDA uint3 is already packed. */ using packed_uint3 = uint3; #else /* HIP uint3 is not packed (https://github.com/ROCm-Developer-Tools/HIP/issues/706). */ @@ -78,9 +78,9 @@ struct packed_uint3 { } # endif }; +#endif static_assert(sizeof(packed_uint3) == 12, "packed_uint3 expected to be exactly 12 bytes"); -#endif ccl_device_inline packed_uint3 make_packed_uint3(const uint x, const uint y, uint z) {