2020-09-04 16:41:10 +00:00
|
|
|
# Copyright 2011-2020 Blender Foundation
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2015-03-27 10:55:58 +00:00
|
|
|
remove_extra_strict_flags()
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(INC
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 18:39:14 +00:00
|
|
|
..
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2012-10-17 04:13:03 +00:00
|
|
|
|
2012-09-20 09:04:43 +00:00
|
|
|
set(INC_SYS
|
2012-10-17 04:13:03 +00:00
|
|
|
|
2012-09-20 09:04:43 +00:00
|
|
|
)
|
2011-11-08 20:27:37 +00:00
|
|
|
|
2017-10-07 12:08:02 +00:00
|
|
|
set(SRC_CPU_KERNELS
|
2015-05-21 12:40:04 +00:00
|
|
|
kernels/cpu/kernel.cpp
|
2017-05-16 19:27:57 +00:00
|
|
|
kernels/cpu/kernel_sse2.cpp
|
|
|
|
kernels/cpu/kernel_sse3.cpp
|
|
|
|
kernels/cpu/kernel_sse41.cpp
|
|
|
|
kernels/cpu/kernel_avx.cpp
|
|
|
|
kernels/cpu/kernel_avx2.cpp
|
2017-02-14 11:20:48 +00:00
|
|
|
kernels/cpu/kernel_split.cpp
|
2017-05-16 19:27:57 +00:00
|
|
|
kernels/cpu/kernel_split_sse2.cpp
|
|
|
|
kernels/cpu/kernel_split_sse3.cpp
|
|
|
|
kernels/cpu/kernel_split_sse41.cpp
|
|
|
|
kernels/cpu/kernel_split_avx.cpp
|
|
|
|
kernels/cpu/kernel_split_avx2.cpp
|
2017-05-07 12:40:58 +00:00
|
|
|
kernels/cpu/filter.cpp
|
2017-05-16 19:27:57 +00:00
|
|
|
kernels/cpu/filter_sse2.cpp
|
|
|
|
kernels/cpu/filter_sse3.cpp
|
|
|
|
kernels/cpu/filter_sse41.cpp
|
|
|
|
kernels/cpu/filter_avx.cpp
|
|
|
|
kernels/cpu/filter_avx2.cpp
|
2017-10-07 12:08:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(SRC_CUDA_KERNELS
|
|
|
|
kernels/cuda/kernel.cu
|
|
|
|
kernels/cuda/kernel_split.cu
|
|
|
|
kernels/cuda/filter.cu
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SRC_OPENCL_KERNELS
|
2020-03-05 11:05:42 +00:00
|
|
|
kernels/opencl/kernel_adaptive_stopping.cl
|
|
|
|
kernels/opencl/kernel_adaptive_filter_x.cl
|
|
|
|
kernels/opencl/kernel_adaptive_filter_y.cl
|
|
|
|
kernels/opencl/kernel_adaptive_adjust_samples.cl
|
2019-02-19 15:31:31 +00:00
|
|
|
kernels/opencl/kernel_bake.cl
|
2019-02-20 13:41:56 +00:00
|
|
|
kernels/opencl/kernel_base.cl
|
2019-02-19 15:31:31 +00:00
|
|
|
kernels/opencl/kernel_displace.cl
|
|
|
|
kernels/opencl/kernel_background.cl
|
2017-03-04 11:29:01 +00:00
|
|
|
kernels/opencl/kernel_state_buffer_size.cl
|
Cycles: Support multithreaded compilation of kernels
This patch implements a workaround to get the multithreaded compilation from D2231 working.
So far, it only works for Blender, not for Cycles Standalone. Also, I have only tested the Linux codepath in the helper function.
Depends on D2231.
Patch by lukasstockner97, jbakker, brecht
job | scene_name | compilation_time
----------+-----------------+------------------
Baseline | empty | 22.73
D2264 | empty | 13.94
Baseline | bmw | 56.44
D2264 | bmw | 41.32
Baseline | fishycat | 59.50
D2264 | fishycat | 45.19
Baseline | barbershop | 212.28
D2264 | barbershop | 169.81
Baseline | victor | 67.51
D2264 | victor | 53.60
Baseline | classroom | 51.46
D2264 | classroom | 39.02
Baseline | koro | 62.48
D2264 | koro | 49.03
Baseline | pavillion | 54.37
D2264 | pavillion | 38.82
Baseline | splash279 | 47.43
D2264 | splash279 | 37.94
Baseline | volume_emission | 145.22
D2264 | volume_emission | 121.10
This patch reduced compilation time as the split kernels and base
kernels are compiled in parallel. In cycles debug mode (256) you can set
unmark the opencl single program file, what reduces the compilation time
even further (bmw 17 seconds, barbershop 53 seconds).
Reviewers: brecht, dingto, sergey, juicyfruit, lukasstockner97
Reviewed By: brecht
Subscribers: Loner, jbakker, candreacchio, 3dLuver, LazyDodo, bliblubli
Differential Revision: https://developer.blender.org/D2264
2019-02-15 07:18:38 +00:00
|
|
|
kernels/opencl/kernel_split_bundle.cl
|
2015-05-21 12:40:04 +00:00
|
|
|
kernels/opencl/kernel_data_init.cl
|
2017-03-01 06:05:55 +00:00
|
|
|
kernels/opencl/kernel_path_init.cl
|
2015-05-21 12:40:04 +00:00
|
|
|
kernels/opencl/kernel_queue_enqueue.cl
|
|
|
|
kernels/opencl/kernel_scene_intersect.cl
|
|
|
|
kernels/opencl/kernel_lamp_emission.cl
|
2017-03-08 14:42:26 +00:00
|
|
|
kernels/opencl/kernel_do_volume.cl
|
|
|
|
kernels/opencl/kernel_indirect_background.cl
|
2017-05-03 13:30:45 +00:00
|
|
|
kernels/opencl/kernel_shader_setup.cl
|
|
|
|
kernels/opencl/kernel_shader_sort.cl
|
2015-05-21 12:40:04 +00:00
|
|
|
kernels/opencl/kernel_shader_eval.cl
|
|
|
|
kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl
|
2017-03-08 14:42:26 +00:00
|
|
|
kernels/opencl/kernel_subsurface_scatter.cl
|
2015-05-21 12:40:04 +00:00
|
|
|
kernels/opencl/kernel_direct_lighting.cl
|
2017-03-08 16:39:40 +00:00
|
|
|
kernels/opencl/kernel_shadow_blocked_ao.cl
|
|
|
|
kernels/opencl/kernel_shadow_blocked_dl.cl
|
2017-05-30 00:40:26 +00:00
|
|
|
kernels/opencl/kernel_enqueue_inactive.cl
|
2015-05-21 12:40:04 +00:00
|
|
|
kernels/opencl/kernel_next_iteration_setup.cl
|
2017-03-08 14:42:26 +00:00
|
|
|
kernels/opencl/kernel_indirect_subsurface.cl
|
|
|
|
kernels/opencl/kernel_buffer_update.cl
|
2017-05-07 12:40:58 +00:00
|
|
|
kernels/opencl/filter.cl
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2019-09-12 12:50:06 +00:00
|
|
|
set(SRC_OPTIX_KERNELS
|
|
|
|
kernels/optix/kernel_optix.cu
|
|
|
|
)
|
|
|
|
|
2016-07-11 10:28:45 +00:00
|
|
|
set(SRC_BVH_HEADERS
|
|
|
|
bvh/bvh.h
|
|
|
|
bvh/bvh_nodes.h
|
2016-07-11 10:31:25 +00:00
|
|
|
bvh/bvh_shadow_all.h
|
2017-10-30 19:25:08 +00:00
|
|
|
bvh/bvh_local.h
|
2016-07-11 10:28:45 +00:00
|
|
|
bvh/bvh_traversal.h
|
2016-09-19 11:00:41 +00:00
|
|
|
bvh/bvh_types.h
|
2021-04-15 14:36:35 +00:00
|
|
|
bvh/bvh_util.h
|
2016-07-11 10:28:45 +00:00
|
|
|
bvh/bvh_volume.h
|
|
|
|
bvh/bvh_volume_all.h
|
2018-11-07 11:58:12 +00:00
|
|
|
bvh/bvh_embree.h
|
2016-07-11 10:28:45 +00:00
|
|
|
)
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_HEADERS
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kernel_accumulate.h
|
2020-03-05 11:05:42 +00:00
|
|
|
kernel_adaptive_sampling.h
|
2014-05-19 12:57:55 +00:00
|
|
|
kernel_bake.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_camera.h
|
2018-06-15 08:06:32 +00:00
|
|
|
kernel_color.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_compat_cpu.h
|
|
|
|
kernel_compat_cuda.h
|
2019-09-12 12:50:06 +00:00
|
|
|
kernel_compat_optix.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_compat_opencl.h
|
|
|
|
kernel_differential.h
|
|
|
|
kernel_emission.h
|
|
|
|
kernel_film.h
|
|
|
|
kernel_globals.h
|
2018-10-28 09:37:41 +00:00
|
|
|
kernel_id_passes.h
|
2013-06-07 16:06:22 +00:00
|
|
|
kernel_jitter.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_light.h
|
Cycles: Add new Sky Texture method including direct sunlight
This commit adds a new model to the Sky Texture node, which is based on a
method by Nishita et al. and works by basically simulating volumetric
scattering in the atmosphere.
By making some approximations (such as only considering single scattering),
we get a fairly simple and fast simulation code that takes into account
Rayleigh and Mie scattering as well as Ozone absorption.
This code is used to precompute a 512x128 texture which is then looked up
during render time, and is fast enough to allow real-time tweaking in the
viewport.
Due to the nature of the simulation, it exposes several parameters that
allow for lots of flexibility in choosing the look and matching real-world
conditions (such as Air/Dust/Ozone density and altitude).
Additionally, the same volumetric approach can be used to compute absorption
of the direct sunlight, so the model also supports adding direct sunlight.
This makes it significantly easier to set up Sun+Sky illumination where
the direction, intensity and color of the sun actually matches the sky.
In order to support properly sampling the direct sun component, the commit
also adds logic for sampling a specific area to the kernel light sampling
code. This is combined with portal and background map sampling using MIS.
This sampling logic works for the common case of having one Sky texture
going into the Background shader, but if a custom input to the Vector
node is used or if there are multiple Sky textures, it falls back to using
only background map sampling (while automatically setting the resolution to
4096x2048 if auto resolution is used).
More infos and preview can be found here:
https://docs.google.com/document/d/1gQta0ygFWXTrl5Pmvl_nZRgUw0mWg0FJeRuNKS36m08/view
Underlying model, implementation and documentation by Marco (@nacioss).
Improvements, cleanup and sun sampling by @lukasstockner.
Differential Revision: https://developer.blender.org/D7896
2020-06-17 18:27:10 +00:00
|
|
|
kernel_light_background.h
|
|
|
|
kernel_light_common.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_math.h
|
|
|
|
kernel_montecarlo.h
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
kernel_passes.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_path.h
|
2015-06-15 21:02:42 +00:00
|
|
|
kernel_path_branched.h
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
kernel_path_common.h
|
2013-09-08 18:59:39 +00:00
|
|
|
kernel_path_state.h
|
2014-04-04 12:35:30 +00:00
|
|
|
kernel_path_surface.h
|
2017-03-08 14:42:26 +00:00
|
|
|
kernel_path_subsurface.h
|
2014-04-04 12:35:30 +00:00
|
|
|
kernel_path_volume.h
|
2018-11-29 01:06:30 +00:00
|
|
|
kernel_profiling.h
|
2012-05-07 20:37:48 +00:00
|
|
|
kernel_projection.h
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
kernel_queues.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_random.h
|
|
|
|
kernel_shader.h
|
2013-12-28 01:56:53 +00:00
|
|
|
kernel_shadow.h
|
2013-04-01 20:26:52 +00:00
|
|
|
kernel_subsurface.h
|
2011-05-20 12:26:01 +00:00
|
|
|
kernel_textures.h
|
2011-11-08 20:27:37 +00:00
|
|
|
kernel_types.h
|
2013-12-28 15:56:19 +00:00
|
|
|
kernel_volume.h
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
kernel_work_stealing.h
|
2019-12-04 18:57:28 +00:00
|
|
|
kernel_write_passes.h
|
2015-12-30 13:51:35 +00:00
|
|
|
)
|
2015-12-30 12:54:02 +00:00
|
|
|
|
2015-12-30 13:51:35 +00:00
|
|
|
set(SRC_KERNELS_CPU_HEADERS
|
|
|
|
kernel.h
|
2015-12-30 12:54:02 +00:00
|
|
|
kernels/cpu/kernel_cpu.h
|
|
|
|
kernels/cpu/kernel_cpu_impl.h
|
2016-05-20 14:46:49 +00:00
|
|
|
kernels/cpu/kernel_cpu_image.h
|
2017-05-07 12:40:58 +00:00
|
|
|
kernels/cpu/filter_cpu.h
|
|
|
|
kernels/cpu/filter_cpu_impl.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2017-02-14 10:50:29 +00:00
|
|
|
set(SRC_KERNELS_CUDA_HEADERS
|
|
|
|
kernels/cuda/kernel_config.h
|
2017-10-06 19:47:41 +00:00
|
|
|
kernels/cuda/kernel_cuda_image.h
|
2017-02-14 10:50:29 +00:00
|
|
|
)
|
|
|
|
|
2019-09-12 12:50:06 +00:00
|
|
|
set(SRC_KERNELS_OPTIX_HEADERS
|
|
|
|
)
|
|
|
|
|
2017-05-11 23:23:49 +00:00
|
|
|
set(SRC_KERNELS_OPENCL_HEADERS
|
|
|
|
kernels/opencl/kernel_split_function.h
|
2017-10-06 19:47:41 +00:00
|
|
|
kernels/opencl/kernel_opencl_image.h
|
2017-05-11 23:23:49 +00:00
|
|
|
)
|
|
|
|
|
2012-10-20 14:08:49 +00:00
|
|
|
set(SRC_CLOSURE_HEADERS
|
2016-07-25 01:03:23 +00:00
|
|
|
closure/alloc.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf.h
|
|
|
|
closure/bsdf_ashikhmin_velvet.h
|
2012-10-20 14:08:49 +00:00
|
|
|
closure/bsdf_diffuse.h
|
2012-12-11 14:39:41 +00:00
|
|
|
closure/bsdf_diffuse_ramp.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_microfacet.h
|
Cycles: Add multi-scattering, energy-conserving GGX as an option to the Glossy, Anisotropic and Glass BSDFs
This commit adds a new distribution to the Glossy, Anisotropic and Glass BSDFs that implements the
multiple-scattering microfacet model described in the paper "Multiple-Scattering Microfacet BSDFs with the Smith Model".
Essentially, the improvement is that unlike classical GGX, which only models single scattering and assumes
the contribution of multiple bounces to be zero, this new model performs a random walk on the microsurface until
the ray leaves it again, which ensures perfect energy conservation.
In practise, this means that the "darkening problem" - GGX materials becoming darker with increasing
roughness - is solved in a physically correct and efficient way.
The downside of this model is that it has no (known) analytic expression for evalation. However, it can be
evaluated stochastically, and although the correct PDF isn't known either, the properties of MIS and the
balance heuristic guarantee an unbiased result at the cost of slightly higher noise.
Reviewers: dingto, #cycles, brecht
Reviewed By: dingto, #cycles, brecht
Subscribers: bliblubli, ace_dragon, gregzaal, brecht, harvester, dingto, marcog, swerner, jtheninja, Blendify, nutel
Differential Revision: https://developer.blender.org/D2002
2016-06-23 20:56:43 +00:00
|
|
|
closure/bsdf_microfacet_multi.h
|
|
|
|
closure/bsdf_microfacet_multi_impl.h
|
2012-10-20 14:08:49 +00:00
|
|
|
closure/bsdf_oren_nayar.h
|
2012-11-06 19:59:07 +00:00
|
|
|
closure/bsdf_phong_ramp.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_reflection.h
|
|
|
|
closure/bsdf_refraction.h
|
2012-12-19 21:17:16 +00:00
|
|
|
closure/bsdf_toon.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/bsdf_transparent.h
|
2012-12-15 10:18:42 +00:00
|
|
|
closure/bsdf_util.h
|
2014-06-08 10:16:28 +00:00
|
|
|
closure/bsdf_ashikhmin_shirley.h
|
2013-09-15 23:58:00 +00:00
|
|
|
closure/bsdf_hair.h
|
2013-04-01 20:26:52 +00:00
|
|
|
closure/bssrdf.h
|
2012-10-20 12:18:00 +00:00
|
|
|
closure/emissive.h
|
|
|
|
closure/volume.h
|
2017-04-18 09:43:09 +00:00
|
|
|
closure/bsdf_principled_diffuse.h
|
|
|
|
closure/bsdf_principled_sheen.h
|
2019-09-12 12:50:06 +00:00
|
|
|
closure/bsdf_hair_principled.h
|
2012-10-20 14:08:49 +00:00
|
|
|
)
|
Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.
Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.
Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.
This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.
More feature will be enabled once they're ported to the split kernel and
tested.
Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.
Based on the research paper:
https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf
Here's the documentation:
https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit
Design discussion of the patch:
https://developer.blender.org/T44197
Differential Revision: https://developer.blender.org/D1200
2015-05-09 14:34:30 +00:00
|
|
|
|
2012-10-20 14:08:49 +00:00
|
|
|
set(SRC_SVM_HEADERS
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm.h
|
2018-06-15 09:03:29 +00:00
|
|
|
svm/svm_ao.h
|
2019-12-04 18:57:28 +00:00
|
|
|
svm/svm_aov.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_attribute.h
|
2017-08-18 16:37:05 +00:00
|
|
|
svm/svm_bevel.h
|
2013-06-15 23:47:09 +00:00
|
|
|
svm/svm_blackbody.h
|
2016-08-14 15:44:25 +00:00
|
|
|
svm/svm_bump.h
|
2011-12-02 20:36:13 +00:00
|
|
|
svm/svm_camera.h
|
2019-08-13 20:22:15 +00:00
|
|
|
svm/svm_clamp.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_closure.h
|
|
|
|
svm/svm_convert.h
|
2012-01-08 14:55:43 +00:00
|
|
|
svm/svm_checker.h
|
2016-06-20 17:05:49 +00:00
|
|
|
svm/svm_color_util.h
|
2012-09-04 13:29:07 +00:00
|
|
|
svm/svm_brick.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_displace.h
|
|
|
|
svm/svm_fresnel.h
|
2013-05-20 15:58:37 +00:00
|
|
|
svm/svm_wireframe.h
|
2013-06-09 20:46:22 +00:00
|
|
|
svm/svm_wavelength.h
|
2011-12-16 20:35:06 +00:00
|
|
|
svm/svm_gamma.h
|
2012-01-24 16:32:31 +00:00
|
|
|
svm/svm_brightness.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_geometry.h
|
2011-11-06 21:05:58 +00:00
|
|
|
svm/svm_gradient.h
|
2011-12-02 16:57:37 +00:00
|
|
|
svm/svm_hsv.h
|
Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
2018-05-26 22:46:37 +00:00
|
|
|
svm/svm_ies.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_image.h
|
2011-12-03 23:05:35 +00:00
|
|
|
svm/svm_invert.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_light_path.h
|
|
|
|
svm/svm_magic.h
|
2019-08-13 14:29:32 +00:00
|
|
|
svm/svm_map_range.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_mapping.h
|
2019-09-04 21:17:13 +00:00
|
|
|
svm/svm_mapping_util.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_math.h
|
2014-10-26 14:40:04 +00:00
|
|
|
svm/svm_math_util.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_mix.h
|
|
|
|
svm/svm_musgrave.h
|
|
|
|
svm/svm_noise.h
|
|
|
|
svm/svm_noisetex.h
|
2011-12-16 18:15:07 +00:00
|
|
|
svm/svm_normal.h
|
2012-03-26 12:45:14 +00:00
|
|
|
svm/svm_ramp.h
|
2016-07-30 21:30:36 +00:00
|
|
|
svm/svm_ramp_util.h
|
2013-07-03 23:46:56 +00:00
|
|
|
svm/svm_sepcomb_hsv.h
|
2014-06-14 10:28:49 +00:00
|
|
|
svm/svm_sepcomb_vector.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_sky.h
|
|
|
|
svm/svm_tex_coord.h
|
2019-09-04 15:54:32 +00:00
|
|
|
svm/svm_fractal_noise.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_types.h
|
|
|
|
svm/svm_value.h
|
2020-02-17 15:15:46 +00:00
|
|
|
svm/svm_vector_rotate.h
|
2013-06-23 17:51:08 +00:00
|
|
|
svm/svm_vector_transform.h
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/svm_voronoi.h
|
2015-07-18 20:09:20 +00:00
|
|
|
svm/svm_voxel.h
|
2011-11-06 21:05:58 +00:00
|
|
|
svm/svm_wave.h
|
2019-08-21 18:04:09 +00:00
|
|
|
svm/svm_white_noise.h
|
2019-09-12 15:42:13 +00:00
|
|
|
svm/svm_vertex_color.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2014-03-29 12:03:45 +00:00
|
|
|
set(SRC_GEOM_HEADERS
|
2014-03-29 12:03:48 +00:00
|
|
|
geom/geom.h
|
|
|
|
geom/geom_attribute.h
|
2014-03-29 12:03:45 +00:00
|
|
|
geom/geom_curve.h
|
2017-08-07 17:53:12 +00:00
|
|
|
geom/geom_curve_intersect.h
|
2014-03-29 12:03:47 +00:00
|
|
|
geom/geom_motion_curve.h
|
2014-03-29 12:03:47 +00:00
|
|
|
geom/geom_motion_triangle.h
|
2017-01-17 09:48:56 +00:00
|
|
|
geom/geom_motion_triangle_intersect.h
|
2017-01-17 09:58:04 +00:00
|
|
|
geom/geom_motion_triangle_shader.h
|
2014-03-29 12:03:45 +00:00
|
|
|
geom/geom_object.h
|
2016-07-17 02:57:06 +00:00
|
|
|
geom/geom_patch.h
|
2014-03-29 12:03:48 +00:00
|
|
|
geom/geom_primitive.h
|
2016-07-16 23:42:28 +00:00
|
|
|
geom/geom_subd_triangle.h
|
2014-03-29 12:03:45 +00:00
|
|
|
geom/geom_triangle.h
|
2014-12-15 15:21:41 +00:00
|
|
|
geom/geom_triangle_intersect.h
|
2014-03-29 12:03:48 +00:00
|
|
|
geom/geom_volume.h
|
2014-03-29 12:03:45 +00:00
|
|
|
)
|
|
|
|
|
2017-05-07 12:40:58 +00:00
|
|
|
set(SRC_FILTER_HEADERS
|
|
|
|
filter/filter.h
|
|
|
|
filter/filter_defines.h
|
|
|
|
filter/filter_features.h
|
|
|
|
filter/filter_features_sse.h
|
|
|
|
filter/filter_kernel.h
|
|
|
|
filter/filter_nlm_cpu.h
|
|
|
|
filter/filter_nlm_gpu.h
|
|
|
|
filter/filter_prefilter.h
|
|
|
|
filter/filter_reconstruction.h
|
|
|
|
filter/filter_transform.h
|
|
|
|
filter/filter_transform_gpu.h
|
|
|
|
filter/filter_transform_sse.h
|
|
|
|
)
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_UTIL_HEADERS
|
2015-05-21 10:48:50 +00:00
|
|
|
../util/util_atomic.h
|
2011-08-11 12:36:08 +00:00
|
|
|
../util/util_color.h
|
2017-08-02 00:09:08 +00:00
|
|
|
../util/util_defines.h
|
2014-01-15 14:29:22 +00:00
|
|
|
../util/util_half.h
|
2016-10-29 22:56:39 +00:00
|
|
|
../util/util_hash.h
|
2011-08-11 12:36:08 +00:00
|
|
|
../util/util_math.h
|
2015-01-30 12:56:47 +00:00
|
|
|
../util/util_math_fast.h
|
2017-03-23 11:47:27 +00:00
|
|
|
../util/util_math_intersect.h
|
2017-04-14 12:05:23 +00:00
|
|
|
../util/util_math_float2.h
|
|
|
|
../util/util_math_float3.h
|
|
|
|
../util/util_math_float4.h
|
|
|
|
../util/util_math_int2.h
|
|
|
|
../util/util_math_int3.h
|
|
|
|
../util/util_math_int4.h
|
2017-05-07 12:40:58 +00:00
|
|
|
../util/util_math_matrix.h
|
2018-03-08 04:33:55 +00:00
|
|
|
../util/util_projection.h
|
Cycles: Improve denoising speed on GPUs with small tile sizes
Previously, the NLM kernels would be launched once per offset with one thread per pixel.
However, with the smaller tile sizes that are now feasible, there wasn't enough work to fully occupy GPUs which results in a significant slowdown.
Therefore, the kernels are now launched in a single call that handles all offsets at once.
This has two downsides: Memory accesses to accumulating buffers are now atomic, and more importantly, the temporary memory now has to be allocated for every shift at once, increasing the required memory.
On the other hand, of course, the smaller tiles significantly reduce the size of the memory.
The main bottleneck right now is the construction of the transformation - there is nothing to be parallelized there, one thread per pixel is the maximum.
I tried to parallelize the SVD implementation by storing the matrix in shared memory and launching one block per pixel, but that wasn't really going anywhere.
To make the new code somewhat readable, the handling of rectangular regions was cleaned up a bit and commented, it should be easier to understand what's going on now.
Also, some variables have been renamed to make the difference between buffer width and stride more apparent, in addition to some general style cleanup.
2017-11-10 03:34:14 +00:00
|
|
|
../util/util_rect.h
|
2016-08-11 07:52:39 +00:00
|
|
|
../util/util_static_assert.h
|
2011-08-11 12:36:08 +00:00
|
|
|
../util/util_transform.h
|
2016-04-16 09:58:38 +00:00
|
|
|
../util/util_texture.h
|
2011-11-08 20:27:37 +00:00
|
|
|
../util/util_types.h
|
2017-04-13 17:34:45 +00:00
|
|
|
../util/util_types_float2.h
|
|
|
|
../util/util_types_float2_impl.h
|
|
|
|
../util/util_types_float3.h
|
|
|
|
../util/util_types_float3_impl.h
|
|
|
|
../util/util_types_float4.h
|
|
|
|
../util/util_types_float4_impl.h
|
2018-02-14 10:23:30 +00:00
|
|
|
../util/util_types_float8.h
|
|
|
|
../util/util_types_float8_impl.h
|
2017-04-13 17:34:45 +00:00
|
|
|
../util/util_types_int2.h
|
|
|
|
../util/util_types_int2_impl.h
|
|
|
|
../util/util_types_int3.h
|
|
|
|
../util/util_types_int3_impl.h
|
|
|
|
../util/util_types_int4.h
|
|
|
|
../util/util_types_int4_impl.h
|
|
|
|
../util/util_types_uchar2.h
|
|
|
|
../util/util_types_uchar2_impl.h
|
|
|
|
../util/util_types_uchar3.h
|
|
|
|
../util/util_types_uchar3_impl.h
|
|
|
|
../util/util_types_uchar4.h
|
|
|
|
../util/util_types_uchar4_impl.h
|
|
|
|
../util/util_types_uint2.h
|
|
|
|
../util/util_types_uint2_impl.h
|
|
|
|
../util/util_types_uint3.h
|
|
|
|
../util/util_types_uint3_impl.h
|
|
|
|
../util/util_types_uint4.h
|
|
|
|
../util/util_types_uint4_impl.h
|
2018-07-05 10:37:52 +00:00
|
|
|
../util/util_types_ushort4.h
|
2017-04-13 17:34:45 +00:00
|
|
|
../util/util_types_vector3.h
|
|
|
|
../util/util_types_vector3_impl.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2015-05-21 12:40:04 +00:00
|
|
|
|
|
|
|
set(SRC_SPLIT_HEADERS
|
2020-03-05 11:05:42 +00:00
|
|
|
split/kernel_adaptive_adjust_samples.h
|
|
|
|
split/kernel_adaptive_filter_x.h
|
|
|
|
split/kernel_adaptive_filter_y.h
|
|
|
|
split/kernel_adaptive_stopping.h
|
2017-03-21 02:31:54 +00:00
|
|
|
split/kernel_branched.h
|
2017-03-08 14:42:26 +00:00
|
|
|
split/kernel_buffer_update.h
|
2015-05-21 12:40:04 +00:00
|
|
|
split/kernel_data_init.h
|
|
|
|
split/kernel_direct_lighting.h
|
2017-03-08 14:42:26 +00:00
|
|
|
split/kernel_do_volume.h
|
2017-05-30 00:40:26 +00:00
|
|
|
split/kernel_enqueue_inactive.h
|
2015-05-21 12:40:04 +00:00
|
|
|
split/kernel_holdout_emission_blurring_pathtermination_ao.h
|
2017-03-08 14:42:26 +00:00
|
|
|
split/kernel_indirect_background.h
|
|
|
|
split/kernel_indirect_subsurface.h
|
2015-05-21 12:40:04 +00:00
|
|
|
split/kernel_lamp_emission.h
|
|
|
|
split/kernel_next_iteration_setup.h
|
2017-03-01 06:05:55 +00:00
|
|
|
split/kernel_path_init.h
|
2017-02-22 13:10:02 +00:00
|
|
|
split/kernel_queue_enqueue.h
|
2015-05-21 12:40:04 +00:00
|
|
|
split/kernel_scene_intersect.h
|
2017-05-03 13:30:45 +00:00
|
|
|
split/kernel_shader_setup.h
|
|
|
|
split/kernel_shader_sort.h
|
2015-05-21 12:40:04 +00:00
|
|
|
split/kernel_shader_eval.h
|
2017-03-08 16:39:40 +00:00
|
|
|
split/kernel_shadow_blocked_ao.h
|
|
|
|
split/kernel_shadow_blocked_dl.h
|
2015-05-21 12:40:04 +00:00
|
|
|
split/kernel_split_common.h
|
2017-02-22 13:10:02 +00:00
|
|
|
split/kernel_split_data.h
|
2017-03-08 10:02:54 +00:00
|
|
|
split/kernel_split_data_types.h
|
2017-03-08 14:42:26 +00:00
|
|
|
split/kernel_subsurface_scatter.h
|
2015-05-21 12:40:04 +00:00
|
|
|
)
|
|
|
|
|
2019-04-16 04:11:27 +00:00
|
|
|
set(LIB
|
|
|
|
|
|
|
|
)
|
|
|
|
|
2011-11-10 12:52:17 +00:00
|
|
|
# CUDA module
|
|
|
|
|
|
|
|
if(WITH_CYCLES_CUDA_BINARIES)
|
2018-02-17 15:15:07 +00:00
|
|
|
# 64 bit only
|
|
|
|
set(CUDA_BITS 64)
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2013-06-19 17:54:23 +00:00
|
|
|
# CUDA version
|
2015-06-30 12:44:27 +00:00
|
|
|
execute_process(COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT)
|
2016-05-09 14:05:02 +00:00
|
|
|
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${NVCC_OUT}")
|
|
|
|
string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${NVCC_OUT}")
|
2013-06-19 17:54:23 +00:00
|
|
|
set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2013-06-20 13:10:47 +00:00
|
|
|
# warn for other versions
|
2020-10-13 10:33:34 +00:00
|
|
|
if((CUDA_VERSION MATCHES "101") OR (CUDA_VERSION MATCHES "102") OR (CUDA_VERSION MATCHES "111"))
|
2013-06-20 13:10:47 +00:00
|
|
|
else()
|
2014-03-13 12:31:06 +00:00
|
|
|
message(WARNING
|
|
|
|
"CUDA version ${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR} detected, "
|
2020-10-13 10:33:34 +00:00
|
|
|
"build may succeed but only CUDA 10.1, 10.2 and 11.1 are officially supported")
|
2013-06-20 13:10:47 +00:00
|
|
|
endif()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2013-06-19 17:54:23 +00:00
|
|
|
# build for each arch
|
2017-02-14 10:50:29 +00:00
|
|
|
set(cuda_sources kernels/cuda/kernel.cu kernels/cuda/kernel_split.cu
|
2016-07-11 10:28:45 +00:00
|
|
|
${SRC_HEADERS}
|
2017-02-14 10:50:29 +00:00
|
|
|
${SRC_KERNELS_CUDA_HEADERS}
|
2016-07-11 10:28:45 +00:00
|
|
|
${SRC_BVH_HEADERS}
|
|
|
|
${SRC_SVM_HEADERS}
|
|
|
|
${SRC_GEOM_HEADERS}
|
|
|
|
${SRC_CLOSURE_HEADERS}
|
|
|
|
${SRC_UTIL_HEADERS}
|
|
|
|
)
|
2017-05-07 12:40:58 +00:00
|
|
|
set(cuda_filter_sources kernels/cuda/filter.cu
|
|
|
|
${SRC_HEADERS}
|
|
|
|
${SRC_KERNELS_CUDA_HEADERS}
|
|
|
|
${SRC_FILTER_HEADERS}
|
|
|
|
${SRC_UTIL_HEADERS}
|
|
|
|
)
|
2011-11-10 12:52:17 +00:00
|
|
|
set(cuda_cubins)
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-08-20 08:17:34 +00:00
|
|
|
macro(CYCLES_CUDA_KERNEL_ADD arch prev_arch name flags sources experimental)
|
2019-10-16 08:29:04 +00:00
|
|
|
if(${arch} MATCHES "compute_.*")
|
|
|
|
set(format "ptx")
|
|
|
|
else()
|
|
|
|
set(format "cubin")
|
|
|
|
endif()
|
|
|
|
set(cuda_file ${name}_${arch}.${format})
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-08-20 08:17:34 +00:00
|
|
|
set(kernel_sources ${sources})
|
|
|
|
if(NOT ${prev_arch} STREQUAL "none")
|
2019-10-16 08:29:04 +00:00
|
|
|
if(${prev_arch} MATCHES "compute_.*")
|
|
|
|
set(kernel_sources ${kernel_sources} ${name}_${prev_arch}.ptx)
|
|
|
|
else()
|
|
|
|
set(kernel_sources ${kernel_sources} ${name}_${prev_arch}.cubin)
|
|
|
|
endif()
|
2018-08-20 08:17:34 +00:00
|
|
|
endif()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-02-03 17:59:09 +00:00
|
|
|
set(cuda_kernel_src "/kernels/cuda/${name}.cu")
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2020-12-03 11:19:36 +00:00
|
|
|
set(cuda_flags ${flags}
|
2018-02-03 17:59:09 +00:00
|
|
|
-D CCL_NAMESPACE_BEGIN=
|
|
|
|
-D CCL_NAMESPACE_END=
|
|
|
|
-D NVCC
|
|
|
|
-m ${CUDA_BITS}
|
|
|
|
-I ${CMAKE_CURRENT_SOURCE_DIR}/..
|
|
|
|
-I ${CMAKE_CURRENT_SOURCE_DIR}/kernels/cuda
|
|
|
|
--use_fast_math
|
2019-10-16 08:29:04 +00:00
|
|
|
-o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_file})
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2017-02-14 10:50:29 +00:00
|
|
|
if(${experimental})
|
2018-02-03 17:59:09 +00:00
|
|
|
set(cuda_flags ${cuda_flags} -D __KERNEL_EXPERIMENTAL__)
|
2017-05-07 12:40:58 +00:00
|
|
|
set(name ${name}_experimental)
|
2014-08-26 15:02:03 +00:00
|
|
|
endif()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2014-10-05 15:42:04 +00:00
|
|
|
if(WITH_CYCLES_DEBUG)
|
2018-02-03 17:59:09 +00:00
|
|
|
set(cuda_flags ${cuda_flags} -D __KERNEL_DEBUG__)
|
2014-10-05 15:42:04 +00:00
|
|
|
endif()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2020-10-02 15:40:28 +00:00
|
|
|
if(WITH_NANOVDB)
|
|
|
|
set(cuda_flags ${cuda_flags}
|
|
|
|
-D WITH_NANOVDB
|
|
|
|
-I "${NANOVDB_INCLUDE_DIR}")
|
|
|
|
endif()
|
|
|
|
|
2019-03-15 13:18:22 +00:00
|
|
|
if(WITH_CYCLES_CUBIN_COMPILER)
|
2018-02-03 17:59:09 +00:00
|
|
|
string(SUBSTRING ${arch} 3 -1 CUDA_ARCH)
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-02-03 17:59:09 +00:00
|
|
|
# Needed to find libnvrtc-builtins.so. Can't do it from inside
|
|
|
|
# cycles_cubin_cc since the env variable is read before main()
|
|
|
|
if(APPLE)
|
|
|
|
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
|
2020-10-13 10:33:34 +00:00
|
|
|
-E env DYLD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib")
|
2018-02-03 17:59:09 +00:00
|
|
|
elseif(UNIX)
|
|
|
|
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
|
2020-10-13 10:33:34 +00:00
|
|
|
-E env LD_LIBRARY_PATH="${cuda_toolkit_root_dir}/lib64")
|
2018-02-03 17:59:09 +00:00
|
|
|
endif()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-02-03 17:59:09 +00:00
|
|
|
add_custom_command(
|
2020-03-26 17:41:44 +00:00
|
|
|
OUTPUT ${cuda_file}
|
2018-02-03 17:59:09 +00:00
|
|
|
COMMAND ${CUBIN_CC_ENV}
|
|
|
|
"$<TARGET_FILE:cycles_cubin_cc>"
|
|
|
|
-target ${CUDA_ARCH}
|
|
|
|
-i ${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
|
|
|
|
${cuda_flags}
|
|
|
|
-v
|
2020-10-13 10:33:34 +00:00
|
|
|
-cuda-toolkit-dir "${cuda_toolkit_root_dir}"
|
2018-08-20 08:17:34 +00:00
|
|
|
DEPENDS ${kernel_sources} cycles_cubin_cc)
|
2018-02-03 17:59:09 +00:00
|
|
|
else()
|
|
|
|
add_custom_command(
|
2019-10-16 08:29:04 +00:00
|
|
|
OUTPUT ${cuda_file}
|
2020-10-13 10:33:34 +00:00
|
|
|
COMMAND ${cuda_nvcc_executable}
|
2018-02-03 17:59:09 +00:00
|
|
|
-arch=${arch}
|
|
|
|
${CUDA_NVCC_FLAGS}
|
2019-10-16 08:29:04 +00:00
|
|
|
--${format}
|
2018-02-03 17:59:09 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
|
|
|
|
--ptxas-options="-v"
|
|
|
|
${cuda_flags}
|
2018-08-20 08:17:34 +00:00
|
|
|
DEPENDS ${kernel_sources})
|
2018-02-03 17:59:09 +00:00
|
|
|
endif()
|
2019-10-16 08:29:04 +00:00
|
|
|
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${cuda_file}" ${CYCLES_INSTALL_PATH}/lib)
|
|
|
|
list(APPEND cuda_cubins ${cuda_file})
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2014-10-05 15:42:04 +00:00
|
|
|
unset(cuda_debug_flags)
|
2014-08-26 15:02:03 +00:00
|
|
|
endmacro()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-08-20 08:17:34 +00:00
|
|
|
set(prev_arch "none")
|
2014-08-26 15:02:03 +00:00
|
|
|
foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
|
2020-10-13 10:33:34 +00:00
|
|
|
if(${arch} MATCHES ".*_2.")
|
2018-02-06 14:19:25 +00:00
|
|
|
message(STATUS "CUDA binaries for ${arch} are no longer supported, skipped.")
|
2020-10-13 10:33:34 +00:00
|
|
|
elseif(${arch} MATCHES ".*_30")
|
|
|
|
if(DEFINED CUDA10_NVCC_EXECUTABLE)
|
|
|
|
set(cuda_nvcc_executable ${CUDA10_NVCC_EXECUTABLE})
|
|
|
|
set(cuda_toolkit_root_dir ${CUDA10_TOOLKIT_ROOT_DIR})
|
|
|
|
elseif(${CUDA_VERSION} LESS 110) # Support for sm_30 was removed in CUDA 11
|
|
|
|
set(cuda_nvcc_executable ${CUDA_NVCC_EXECUTABLE})
|
|
|
|
set(cuda_toolkit_root_dir ${CUDA_TOOLKIT_ROOT_DIR})
|
|
|
|
else()
|
|
|
|
message(STATUS "CUDA binaries for ${arch} require CUDA 10 or earlier, skipped.")
|
|
|
|
endif()
|
|
|
|
elseif(${arch} MATCHES ".*_7." AND ${CUDA_VERSION} LESS 100)
|
2018-12-04 11:34:59 +00:00
|
|
|
message(STATUS "CUDA binaries for ${arch} require CUDA 10.0+, skipped.")
|
2020-10-13 10:33:34 +00:00
|
|
|
elseif(${arch} MATCHES ".*_8.")
|
|
|
|
if(DEFINED CUDA11_NVCC_EXECUTABLE)
|
|
|
|
set(cuda_nvcc_executable ${CUDA11_NVCC_EXECUTABLE})
|
|
|
|
set(cuda_toolkit_root_dir ${CUDA11_TOOLKIT_ROOT_DIR})
|
|
|
|
elseif(${CUDA_VERSION} GREATER_EQUAL 111) # Support for sm_86 was introduced in CUDA 11
|
|
|
|
set(cuda_nvcc_executable ${CUDA_NVCC_EXECUTABLE})
|
|
|
|
set(cuda_toolkit_root_dir ${CUDA_TOOLKIT_ROOT_DIR})
|
|
|
|
else()
|
|
|
|
message(STATUS "CUDA binaries for ${arch} require CUDA 11.1+, skipped.")
|
|
|
|
endif()
|
2018-02-06 14:19:25 +00:00
|
|
|
else()
|
2020-10-13 10:33:34 +00:00
|
|
|
set(cuda_nvcc_executable ${CUDA_NVCC_EXECUTABLE})
|
|
|
|
set(cuda_toolkit_root_dir ${CUDA_TOOLKIT_ROOT_DIR})
|
|
|
|
endif()
|
|
|
|
if(DEFINED cuda_nvcc_executable AND DEFINED cuda_toolkit_root_dir)
|
2018-02-06 14:19:25 +00:00
|
|
|
# Compile regular kernel
|
2018-08-20 08:17:34 +00:00
|
|
|
CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} filter "" "${cuda_filter_sources}" FALSE)
|
|
|
|
CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} kernel "" "${cuda_sources}" FALSE)
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-08-20 08:17:34 +00:00
|
|
|
if(WITH_CYCLES_CUDA_SPLIT_KERNEL_BINARIES)
|
|
|
|
# Compile split kernel
|
|
|
|
CYCLES_CUDA_KERNEL_ADD(${arch} ${prev_arch} kernel_split "-D __SPLIT__" "${cuda_sources}" FALSE)
|
|
|
|
endif()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2018-08-20 08:17:34 +00:00
|
|
|
if(WITH_CYCLES_CUDA_BUILD_SERIAL)
|
|
|
|
set(prev_arch ${arch})
|
|
|
|
endif()
|
2020-10-13 10:33:34 +00:00
|
|
|
|
|
|
|
unset(cuda_nvcc_executable)
|
|
|
|
unset(cuda_toolkit_root_dir)
|
2017-02-14 10:50:29 +00:00
|
|
|
endif()
|
2011-11-10 12:52:17 +00:00
|
|
|
endforeach()
|
2019-04-17 04:17:24 +00:00
|
|
|
|
2011-11-10 12:52:17 +00:00
|
|
|
add_custom_target(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins})
|
2018-02-03 23:38:27 +00:00
|
|
|
cycles_set_solution_folder(cycles_kernel_cuda)
|
2011-11-10 12:52:17 +00:00
|
|
|
endif()
|
2011-08-11 12:36:08 +00:00
|
|
|
|
2019-09-12 12:50:06 +00:00
|
|
|
# OptiX PTX modules
|
|
|
|
|
2020-04-11 18:59:21 +00:00
|
|
|
if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
2020-12-03 11:19:36 +00:00
|
|
|
macro(CYCLES_OPTIX_KERNEL_ADD name flags)
|
|
|
|
set(input "kernels/optix/kernel_optix.cu")
|
|
|
|
set(output "${CMAKE_CURRENT_BINARY_DIR}/${name}.ptx")
|
2019-09-12 12:50:06 +00:00
|
|
|
|
2020-12-03 11:19:36 +00:00
|
|
|
set(cuda_flags ${flags}
|
2019-09-12 12:50:06 +00:00
|
|
|
-I "${OPTIX_INCLUDE_DIR}"
|
|
|
|
-I "${CMAKE_CURRENT_SOURCE_DIR}/.."
|
|
|
|
-I "${CMAKE_CURRENT_SOURCE_DIR}/kernels/cuda"
|
|
|
|
--use_fast_math
|
|
|
|
-o ${output})
|
|
|
|
|
|
|
|
if(WITH_CYCLES_DEBUG)
|
|
|
|
set(cuda_flags ${cuda_flags}
|
|
|
|
-D __KERNEL_DEBUG__)
|
|
|
|
endif()
|
|
|
|
|
2020-10-02 15:40:28 +00:00
|
|
|
if(WITH_NANOVDB)
|
|
|
|
set(cuda_flags ${cuda_flags}
|
|
|
|
-D WITH_NANOVDB
|
|
|
|
-I "${NANOVDB_INCLUDE_DIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(WITH_CYCLES_CUBIN_COMPILER)
|
2020-03-26 17:41:44 +00:00
|
|
|
# Needed to find libnvrtc-builtins.so. Can't do it from inside
|
|
|
|
# cycles_cubin_cc since the env variable is read before main()
|
|
|
|
if(APPLE)
|
|
|
|
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
|
|
|
|
-E env DYLD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib")
|
|
|
|
elseif(UNIX)
|
|
|
|
set(CUBIN_CC_ENV ${CMAKE_COMMAND}
|
|
|
|
-E env LD_LIBRARY_PATH="${CUDA_TOOLKIT_ROOT_DIR}/lib64")
|
|
|
|
endif()
|
2019-09-12 12:50:06 +00:00
|
|
|
|
2020-03-26 17:41:44 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${output}
|
|
|
|
DEPENDS
|
|
|
|
${input}
|
|
|
|
${SRC_HEADERS}
|
|
|
|
${SRC_KERNELS_CUDA_HEADERS}
|
|
|
|
${SRC_KERNELS_OPTIX_HEADERS}
|
|
|
|
${SRC_BVH_HEADERS}
|
|
|
|
${SRC_SVM_HEADERS}
|
|
|
|
${SRC_GEOM_HEADERS}
|
|
|
|
${SRC_CLOSURE_HEADERS}
|
|
|
|
${SRC_UTIL_HEADERS}
|
|
|
|
COMMAND ${CUBIN_CC_ENV}
|
|
|
|
"$<TARGET_FILE:cycles_cubin_cc>"
|
2020-07-27 14:11:00 +00:00
|
|
|
-target 50
|
2020-03-26 17:41:44 +00:00
|
|
|
-ptx
|
|
|
|
-i ${CMAKE_CURRENT_SOURCE_DIR}/${input}
|
|
|
|
${cuda_flags}
|
|
|
|
-v
|
|
|
|
-cuda-toolkit-dir "${CUDA_TOOLKIT_ROOT_DIR}"
|
|
|
|
DEPENDS ${kernel_sources} cycles_cubin_cc)
|
|
|
|
else()
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${output}
|
|
|
|
DEPENDS
|
|
|
|
${input}
|
|
|
|
${SRC_HEADERS}
|
|
|
|
${SRC_KERNELS_CUDA_HEADERS}
|
|
|
|
${SRC_KERNELS_OPTIX_HEADERS}
|
|
|
|
${SRC_BVH_HEADERS}
|
|
|
|
${SRC_SVM_HEADERS}
|
|
|
|
${SRC_GEOM_HEADERS}
|
|
|
|
${SRC_CLOSURE_HEADERS}
|
|
|
|
${SRC_UTIL_HEADERS}
|
|
|
|
COMMAND
|
|
|
|
${CUDA_NVCC_EXECUTABLE}
|
|
|
|
--ptx
|
2020-07-27 14:11:00 +00:00
|
|
|
-arch=sm_50
|
2020-03-26 17:41:44 +00:00
|
|
|
${cuda_flags}
|
|
|
|
${input}
|
|
|
|
WORKING_DIRECTORY
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
endif()
|
2019-09-12 12:50:06 +00:00
|
|
|
list(APPEND optix_ptx ${output})
|
|
|
|
|
|
|
|
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${output}" ${CYCLES_INSTALL_PATH}/lib)
|
2020-12-03 11:19:36 +00:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
CYCLES_OPTIX_KERNEL_ADD(kernel_optix "-D __NO_SHADER_RAYTRACE__")
|
|
|
|
CYCLES_OPTIX_KERNEL_ADD(kernel_optix_shader_raytrace "--keep-device-functions")
|
2019-09-12 12:50:06 +00:00
|
|
|
|
|
|
|
add_custom_target(cycles_kernel_optix ALL DEPENDS ${optix_ptx})
|
|
|
|
cycles_set_solution_folder(cycles_kernel_optix)
|
|
|
|
endif()
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
# OSL module
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_OSL)
|
2019-04-16 04:18:52 +00:00
|
|
|
list(APPEND LIB
|
|
|
|
cycles_kernel_osl
|
|
|
|
)
|
2011-08-16 16:15:34 +00:00
|
|
|
add_subdirectory(osl)
|
2012-11-03 14:32:13 +00:00
|
|
|
add_subdirectory(shaders)
|
2011-08-16 16:15:34 +00:00
|
|
|
endif()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# CPU module
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
include_directories(${INC})
|
2012-09-20 09:04:43 +00:00
|
|
|
include_directories(SYSTEM ${INC_SYS})
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2019-08-13 04:02:48 +00:00
|
|
|
if(WITH_COMPILER_ASAN)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC AND (NOT WITH_CYCLES_KERNEL_ASAN))
|
|
|
|
# GCC hangs compiling the big kernel files with asan and release, so disable by default.
|
2020-11-05 23:29:04 +00:00
|
|
|
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -fno-sanitize=all")
|
|
|
|
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -fno-sanitize=vptr")
|
2019-08-13 04:02:48 +00:00
|
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
# With OSL, Cycles disables rtti in some modules, wich then breaks at linking
|
|
|
|
# when trying to use vptr sanitizer (included into 'undefined' general option).
|
2020-11-05 23:29:04 +00:00
|
|
|
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -fno-sanitize=vptr")
|
|
|
|
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -fno-sanitize=vptr")
|
2019-08-13 04:02:48 +00:00
|
|
|
endif()
|
2019-07-11 17:29:29 +00:00
|
|
|
endif()
|
|
|
|
|
2017-03-30 09:23:26 +00:00
|
|
|
set_source_files_properties(kernels/cpu/kernel.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_split.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
|
2017-05-07 12:40:58 +00:00
|
|
|
set_source_files_properties(kernels/cpu/filter.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_KERNEL_FLAGS}")
|
2017-03-30 09:23:26 +00:00
|
|
|
|
2017-05-16 19:27:57 +00:00
|
|
|
if(CXX_HAS_SSE)
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_split_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_split_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_split_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/filter_sse2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE2_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/filter_sse3.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE3_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/filter_sse41.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_SSE41_KERNEL_FLAGS}")
|
|
|
|
endif()
|
2014-03-26 23:15:36 +00:00
|
|
|
|
2017-05-16 19:27:57 +00:00
|
|
|
if(CXX_HAS_AVX)
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_split_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/filter_avx.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX_KERNEL_FLAGS}")
|
|
|
|
endif()
|
2017-05-15 16:37:33 +00:00
|
|
|
|
2017-05-16 19:27:57 +00:00
|
|
|
if(CXX_HAS_AVX2)
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/kernel_split_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
|
|
|
|
set_source_files_properties(kernels/cpu/filter_avx2.cpp PROPERTIES COMPILE_FLAGS "${CYCLES_AVX2_KERNEL_FLAGS}")
|
2014-12-07 10:22:05 +00:00
|
|
|
endif()
|
2013-11-22 13:16:47 +00:00
|
|
|
|
2019-04-16 04:11:27 +00:00
|
|
|
cycles_add_library(cycles_kernel "${LIB}"
|
2017-10-07 12:08:02 +00:00
|
|
|
${SRC_CPU_KERNELS}
|
|
|
|
${SRC_CUDA_KERNELS}
|
2019-09-12 12:50:06 +00:00
|
|
|
${SRC_OPTIX_KERNELS}
|
2017-10-07 12:08:02 +00:00
|
|
|
${SRC_OPENCL_KERNELS}
|
2015-12-30 13:51:35 +00:00
|
|
|
${SRC_HEADERS}
|
|
|
|
${SRC_KERNELS_CPU_HEADERS}
|
2017-02-14 10:50:29 +00:00
|
|
|
${SRC_KERNELS_CUDA_HEADERS}
|
2019-09-12 12:50:06 +00:00
|
|
|
${SRC_KERNELS_OPTIX_HEADERS}
|
2017-05-11 23:23:49 +00:00
|
|
|
${SRC_KERNELS_OPENCL_HEADERS}
|
2016-07-11 10:28:45 +00:00
|
|
|
${SRC_BVH_HEADERS}
|
2015-12-30 13:51:35 +00:00
|
|
|
${SRC_CLOSURE_HEADERS}
|
2017-05-07 12:40:58 +00:00
|
|
|
${SRC_FILTER_HEADERS}
|
2015-12-30 13:51:35 +00:00
|
|
|
${SRC_SVM_HEADERS}
|
|
|
|
${SRC_GEOM_HEADERS}
|
|
|
|
${SRC_SPLIT_HEADERS}
|
|
|
|
)
|
2013-11-22 13:16:47 +00:00
|
|
|
|
2019-09-12 12:50:06 +00:00
|
|
|
source_group("bvh" FILES ${SRC_BVH_HEADERS})
|
|
|
|
source_group("closure" FILES ${SRC_CLOSURE_HEADERS})
|
|
|
|
source_group("filter" FILES ${SRC_FILTER_HEADERS})
|
|
|
|
source_group("geom" FILES ${SRC_GEOM_HEADERS})
|
|
|
|
source_group("kernel" FILES ${SRC_HEADERS})
|
|
|
|
source_group("kernel\\split" FILES ${SRC_SPLIT_HEADERS})
|
|
|
|
source_group("kernels\\cpu" FILES ${SRC_CPU_KERNELS} ${SRC_KERNELS_CPU_HEADERS})
|
|
|
|
source_group("kernels\\cuda" FILES ${SRC_CUDA_KERNELS} ${SRC_KERNELS_CUDA_HEADERS})
|
|
|
|
source_group("kernels\\opencl" FILES ${SRC_OPENCL_KERNELS} ${SRC_KERNELS_OPENCL_HEADERS})
|
|
|
|
source_group("kernels\\optix" FILES ${SRC_OPTIX_KERNELS} ${SRC_KERNELS_OPTIX_HEADERS})
|
|
|
|
source_group("svm" FILES ${SRC_SVM_HEADERS})
|
|
|
|
|
2011-08-16 16:15:34 +00:00
|
|
|
if(WITH_CYCLES_CUDA)
|
|
|
|
add_dependencies(cycles_kernel cycles_kernel_cuda)
|
|
|
|
endif()
|
2020-04-11 18:59:21 +00:00
|
|
|
if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
|
2019-09-12 12:50:06 +00:00
|
|
|
add_dependencies(cycles_kernel cycles_kernel_optix)
|
|
|
|
endif()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-15 15:13:38 +00:00
|
|
|
# OpenCL kernel
|
2011-05-20 12:26:01 +00:00
|
|
|
|
2019-10-28 14:32:33 +00:00
|
|
|
# set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
|
|
|
|
# add_custom_command(
|
|
|
|
# OUTPUT ${KERNEL_PREPROCESSED}
|
|
|
|
# COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -o ${KERNEL_PREPROCESSED}
|
|
|
|
# DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
|
|
|
|
# add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
|
|
|
|
# delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
|
2011-09-02 14:55:06 +00:00
|
|
|
|
2017-10-07 12:08:02 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_OPENCL_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CUDA_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda)
|
2019-09-12 12:50:06 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_OPTIX_KERNELS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/optix)
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 18:39:14 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel)
|
2017-10-07 12:08:02 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_OPENCL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl)
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 18:39:14 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_CUDA_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda)
|
2019-09-12 12:50:06 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_OPTIX_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/optix)
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 18:39:14 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_BVH_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/bvh)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CLOSURE_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/closure)
|
2017-05-07 12:40:58 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_FILTER_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/filter)
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 18:39:14 +00:00
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/svm)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/geom)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/util)
|
|
|
|
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SPLIT_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/split)
|
2020-10-02 15:40:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
if(WITH_NANOVDB)
|
|
|
|
set(SRC_NANOVDB_HEADERS
|
|
|
|
nanovdb/NanoVDB.h
|
|
|
|
nanovdb/CNanoVDB.h
|
|
|
|
)
|
|
|
|
set(SRC_NANOVDB_UTIL_HEADERS
|
|
|
|
nanovdb/util/CSampleFromVoxels.h
|
|
|
|
nanovdb/util/SampleFromVoxels.h
|
|
|
|
)
|
|
|
|
delayed_install(${NANOVDB_INCLUDE_DIR} "${SRC_NANOVDB_HEADERS}" ${CYCLES_INSTALL_PATH}/source/nanovdb)
|
|
|
|
delayed_install(${NANOVDB_INCLUDE_DIR} "${SRC_NANOVDB_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/source/nanovdb/util)
|
|
|
|
endif()
|