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
This commit is contained in:
Brecht Van Lommel
2025-08-19 18:41:53 +02:00
committed by Brecht Van Lommel
parent b5606b5634
commit 28f93d5443
2 changed files with 6 additions and 6 deletions

View File

@@ -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)
{

View File

@@ -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)
{