Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2021-01-22 16:32:01 +0300
committerSergey Sharybin <sergey@blender.org>2021-01-22 16:32:01 +0300
commit7e32bb849265bde7dc58fdf698fd876af6b1dfd6 (patch)
tree1a70631a44e068ec48e3e765b8812f70ef6ecab8 /intern
parent18e063b69db3f810dae9753030111c1a2ea67117 (diff)
parent226eb5e3668699e7b1d9c985a2b79ac49020befc (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h b/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h
index 79e3a16ef19..d87e5f193ad 100644
--- a/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h
+++ b/intern/cycles/kernel/kernels/opencl/kernel_opencl_image.h
@@ -15,7 +15,20 @@
*/
#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 mathermatical 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`). */
+typedef struct ccl_vdb_double_t {
+ uint64_t i;
+} ccl_vdb_double_t;
+
+# define double ccl_vdb_double_t
# include "nanovdb/CNanoVDB.h"
+# undef double
#endif
/* For OpenCL we do manual lookup and interpolation. */