From 3a57b97eba949047ba874149849fe64fcfbcc855 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 26 Dec 2024 17:53:59 +0100 Subject: [PATCH] Cleanup: Cycles: Remove unneeded oneAPI double emulation for NanoVDB Pull Request: https://projects.blender.org/blender/blender/pulls/132361 --- .../kernel/device/oneapi/context_begin.h | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/intern/cycles/kernel/device/oneapi/context_begin.h b/intern/cycles/kernel/device/oneapi/context_begin.h index 86532635f2c..8f705983567 100644 --- a/intern/cycles/kernel/device/oneapi/context_begin.h +++ b/intern/cycles/kernel/device/oneapi/context_begin.h @@ -2,41 +2,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#ifdef WITH_NANOVDB -/* Data type to replace `double` used in the NanoVDB headers. Cycles don't need doubles, and is - * safer and more portable to never use double datatype on GPU. - * Use a special structure, so that the following is true: - * - No unnoticed implicit cast or mathematical operations used on scalar 64bit type - * (which rules out trick like using `uint64_t` as a drop-in replacement for double). - * - Padding rules are matching exactly `double` - * (which rules out array of `uint8_t`). */ -struct ccl_vdb_double_t { - union ccl_vdb_helper_t { - double d; - uint64_t i; - }; - - uint64_t i; - ccl_vdb_double_t(double value) - { - ccl_vdb_helper_t helper; - helper.d = value; - i = helper.i; - } - /* We intentionally allow conversion to float in order to workaround compilation errors - * for defined math functions that take doubles. */ - operator float() const - { - ccl_vdb_helper_t helper; - helper.i = i; - return (float)helper.d; - } -}; - -# define double ccl_vdb_double_t -# include "kernel/util/nanovdb.h" -# undef double -#endif +#include "kernel/util/nanovdb.h" /* clang-format off */ struct ONEAPIKernelContext : public KernelGlobalsGPU {