2023-06-14 16:52:36 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
|
/* CPU kernel entry points */
|
|
|
|
|
|
2024-02-26 14:49:19 +01:00
|
|
|
/* On x86-64, our minimum is SSE4.2, so avoid the extra kernel and compile this
|
|
|
|
|
* one with SSE4.2 intrinsics.
|
2016-03-25 16:09:05 +01:00
|
|
|
*/
|
2015-12-30 17:54:02 +05:00
|
|
|
#if defined(__x86_64__) || defined(_M_X64)
|
2022-11-01 15:16:55 +01:00
|
|
|
# define __KERNEL_SSE__
|
2016-02-12 18:33:43 +01:00
|
|
|
# define __KERNEL_SSE2__
|
2024-02-26 14:49:19 +01:00
|
|
|
# define __KERNEL_SSE3__
|
|
|
|
|
# define __KERNEL_SSSE3__
|
|
|
|
|
# define __KERNEL_SSE42__
|
2015-12-30 17:54:02 +05:00
|
|
|
#endif
|
|
|
|
|
|
2016-03-25 16:09:05 +01:00
|
|
|
/* When building kernel for native machine detect kernel features from the flags
|
|
|
|
|
* set by compiler.
|
|
|
|
|
*/
|
|
|
|
|
#ifdef WITH_KERNEL_NATIVE
|
2024-02-09 17:25:58 +01:00
|
|
|
# ifdef __SSE4_2__
|
2024-02-26 14:49:19 +01:00
|
|
|
# ifndef __KERNEL_SSE42__
|
|
|
|
|
# define __KERNEL_SSE42__
|
|
|
|
|
# endif
|
2016-03-25 16:09:05 +01:00
|
|
|
# endif
|
|
|
|
|
# ifdef __AVX__
|
2022-11-01 15:16:55 +01:00
|
|
|
# ifndef __KERNEL_SSE__
|
|
|
|
|
# define __KERNEL_SSE__
|
|
|
|
|
# endif
|
2016-03-25 16:09:05 +01:00
|
|
|
# define __KERNEL_AVX__
|
|
|
|
|
# endif
|
|
|
|
|
# ifdef __AVX2__
|
2022-11-01 15:16:55 +01:00
|
|
|
# ifndef __KERNEL_SSE__
|
|
|
|
|
# define __KERNEL_SSE__
|
|
|
|
|
# endif
|
2016-03-25 16:09:05 +01:00
|
|
|
# define __KERNEL_AVX2__
|
|
|
|
|
# endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-12-30 17:54:02 +05:00
|
|
|
/* quiet unused define warnings */
|
|
|
|
|
#if defined(__KERNEL_SSE2__)
|
|
|
|
|
/* do nothing */
|
|
|
|
|
#endif
|
|
|
|
|
|
2024-12-29 23:13:45 +01:00
|
|
|
#include "kernel/device/cpu/globals.h"
|
|
|
|
|
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
#include "kernel/device/cpu/kernel.h"
|
2015-12-30 17:54:02 +05:00
|
|
|
#define KERNEL_ARCH cpu
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
#include "kernel/device/cpu/kernel_arch_impl.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
/* Memory Copy */
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
void kernel_const_copy(KernelGlobalsCPU *kg, const char *name, void *host, size_t /*unused*/)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2022-06-17 17:16:37 +02:00
|
|
|
if (strcmp(name, "data") == 0) {
|
|
|
|
|
kg->data = *(KernelData *)host;
|
2020-06-24 17:08:01 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2011-04-27 11:58:34 +00:00
|
|
|
assert(0);
|
2020-06-24 17:08:01 +02:00
|
|
|
}
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
void kernel_global_memory_copy(KernelGlobalsCPU *kg,
|
|
|
|
|
const char *name,
|
|
|
|
|
void *mem,
|
|
|
|
|
const size_t size)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2024-12-26 17:53:59 +01:00
|
|
|
if (false) {
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
2011-09-27 20:37:24 +00:00
|
|
|
|
2022-06-17 17:16:37 +02:00
|
|
|
#define KERNEL_DATA_ARRAY(type, tname) \
|
2011-09-27 20:37:24 +00:00
|
|
|
else if (strcmp(name, #tname) == 0) { \
|
|
|
|
|
kg->tname.data = (type *)mem; \
|
2017-10-20 23:31:13 +02:00
|
|
|
kg->tname.width = size; \
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
2022-06-17 17:16:37 +02:00
|
|
|
#include "kernel/data_arrays.h"
|
2017-10-06 21:47:41 +02:00
|
|
|
else {
|
2011-04-27 11:58:34 +00:00
|
|
|
assert(0);
|
2017-10-06 21:47:41 +02:00
|
|
|
}
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCL_NAMESPACE_END
|