diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2017-03-31 01:31:31 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2017-03-31 01:32:13 +0300 |
commit | 116dd643abbdb67de17da664cfaa87bb05b77119 (patch) | |
tree | 29db2ae7eed0dce59ca22c6c647ffb3e6b1ad6c9 | |
parent | fbd0b1de2b4ab12cc74c6e8b6608d7e2e44d712a (diff) | |
parent | 4cfac9edab8e74982aec1a57541167751c59ac4f (diff) |
Merge remote-tracking branch 'origin/master' into temp-cycles-denoising
300 files changed, 2694 insertions, 2828 deletions
diff --git a/build_files/buildbot/slave_compile.py b/build_files/buildbot/slave_compile.py index 1d42f04f151..c8d69c38644 100644 --- a/build_files/buildbot/slave_compile.py +++ b/build_files/buildbot/slave_compile.py @@ -91,7 +91,6 @@ if 'cmake' in builder: elif builder.startswith('win32'): bits = 32 cmake_options.extend(['-G', 'Visual Studio 12 2013']) - cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin/nvcc.exe') elif builder.startswith('linux'): tokens = builder.split("_") @@ -111,8 +110,6 @@ if 'cmake' in builder: cuda_chroot_name = 'buildbot_' + deb_name + '_x86_64' targets = ['player', 'blender', 'cuda'] - cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda/bin/nvcc') - cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file)) # Prepare CMake options needed to configure cuda binaries compilation. diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 9d9c86f383d..06374dcff75 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -22,6 +22,7 @@ if(WITH_CYCLES_NATIVE_ONLY) -DWITH_KERNEL_NATIVE ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") + set(CYCLES_KERNEL_FLAGS "-march=native") elseif(NOT WITH_CPU_SSE) set(CXX_HAS_SSE FALSE) set(CXX_HAS_AVX FALSE) @@ -59,10 +60,13 @@ elseif(WIN32 AND MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ox") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Ox") + + set(CYCLES_KERNEL_FLAGS "/fp:fast -D_CRT_SECURE_NO_WARNINGS /GS-") elseif(CMAKE_COMPILER_IS_GNUCC) check_cxx_compiler_flag(-msse CXX_HAS_SSE) check_cxx_compiler_flag(-mavx CXX_HAS_AVX) check_cxx_compiler_flag(-mavx2 CXX_HAS_AVX2) + set(CYCLES_KERNEL_FLAGS "-ffast-math") if(CXX_HAS_SSE) set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2 -mfpmath=sse") set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -mfpmath=sse") @@ -79,6 +83,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") check_cxx_compiler_flag(-msse CXX_HAS_SSE) check_cxx_compiler_flag(-mavx CXX_HAS_AVX) check_cxx_compiler_flag(-mavx2 CXX_HAS_AVX2) + set(CYCLES_KERNEL_FLAGS "-ffast-math") if(CXX_HAS_SSE) set(CYCLES_SSE2_KERNEL_FLAGS "-ffast-math -msse -msse2") set(CYCLES_SSE3_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3") diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index 88b46038eb2..dec1219d1f5 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -1,14 +1,6 @@ set(INC - . - ../bvh - ../device - ../graph - ../kernel - ../kernel/svm - ../render - ../subd - ../util + .. ) set(INC_SYS ) diff --git a/intern/cycles/app/cycles_server.cpp b/intern/cycles/app/cycles_server.cpp index 4ef9cd070bb..e65b9d769e4 100644 --- a/intern/cycles/app/cycles_server.cpp +++ b/intern/cycles/app/cycles_server.cpp @@ -16,15 +16,15 @@ #include <stdio.h> -#include "device.h" - -#include "util_args.h" -#include "util_foreach.h" -#include "util_path.h" -#include "util_stats.h" -#include "util_string.h" -#include "util_task.h" -#include "util_logging.h" +#include "device/device.h" + +#include "util/util_args.h" +#include "util/util_foreach.h" +#include "util/util_path.h" +#include "util/util_stats.h" +#include "util/util_string.h" +#include "util/util_task.h" +#include "util/util_logging.h" using namespace ccl; diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index 9816d614a7c..0cd249f0d84 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -16,29 +16,29 @@ #include <stdio.h> -#include "buffers.h" -#include "camera.h" -#include "device.h" -#include "scene.h" -#include "session.h" -#include "integrator.h" - -#include "util_args.h" -#include "util_foreach.h" -#include "util_function.h" -#include "util_logging.h" -#include "util_path.h" -#include "util_progress.h" -#include "util_string.h" -#include "util_time.h" -#include "util_transform.h" -#include "util_version.h" +#include "render/buffers.h" +#include "render/camera.h" +#include "device/device.h" +#include "render/scene.h" +#include "render/session.h" +#include "render/integrator.h" + +#include "util/util_args.h" +#include "util/util_foreach.h" +#include "util/util_function.h" +#include "util/util_logging.h" +#include "util/util_path.h" +#include "util/util_progress.h" +#include "util/util_string.h" +#include "util/util_time.h" +#include "util/util_transform.h" +#include "util/util_version.h" #ifdef WITH_CYCLES_STANDALONE_GUI -#include "util_view.h" +#include "util/util_view.h" #endif -#include "cycles_xml.h" +#include "app/cycles_xml.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index 35a30ae683f..04f00ef0e10 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -20,31 +20,31 @@ #include <algorithm> #include <iterator> -#include "node_xml.h" - -#include "background.h" -#include "camera.h" -#include "film.h" -#include "graph.h" -#include "integrator.h" -#include "light.h" -#include "mesh.h" -#include "nodes.h" -#include "object.h" -#include "osl.h" -#include "shader.h" -#include "scene.h" - -#include "subd_patch.h" -#include "subd_split.h" - -#include "util_debug.h" -#include "util_foreach.h" -#include "util_path.h" -#include "util_transform.h" -#include "util_xml.h" - -#include "cycles_xml.h" +#include "graph/node_xml.h" + +#include "render/background.h" +#include "render/camera.h" +#include "render/film.h" +#include "render/graph.h" +#include "render/integrator.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/nodes.h" +#include "render/object.h" +#include "render/osl.h" +#include "render/shader.h" +#include "render/scene.h" + +#include "subd/subd_patch.h" +#include "subd/subd_split.h" + +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_path.h" +#include "util/util_transform.h" +#include "util/util_xml.h" + +#include "app/cycles_xml.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index b57502b3b14..ae4977aaed0 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -1,12 +1,6 @@ set(INC - ../graph - ../render - ../device - ../kernel - ../kernel/svm - ../util - ../subd + .. ../../glew-mx ../../guardedalloc ../../mikktspace diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index f5e91d9565b..b8ff195d4a9 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -184,9 +184,6 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): sub.label(text="AA Samples:") sub.prop(cscene, "aa_samples", text="Render") sub.prop(cscene, "preview_aa_samples", text="Preview") - sub.separator() - sub.prop(cscene, "sample_all_lights_direct") - sub.prop(cscene, "sample_all_lights_indirect") col = split.column() sub = col.column(align=True) @@ -203,6 +200,10 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): sub.prop(cscene, "subsurface_samples", text="Subsurface") sub.prop(cscene, "volume_samples", text="Volume") + col = layout.column(align=True) + col.prop(cscene, "sample_all_lights_direct") + col.prop(cscene, "sample_all_lights_indirect") + if not (use_opencl(context) and cscene.feature_set != 'EXPERIMENTAL'): layout.row().prop(cscene, "sampling_pattern", text="Pattern") @@ -268,7 +269,7 @@ class CyclesRender_PT_geometry(CyclesButtonsPanel, Panel): row = col.row() row.prop(ccscene, "minimum_width", text="Min Pixels") - row.prop(ccscene, "maximum_width", text="Max Ext.") + row.prop(ccscene, "maximum_width", text="Max Extension") class CyclesRender_PT_light_paths(CyclesButtonsPanel, Panel): @@ -823,6 +824,8 @@ class CyclesObject_PT_cycles_settings(CyclesButtonsPanel, Panel): if ob.type != 'LAMP': flow.prop(visibility, "shadow") + layout.prop(cob, "is_shadow_catcher") + col = layout.column() col.label(text="Performance:") row = col.row() @@ -834,9 +837,6 @@ class CyclesObject_PT_cycles_settings(CyclesButtonsPanel, Panel): sub.active = scene.render.use_simplify and cscene.use_distance_cull sub.prop(cob, "use_distance_cull") - col = layout.column() - col.prop(cob, "is_shadow_catcher") - class CYCLES_OT_use_shading_nodes(Operator): """Enable nodes on a material, world or lamp""" diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp index f02fc553908..40d6b25f2b7 100644 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "camera.h" -#include "scene.h" +#include "render/camera.h" +#include "render/scene.h" -#include "blender_sync.h" -#include "blender_util.h" +#include "blender/blender_sync.h" +#include "blender/blender_util.h" -#include "util_logging.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index ffa5b676917..6fa038e8bf0 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "attribute.h" -#include "camera.h" -#include "curves.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" - -#include "blender_sync.h" -#include "blender_util.h" - -#include "util_foreach.h" -#include "util_logging.h" +#include "render/attribute.h" +#include "render/camera.h" +#include "render/curves.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" + +#include "blender/blender_sync.h" +#include "blender/blender_util.h" + +#include "util/util_foreach.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_logging.cpp b/intern/cycles/blender/blender_logging.cpp index f4f86929168..d0f82e37662 100644 --- a/intern/cycles/blender/blender_logging.cpp +++ b/intern/cycles/blender/blender_logging.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "CCL_api.h" -#include "util_logging.h" +#include "blender/CCL_api.h" +#include "util/util_logging.h" void CCL_init_logging(const char *argv0) { diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index f949b530f90..e0e89cec65c 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -15,22 +15,22 @@ */ -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "camera.h" - -#include "blender_sync.h" -#include "blender_session.h" -#include "blender_util.h" - -#include "subd_patch.h" -#include "subd_split.h" - -#include "util_algorithm.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_math.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/camera.h" + +#include "blender/blender_sync.h" +#include "blender/blender_session.h" +#include "blender/blender_util.h" + +#include "subd/subd_patch.h" +#include "subd/subd_split.h" + +#include "util/util_algorithm.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_math.h" #include "mikktspace.h" diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 968861391a2..d05699236cc 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -14,24 +14,24 @@ * limitations under the License. */ -#include "camera.h" -#include "integrator.h" -#include "graph.h" -#include "light.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "nodes.h" -#include "particles.h" -#include "shader.h" - -#include "blender_object_cull.h" -#include "blender_sync.h" -#include "blender_util.h" - -#include "util_foreach.h" -#include "util_hash.h" -#include "util_logging.h" +#include "render/camera.h" +#include "render/integrator.h" +#include "render/graph.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/nodes.h" +#include "render/particles.h" +#include "render/shader.h" + +#include "blender/blender_object_cull.h" +#include "blender/blender_sync.h" +#include "blender/blender_util.h" + +#include "util/util_foreach.h" +#include "util/util_hash.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_object_cull.cpp b/intern/cycles/blender/blender_object_cull.cpp index 08918dd1a49..0333c027f70 100644 --- a/intern/cycles/blender/blender_object_cull.cpp +++ b/intern/cycles/blender/blender_object_cull.cpp @@ -16,9 +16,9 @@ #include <cstdlib> -#include "camera.h" +#include "render/camera.h" -#include "blender_object_cull.h" +#include "blender/blender_object_cull.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_object_cull.h b/intern/cycles/blender/blender_object_cull.h index b6f0ca5cd31..2147877a860 100644 --- a/intern/cycles/blender/blender_object_cull.h +++ b/intern/cycles/blender/blender_object_cull.h @@ -17,8 +17,8 @@ #ifndef __BLENDER_OBJECT_CULL_H__ #define __BLENDER_OBJECT_CULL_H__ -#include "blender_sync.h" -#include "util_types.h" +#include "blender/blender_sync.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_particles.cpp b/intern/cycles/blender/blender_particles.cpp index dd2900a8d5b..00f8cb3cf1b 100644 --- a/intern/cycles/blender/blender_particles.cpp +++ b/intern/cycles/blender/blender_particles.cpp @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "mesh.h" -#include "object.h" -#include "particles.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/particles.h" -#include "blender_sync.h" -#include "blender_util.h" +#include "blender/blender_sync.h" +#include "blender/blender_util.h" -#include "util_foreach.h" +#include "util/util_foreach.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 557c4e8c5f0..d509e9de981 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -16,21 +16,21 @@ #include <Python.h> -#include "CCL_api.h" +#include "blender/CCL_api.h" -#include "blender_sync.h" -#include "blender_session.h" +#include "blender/blender_sync.h" +#include "blender/blender_session.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_opengl.h" -#include "util_path.h" -#include "util_string.h" -#include "util_types.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_opengl.h" +#include "util/util_path.h" +#include "util/util_string.h" +#include "util/util_types.h" #ifdef WITH_OSL -#include "osl.h" +#include "render/osl.h" #include <OSL/oslquery.h> #include <OSL/oslconfig.h> diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 1535193270d..c3ce0ea7e34 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -16,30 +16,30 @@ #include <stdlib.h> -#include "background.h" -#include "buffers.h" -#include "camera.h" -#include "device.h" -#include "integrator.h" -#include "film.h" -#include "light.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "session.h" -#include "shader.h" - -#include "util_color.h" -#include "util_foreach.h" -#include "util_function.h" -#include "util_hash.h" -#include "util_logging.h" -#include "util_progress.h" -#include "util_time.h" - -#include "blender_sync.h" -#include "blender_session.h" -#include "blender_util.h" +#include "render/background.h" +#include "render/buffers.h" +#include "render/camera.h" +#include "device/device.h" +#include "render/integrator.h" +#include "render/film.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/session.h" +#include "render/shader.h" + +#include "util/util_color.h" +#include "util/util_foreach.h" +#include "util/util_function.h" +#include "util/util_hash.h" +#include "util/util_logging.h" +#include "util/util_progress.h" +#include "util/util_time.h" + +#include "blender/blender_sync.h" +#include "blender/blender_session.h" +#include "blender/blender_util.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_session.h b/intern/cycles/blender/blender_session.h index bd9ebab3090..536808c5b18 100644 --- a/intern/cycles/blender/blender_session.h +++ b/intern/cycles/blender/blender_session.h @@ -17,12 +17,12 @@ #ifndef __BLENDER_SESSION_H__ #define __BLENDER_SESSION_H__ -#include "device.h" -#include "scene.h" -#include "session.h" -#include "bake.h" +#include "device/device.h" +#include "render/scene.h" +#include "render/session.h" +#include "render/bake.h" -#include "util_vector.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index f35565d8330..0cd4b90340b 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "background.h" -#include "graph.h" -#include "light.h" -#include "nodes.h" -#include "osl.h" -#include "scene.h" -#include "shader.h" - -#include "blender_texture.h" -#include "blender_sync.h" -#include "blender_util.h" - -#include "util_debug.h" -#include "util_string.h" -#include "util_task.h" +#include "render/background.h" +#include "render/graph.h" +#include "render/light.h" +#include "render/nodes.h" +#include "render/osl.h" +#include "render/scene.h" +#include "render/shader.h" + +#include "blender/blender_texture.h" +#include "blender/blender_sync.h" +#include "blender/blender_util.h" + +#include "util/util_debug.h" +#include "util/util_string.h" +#include "util/util_task.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index d8043105cd8..3b071bf0e7d 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -14,29 +14,29 @@ * limitations under the License. */ -#include "background.h" -#include "camera.h" -#include "film.h" -#include "graph.h" -#include "integrator.h" -#include "light.h" -#include "mesh.h" -#include "nodes.h" -#include "object.h" -#include "scene.h" -#include "shader.h" -#include "curves.h" - -#include "device.h" - -#include "blender_sync.h" -#include "blender_session.h" -#include "blender_util.h" - -#include "util_debug.h" -#include "util_foreach.h" -#include "util_opengl.h" -#include "util_hash.h" +#include "render/background.h" +#include "render/camera.h" +#include "render/film.h" +#include "render/graph.h" +#include "render/integrator.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/nodes.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/curves.h" + +#include "device/device.h" + +#include "blender/blender_sync.h" +#include "blender/blender_session.h" +#include "blender/blender_util.h" + +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_opengl.h" +#include "util/util_hash.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 6984cbda259..36bedc505af 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -22,15 +22,15 @@ #include "RNA_access.h" #include "RNA_blender_cpp.h" -#include "blender_util.h" +#include "blender/blender_util.h" -#include "scene.h" -#include "session.h" +#include "render/scene.h" +#include "render/session.h" -#include "util_map.h" -#include "util_set.h" -#include "util_transform.h" -#include "util_vector.h" +#include "util/util_map.h" +#include "util/util_set.h" +#include "util/util_transform.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_texture.cpp b/intern/cycles/blender/blender_texture.cpp index 3807e683c7c..b2e27b76189 100644 --- a/intern/cycles/blender/blender_texture.cpp +++ b/intern/cycles/blender/blender_texture.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "blender_texture.h" +#include "blender/blender_texture.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_texture.h b/intern/cycles/blender/blender_texture.h index ad96f9db8ed..734231a85ec 100644 --- a/intern/cycles/blender/blender_texture.h +++ b/intern/cycles/blender/blender_texture.h @@ -18,7 +18,7 @@ #define __BLENDER_TEXTURE_H__ #include <stdlib.h> -#include "blender_sync.h" +#include "blender/blender_sync.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 23df3c1bc30..4d575330520 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -17,15 +17,15 @@ #ifndef __BLENDER_UTIL_H__ #define __BLENDER_UTIL_H__ -#include "mesh.h" - -#include "util_algorithm.h" -#include "util_map.h" -#include "util_path.h" -#include "util_set.h" -#include "util_transform.h" -#include "util_types.h" -#include "util_vector.h" +#include "render/mesh.h" + +#include "util/util_algorithm.h" +#include "util/util_map.h" +#include "util/util_path.h" +#include "util/util_set.h" +#include "util/util_transform.h" +#include "util/util_types.h" +#include "util/util_vector.h" /* Hacks to hook into Blender API * todo: clean this up ... */ diff --git a/intern/cycles/bvh/CMakeLists.txt b/intern/cycles/bvh/CMakeLists.txt index 92e48f0d87f..4701d75350a 100644 --- a/intern/cycles/bvh/CMakeLists.txt +++ b/intern/cycles/bvh/CMakeLists.txt @@ -1,12 +1,6 @@ set(INC - . - ../graph - ../kernel - ../kernel/svm - ../render - ../util - ../device + .. ) set(INC_SYS diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index 1fb2f371a0f..58348d16746 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -15,25 +15,25 @@ * limitations under the License. */ -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "curves.h" - -#include "bvh.h" -#include "bvh_build.h" -#include "bvh_node.h" -#include "bvh_params.h" -#include "bvh_unaligned.h" - -#include "util_debug.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_map.h" -#include "util_progress.h" -#include "util_system.h" -#include "util_types.h" -#include "util_math.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/curves.h" + +#include "bvh/bvh.h" +#include "bvh/bvh_build.h" +#include "bvh/bvh_node.h" +#include "bvh/bvh_params.h" +#include "bvh/bvh_unaligned.h" + +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_map.h" +#include "util/util_progress.h" +#include "util/util_system.h" +#include "util/util_types.h" +#include "util/util_math.h" CCL_NAMESPACE_BEGIN @@ -67,7 +67,7 @@ BVH *BVH::create(const BVHParams& params, const vector<Object*>& objects) if(params.use_qbvh) return new QBVH(params, objects); else - return new RegularBVH(params, objects); + return new BinaryBVH(params, objects); } /* Building */ @@ -424,64 +424,64 @@ static bool node_bvh_is_unaligned(const BVHNode *node) { const BVHNode *node0 = node->get_child(0), *node1 = node->get_child(1); - return node0->is_unaligned() || node1->is_unaligned(); + return node0->is_unaligned || node1->is_unaligned; } -RegularBVH::RegularBVH(const BVHParams& params_, const vector<Object*>& objects_) +BinaryBVH::BinaryBVH(const BVHParams& params_, const vector<Object*>& objects_) : BVH(params_, objects_) { } -void RegularBVH::pack_leaf(const BVHStackEntry& e, - const LeafNode *leaf) +void BinaryBVH::pack_leaf(const BVHStackEntry& e, + const LeafNode *leaf) { assert(e.idx + BVH_NODE_LEAF_SIZE <= pack.leaf_nodes.size()); float4 data[BVH_NODE_LEAF_SIZE]; memset(data, 0, sizeof(data)); - if(leaf->num_triangles() == 1 && pack.prim_index[leaf->m_lo] == -1) { + if(leaf->num_triangles() == 1 && pack.prim_index[leaf->lo] == -1) { /* object */ - data[0].x = __int_as_float(~(leaf->m_lo)); + data[0].x = __int_as_float(~(leaf->lo)); data[0].y = __int_as_float(0); } else { /* triangle */ - data[0].x = __int_as_float(leaf->m_lo); - data[0].y = __int_as_float(leaf->m_hi); + data[0].x = __int_as_float(leaf->lo); + data[0].y = __int_as_float(leaf->hi); } - data[0].z = __uint_as_float(leaf->m_visibility); + data[0].z = __uint_as_float(leaf->visibility); if(leaf->num_triangles() != 0) { - data[0].w = __uint_as_float(pack.prim_type[leaf->m_lo]); + data[0].w = __uint_as_float(pack.prim_type[leaf->lo]); } memcpy(&pack.leaf_nodes[e.idx], data, sizeof(float4)*BVH_NODE_LEAF_SIZE); } -void RegularBVH::pack_inner(const BVHStackEntry& e, - const BVHStackEntry& e0, - const BVHStackEntry& e1) +void BinaryBVH::pack_inner(const BVHStackEntry& e, + const BVHStackEntry& e0, + const BVHStackEntry& e1) { - if(e0.node->is_unaligned() || e1.node->is_unaligned()) { + if(e0.node->is_unaligned || e1.node->is_unaligned) { pack_unaligned_inner(e, e0, e1); } else { pack_aligned_inner(e, e0, e1); } } -void RegularBVH::pack_aligned_inner(const BVHStackEntry& e, - const BVHStackEntry& e0, - const BVHStackEntry& e1) +void BinaryBVH::pack_aligned_inner(const BVHStackEntry& e, + const BVHStackEntry& e0, + const BVHStackEntry& e1) { pack_aligned_node(e.idx, - e0.node->m_bounds, e1.node->m_bounds, + e0.node->bounds, e1.node->bounds, e0.encodeIdx(), e1.encodeIdx(), - e0.node->m_visibility, e1.node->m_visibility); + e0.node->visibility, e1.node->visibility); } -void RegularBVH::pack_aligned_node(int idx, - const BoundBox& b0, - const BoundBox& b1, - int c0, int c1, - uint visibility0, uint visibility1) +void BinaryBVH::pack_aligned_node(int idx, + const BoundBox& b0, + const BoundBox& b1, + int c0, int c1, + uint visibility0, uint visibility1) { assert(idx + BVH_NODE_SIZE <= pack.nodes.size()); assert(c0 < 0 || c0 < pack.nodes.size()); @@ -508,26 +508,26 @@ void RegularBVH::pack_aligned_node(int idx, memcpy(&pack.nodes[idx], data, sizeof(int4)*BVH_NODE_SIZE); } -void RegularBVH::pack_unaligned_inner(const BVHStackEntry& e, - const BVHStackEntry& e0, - const BVHStackEntry& e1) +void BinaryBVH::pack_unaligned_inner(const BVHStackEntry& e, + const BVHStackEntry& e0, + const BVHStackEntry& e1) { pack_unaligned_node(e.idx, e0.node->get_aligned_space(), e1.node->get_aligned_space(), - e0.node->m_bounds, - e1.node->m_bounds, + e0.node->bounds, + e1.node->bounds, e0.encodeIdx(), e1.encodeIdx(), - e0.node->m_visibility, e1.node->m_visibility); + e0.node->visibility, e1.node->visibility); } -void RegularBVH::pack_unaligned_node(int idx, - const Transform& aligned_space0, - const Transform& aligned_space1, - const BoundBox& bounds0, - const BoundBox& bounds1, - int c0, int c1, - uint visibility0, uint visibility1) +void BinaryBVH::pack_unaligned_node(int idx, + const Transform& aligned_space0, + const Transform& aligned_space1, + const BoundBox& bounds0, + const BoundBox& bounds1, + int c0, int c1, + uint visibility0, uint visibility1) { assert(idx + BVH_UNALIGNED_NODE_SIZE <= pack.nodes.size()); assert(c0 < 0 || c0 < pack.nodes.size()); @@ -553,7 +553,7 @@ void RegularBVH::pack_unaligned_node(int idx, memcpy(&pack.nodes[idx], data, sizeof(float4)*BVH_UNALIGNED_NODE_SIZE); } -void RegularBVH::pack_nodes(const BVHNode *root) +void BinaryBVH::pack_nodes(const BVHNode *root) { const size_t num_nodes = root->getSubtreeSize(BVH_STAT_NODE_COUNT); const size_t num_leaf_nodes = root->getSubtreeSize(BVH_STAT_LEAF_COUNT); @@ -630,7 +630,7 @@ void RegularBVH::pack_nodes(const BVHNode *root) pack.root_index = (root->is_leaf())? -1: 0; } -void RegularBVH::refit_nodes() +void BinaryBVH::refit_nodes() { assert(!params.top_level); @@ -639,7 +639,7 @@ void RegularBVH::refit_nodes() refit_node(0, (pack.root_index == -1)? true: false, bbox, visibility); } -void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility) +void BinaryBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility) { if(leaf) { assert(idx + BVH_NODE_LEAF_SIZE <= pack.leaf_nodes.size()); @@ -769,18 +769,18 @@ static bool node_qbvh_is_unaligned(const BVHNode *node) *node1 = node->get_child(1); bool has_unaligned = false; if(node0->is_leaf()) { - has_unaligned |= node0->is_unaligned(); + has_unaligned |= node0->is_unaligned; } else { - has_unaligned |= node0->get_child(0)->is_unaligned(); - has_unaligned |= node0->get_child(1)->is_unaligned(); + has_unaligned |= node0->get_child(0)->is_unaligned; + has_unaligned |= node0->get_child(1)->is_unaligned; } if(node1->is_leaf()) { - has_unaligned |= node1->is_unaligned(); + has_unaligned |= node1->is_unaligned; } else { - has_unaligned |= node1->get_child(0)->is_unaligned(); - has_unaligned |= node1->get_child(1)->is_unaligned(); + has_unaligned |= node1->get_child(0)->is_unaligned; + has_unaligned |= node1->get_child(1)->is_unaligned; } return has_unaligned; } @@ -795,19 +795,19 @@ void QBVH::pack_leaf(const BVHStackEntry& e, const LeafNode *leaf) { float4 data[BVH_QNODE_LEAF_SIZE]; memset(data, 0, sizeof(data)); - if(leaf->num_triangles() == 1 && pack.prim_index[leaf->m_lo] == -1) { + if(leaf->num_triangles() == 1 && pack.prim_index[leaf->lo] == -1) { /* object */ - data[0].x = __int_as_float(~(leaf->m_lo)); + data[0].x = __int_as_float(~(leaf->lo)); data[0].y = __int_as_float(0); } else { /* triangle */ - data[0].x = __int_as_float(leaf->m_lo); - data[0].y = __int_as_float(leaf->m_hi); + data[0].x = __int_as_float(leaf->lo); + data[0].y = __int_as_float(leaf->hi); } - data[0].z = __uint_as_float(leaf->m_visibility); + data[0].z = __uint_as_float(leaf->visibility); if(leaf->num_triangles() != 0) { - data[0].w = __uint_as_float(pack.prim_type[leaf->m_lo]); + data[0].w = __uint_as_float(pack.prim_type[leaf->lo]); } memcpy(&pack.leaf_nodes[e.idx], data, sizeof(float4)*BVH_QNODE_LEAF_SIZE); @@ -823,7 +823,7 @@ void QBVH::pack_inner(const BVHStackEntry& e, */ if(params.use_unaligned_nodes) { for(int i = 0; i < num; i++) { - if(en[i].node->is_unaligned()) { + if(en[i].node->is_unaligned) { has_unaligned = true; break; } @@ -848,15 +848,15 @@ void QBVH::pack_aligned_inner(const BVHStackEntry& e, BoundBox bounds[4]; int child[4]; for(int i = 0; i < num; ++i) { - bounds[i] = en[i].node->m_bounds; + bounds[i] = en[i].node->bounds; child[i] = en[i].encodeIdx(); } pack_aligned_node(e.idx, bounds, child, - e.node->m_visibility, - e.node->m_time_from, - e.node->m_time_to, + e.node->visibility, + e.node->time_from, + e.node->time_to, num); } @@ -917,16 +917,16 @@ void QBVH::pack_unaligned_inner(const BVHStackEntry& e, int child[4]; for(int i = 0; i < num; ++i) { aligned_space[i] = en[i].node->get_aligned_space(); - bounds[i] = en[i].node->m_bounds; + bounds[i] = en[i].node->bounds; child[i] = en[i].encodeIdx(); } pack_unaligned_node(e.idx, aligned_space, bounds, child, - e.node->m_visibility, - e.node->m_time_from, - e.node->m_time_to, + e.node->visibility, + e.node->time_from, + e.node->time_to, num); } diff --git a/intern/cycles/bvh/bvh.h b/intern/cycles/bvh/bvh.h index 08f41fc736f..60bc62ee6e4 100644 --- a/intern/cycles/bvh/bvh.h +++ b/intern/cycles/bvh/bvh.h @@ -18,10 +18,10 @@ #ifndef __BVH_H__ #define __BVH_H__ -#include "bvh_params.h" +#include "bvh/bvh_params.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN @@ -110,15 +110,15 @@ protected: virtual void refit_nodes() = 0; }; -/* Regular BVH +/* Binary BVH * * Typical BVH with each node having two children. */ -class RegularBVH : public BVH { +class BinaryBVH : public BVH { protected: /* constructor */ friend class BVH; - RegularBVH(const BVHParams& params, const vector<Object*>& objects); + BinaryBVH(const BVHParams& params, const vector<Object*>& objects); /* pack */ void pack_nodes(const BVHNode *root); diff --git a/intern/cycles/bvh/bvh_binning.cpp b/intern/cycles/bvh/bvh_binning.cpp index 5ddd7349f7b..3226008f511 100644 --- a/intern/cycles/bvh/bvh_binning.cpp +++ b/intern/cycles/bvh/bvh_binning.cpp @@ -19,11 +19,11 @@ #include <stdlib.h> -#include "bvh_binning.h" +#include "bvh/bvh_binning.h" -#include "util_algorithm.h" -#include "util_boundbox.h" -#include "util_types.h" +#include "util/util_algorithm.h" +#include "util/util_boundbox.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_binning.h b/intern/cycles/bvh/bvh_binning.h index 52955f70151..285f9c56a62 100644 --- a/intern/cycles/bvh/bvh_binning.h +++ b/intern/cycles/bvh/bvh_binning.h @@ -18,10 +18,10 @@ #ifndef __BVH_BINNING_H__ #define __BVH_BINNING_H__ -#include "bvh_params.h" -#include "bvh_unaligned.h" +#include "bvh/bvh_params.h" +#include "bvh/bvh_unaligned.h" -#include "util_types.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 517afc75641..95c71b54da0 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -15,26 +15,26 @@ * limitations under the License. */ -#include "bvh_binning.h" -#include "bvh_build.h" -#include "bvh_node.h" -#include "bvh_params.h" +#include "bvh/bvh_binning.h" +#include "bvh/bvh_build.h" +#include "bvh/bvh_node.h" +#include "bvh/bvh_params.h" #include "bvh_split.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "curves.h" - -#include "util_algorithm.h" -#include "util_debug.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_progress.h" -#include "util_stack_allocator.h" -#include "util_simd.h" -#include "util_time.h" -#include "util_queue.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/curves.h" + +#include "util/util_algorithm.h" +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_progress.h" +#include "util/util_stack_allocator.h" +#include "util/util_simd.h" +#include "util/util_time.h" +#include "util/util_queue.h" CCL_NAMESPACE_BEGIN @@ -866,8 +866,8 @@ BVHNode *BVHBuild::create_object_leaf_nodes(const BVHReference *ref, int start, uint visibility = objects[ref->prim_object()]->visibility; BVHNode *leaf_node = new LeafNode(ref->bounds(), visibility, start, start+1); - leaf_node->m_time_from = ref->time_from(); - leaf_node->m_time_to = ref->time_to(); + leaf_node->time_from = ref->time_from(); + leaf_node->time_to = ref->time_to(); return leaf_node; } else { @@ -876,12 +876,12 @@ BVHNode *BVHBuild::create_object_leaf_nodes(const BVHReference *ref, int start, BVHNode *leaf1 = create_object_leaf_nodes(ref+mid, start+mid, num-mid); BoundBox bounds = BoundBox::empty; - bounds.grow(leaf0->m_bounds); - bounds.grow(leaf1->m_bounds); + bounds.grow(leaf0->bounds); + bounds.grow(leaf1->bounds); BVHNode *inner_node = new InnerNode(bounds, leaf0, leaf1); - inner_node->m_time_from = min(leaf0->m_time_from, leaf1->m_time_from); - inner_node->m_time_to = max(leaf0->m_time_to, leaf1->m_time_to); + inner_node->time_from = min(leaf0->time_from, leaf1->time_from); + inner_node->time_to = max(leaf0->time_to, leaf1->time_to); return inner_node; } } @@ -1004,19 +1004,19 @@ BVHNode* BVHBuild::create_leaf_node(const BVHRange& range, time_from = min(time_from, ref.time_from()); time_to = max(time_to, ref.time_to()); } - leaf_node->m_time_from = time_from; - leaf_node->m_time_to = time_to; + leaf_node->time_from = time_from; + leaf_node->time_to = time_to; } if(alignment_found) { /* Need to recalculate leaf bounds with new alignment. */ - leaf_node->m_bounds = BoundBox::empty; + leaf_node->bounds = BoundBox::empty; for(int j = 0; j < num; ++j) { const BVHReference &ref = p_ref[i][j]; BoundBox ref_bounds = unaligned_heuristic.compute_aligned_prim_boundbox( ref, aligned_space); - leaf_node->m_bounds.grow(ref_bounds); + leaf_node->bounds.grow(ref_bounds); } /* Set alignment space. */ leaf_node->set_aligned_space(aligned_space); @@ -1099,8 +1099,8 @@ BVHNode* BVHBuild::create_leaf_node(const BVHRange& range, */ for(int i = 0; i < num_leaves; ++i) { LeafNode *leaf = (LeafNode *)leaves[i]; - leaf->m_lo += start_index; - leaf->m_hi += start_index; + leaf->lo += start_index; + leaf->hi += start_index; } /* Create leaf node for object. */ @@ -1129,17 +1129,17 @@ BVHNode* BVHBuild::create_leaf_node(const BVHRange& range, return new InnerNode(range.bounds(), leaves[0], leaves[1]); } else if(num_leaves == 3) { - BoundBox inner_bounds = merge(leaves[1]->m_bounds, leaves[2]->m_bounds); + BoundBox inner_bounds = merge(leaves[1]->bounds, leaves[2]->bounds); BVHNode *inner = new InnerNode(inner_bounds, leaves[1], leaves[2]); return new InnerNode(range.bounds(), leaves[0], inner); } else { /* Should be doing more branches if more primitive types added. */ assert(num_leaves <= 5); - BoundBox inner_bounds_a = merge(leaves[0]->m_bounds, leaves[1]->m_bounds); - BoundBox inner_bounds_b = merge(leaves[2]->m_bounds, leaves[3]->m_bounds); + BoundBox inner_bounds_a = merge(leaves[0]->bounds, leaves[1]->bounds); + BoundBox inner_bounds_b = merge(leaves[2]->bounds, leaves[3]->bounds); BVHNode *inner_a = new InnerNode(inner_bounds_a, leaves[0], leaves[1]); BVHNode *inner_b = new InnerNode(inner_bounds_b, leaves[2], leaves[3]); - BoundBox inner_bounds_c = merge(inner_a->m_bounds, inner_b->m_bounds); + BoundBox inner_bounds_c = merge(inner_a->bounds, inner_b->bounds); BVHNode *inner_c = new InnerNode(inner_bounds_c, inner_a, inner_b); if(num_leaves == 5) { return new InnerNode(range.bounds(), inner_c, leaves[4]); @@ -1174,8 +1174,8 @@ void BVHBuild::rotate(BVHNode *node, int max_depth) rotate(parent->children[c], max_depth-1); /* compute current area of all children */ - BoundBox bounds0 = parent->children[0]->m_bounds; - BoundBox bounds1 = parent->children[1]->m_bounds; + BoundBox bounds0 = parent->children[0]->bounds; + BoundBox bounds1 = parent->children[1]->bounds; float area0 = bounds0.half_area(); float area1 = bounds1.half_area(); @@ -1195,8 +1195,8 @@ void BVHBuild::rotate(BVHNode *node, int max_depth) BoundBox& other = (c == 0)? bounds1: bounds0; /* transpose child bounds */ - BoundBox target0 = child->children[0]->m_bounds; - BoundBox target1 = child->children[1]->m_bounds; + BoundBox target0 = child->children[0]->bounds; + BoundBox target1 = child->children[1]->bounds; /* compute cost for both possible swaps */ float cost0 = merge(other, target1).half_area() - child_area[c]; @@ -1228,7 +1228,7 @@ void BVHBuild::rotate(BVHNode *node, int max_depth) InnerNode *child = (InnerNode*)parent->children[best_child]; swap(parent->children[best_other], child->children[best_target]); - child->m_bounds = merge(child->children[0]->m_bounds, child->children[1]->m_bounds); + child->bounds = merge(child->children[0]->bounds, child->children[1]->bounds); } CCL_NAMESPACE_END diff --git a/intern/cycles/bvh/bvh_build.h b/intern/cycles/bvh/bvh_build.h index 430efc3e0f6..5733708050d 100644 --- a/intern/cycles/bvh/bvh_build.h +++ b/intern/cycles/bvh/bvh_build.h @@ -20,13 +20,13 @@ #include <float.h> -#include "bvh.h" -#include "bvh_binning.h" -#include "bvh_unaligned.h" +#include "bvh/bvh.h" +#include "bvh/bvh_binning.h" +#include "bvh/bvh_unaligned.h" -#include "util_boundbox.h" -#include "util_task.h" -#include "util_vector.h" +#include "util/util_boundbox.h" +#include "util/util_task.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_node.cpp b/intern/cycles/bvh/bvh_node.cpp index 67580e1bc7b..4f788c66797 100644 --- a/intern/cycles/bvh/bvh_node.cpp +++ b/intern/cycles/bvh/bvh_node.cpp @@ -15,12 +15,12 @@ * limitations under the License. */ -#include "bvh.h" -#include "bvh_build.h" -#include "bvh_node.h" +#include "bvh/bvh.h" +#include "bvh/bvh_build.h" +#include "bvh/bvh_node.h" -#include "util_debug.h" -#include "util_vector.h" +#include "util/util_debug.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN @@ -62,12 +62,12 @@ int BVHNode::getSubtreeSize(BVH_STAT stat) const } return cnt; case BVH_STAT_ALIGNED_COUNT: - if(!is_unaligned()) { + if(!is_unaligned) { cnt = 1; } break; case BVH_STAT_UNALIGNED_COUNT: - if(is_unaligned()) { + if(is_unaligned) { cnt = 1; } break; @@ -75,7 +75,7 @@ int BVHNode::getSubtreeSize(BVH_STAT stat) const if(!is_leaf()) { bool has_unaligned = false; for(int j = 0; j < num_children(); j++) { - has_unaligned |= get_child(j)->is_unaligned(); + has_unaligned |= get_child(j)->is_unaligned; } cnt += has_unaligned? 0: 1; } @@ -84,7 +84,7 @@ int BVHNode::getSubtreeSize(BVH_STAT stat) const if(!is_leaf()) { bool has_unaligned = false; for(int j = 0; j < num_children(); j++) { - has_unaligned |= get_child(j)->is_unaligned(); + has_unaligned |= get_child(j)->is_unaligned; } cnt += has_unaligned? 1: 0; } @@ -95,12 +95,12 @@ int BVHNode::getSubtreeSize(BVH_STAT stat) const for(int i = 0; i < num_children(); i++) { BVHNode *node = get_child(i); if(node->is_leaf()) { - has_unaligned |= node->is_unaligned(); + has_unaligned |= node->is_unaligned; } else { for(int j = 0; j < node->num_children(); j++) { cnt += node->get_child(j)->getSubtreeSize(stat); - has_unaligned |= node->get_child(j)->is_unaligned(); + has_unaligned |= node->get_child(j)->is_unaligned; } } } @@ -113,12 +113,12 @@ int BVHNode::getSubtreeSize(BVH_STAT stat) const for(int i = 0; i < num_children(); i++) { BVHNode *node = get_child(i); if(node->is_leaf()) { - has_unaligned |= node->is_unaligned(); + has_unaligned |= node->is_unaligned; } else { for(int j = 0; j < node->num_children(); j++) { cnt += node->get_child(j)->getSubtreeSize(stat); - has_unaligned |= node->get_child(j)->is_unaligned(); + has_unaligned |= node->get_child(j)->is_unaligned; } } } @@ -126,10 +126,10 @@ int BVHNode::getSubtreeSize(BVH_STAT stat) const } return cnt; case BVH_STAT_ALIGNED_LEAF_COUNT: - cnt = (is_leaf() && !is_unaligned()) ? 1 : 0; + cnt = (is_leaf() && !is_unaligned) ? 1 : 0; break; case BVH_STAT_UNALIGNED_LEAF_COUNT: - cnt = (is_leaf() && is_unaligned()) ? 1 : 0; + cnt = (is_leaf() && is_unaligned) ? 1 : 0; break; default: assert(0); /* unknown mode */ @@ -157,7 +157,7 @@ float BVHNode::computeSubtreeSAHCost(const BVHParams& p, float probability) cons for(int i = 0; i < num_children(); i++) { BVHNode *child = get_child(i); - SAH += child->computeSubtreeSAHCost(p, probability * child->m_bounds.safe_area()/m_bounds.safe_area()); + SAH += child->computeSubtreeSAHCost(p, probability * child->bounds.safe_area()/bounds.safe_area()); } return SAH; @@ -165,15 +165,15 @@ float BVHNode::computeSubtreeSAHCost(const BVHParams& p, float probability) cons uint BVHNode::update_visibility() { - if(!is_leaf() && m_visibility == 0) { + if(!is_leaf() && visibility == 0) { InnerNode *inner = (InnerNode*)this; BVHNode *child0 = inner->children[0]; BVHNode *child1 = inner->children[1]; - m_visibility = child0->update_visibility()|child1->update_visibility(); + visibility = child0->update_visibility()|child1->update_visibility(); } - return m_visibility; + return visibility; } void BVHNode::update_time() @@ -184,8 +184,8 @@ void BVHNode::update_time() BVHNode *child1 = inner->children[1]; child0->update_time(); child1->update_time(); - m_time_from = min(child0->m_time_from, child1->m_time_from); - m_time_to = max(child0->m_time_to, child1->m_time_to); + time_from = min(child0->time_from, child1->time_from); + time_to = max(child0->time_to, child1->time_to); } } @@ -209,7 +209,7 @@ void LeafNode::print(int depth) const for(int i = 0; i < depth; i++) printf(" "); - printf("leaf node %d to %d\n", m_lo, m_hi); + printf("leaf node %d to %d\n", lo, hi); } CCL_NAMESPACE_END diff --git a/intern/cycles/bvh/bvh_node.h b/intern/cycles/bvh/bvh_node.h index 090c426de56..60511b4b012 100644 --- a/intern/cycles/bvh/bvh_node.h +++ b/intern/cycles/bvh/bvh_node.h @@ -18,9 +18,9 @@ #ifndef __BVH_NODE_H__ #define __BVH_NODE_H__ -#include "util_boundbox.h" -#include "util_debug.h" -#include "util_types.h" +#include "util/util_boundbox.h" +#include "util/util_debug.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN @@ -46,16 +46,16 @@ class BVHParams; class BVHNode { public: - BVHNode() : m_is_unaligned(false), - m_aligned_space(NULL), - m_time_from(0.0f), - m_time_to(1.0f) + BVHNode() : is_unaligned(false), + aligned_space(NULL), + time_from(0.0f), + time_to(1.0f) { } virtual ~BVHNode() { - delete m_aligned_space; + delete aligned_space; } virtual bool is_leaf() const = 0; @@ -63,30 +63,26 @@ public: virtual BVHNode *get_child(int i) const = 0; virtual int num_triangles() const { return 0; } virtual void print(int depth = 0) const = 0; - bool is_unaligned() const { return m_is_unaligned; } inline void set_aligned_space(const Transform& aligned_space) { - m_is_unaligned = true; - if(m_aligned_space == NULL) { - m_aligned_space = new Transform(aligned_space); + is_unaligned = true; + if(this->aligned_space == NULL) { + this->aligned_space = new Transform(aligned_space); } else { - *m_aligned_space = aligned_space; + *this->aligned_space = aligned_space; } } inline Transform get_aligned_space() const { - if(m_aligned_space == NULL) { + if(aligned_space == NULL) { return transform_identity(); } - return *m_aligned_space; + return *aligned_space; } - BoundBox m_bounds; - uint m_visibility; - // Subtree functions int getSubtreeSize(BVH_STAT stat=BVH_STAT_NODE_COUNT) const; float computeSubtreeSAHCost(const BVHParams& p, float probability = 1.0f) const; @@ -95,13 +91,18 @@ public: uint update_visibility(); void update_time(); - bool m_is_unaligned; + // Properties. + BoundBox bounds; + uint visibility; + + bool is_unaligned; - // TODO(sergey): Can be stored as 3x3 matrix, but better to have some - // utilities and type defines in util_transform first. - Transform *m_aligned_space; + /* TODO(sergey): Can be stored as 3x3 matrix, but better to have some + * utilities and type defines in util_transform first. + */ + Transform *aligned_space; - float m_time_from, m_time_to; + float time_from, time_to; }; class InnerNode : public BVHNode @@ -111,20 +112,20 @@ public: BVHNode* child0, BVHNode* child1) { - m_bounds = bounds; + this->bounds = bounds; children[0] = child0; children[1] = child1; if(child0 && child1) - m_visibility = child0->m_visibility|child1->m_visibility; + visibility = child0->visibility|child1->visibility; else - m_visibility = 0; /* happens on build cancel */ + visibility = 0; /* happens on build cancel */ } explicit InnerNode(const BoundBox& bounds) { - m_bounds = bounds; - m_visibility = 0; + this->bounds = bounds; + visibility = 0; children[0] = NULL; children[1] = NULL; } @@ -140,12 +141,12 @@ public: class LeafNode : public BVHNode { public: - LeafNode(const BoundBox& bounds, uint visibility, int lo, int hi) + LeafNode(const BoundBox& bounds, uint visibility, int lo, int hi) + : lo(lo), + hi(hi) { - m_bounds = bounds; - m_visibility = visibility; - m_lo = lo; - m_hi = hi; + this->bounds = bounds; + this->visibility = visibility; } LeafNode(const LeafNode& s) @@ -157,14 +158,13 @@ public: bool is_leaf() const { return true; } int num_children() const { return 0; } BVHNode *get_child(int) const { return NULL; } - int num_triangles() const { return m_hi - m_lo; } + int num_triangles() const { return hi - lo; } void print(int depth) const; - int m_lo; - int m_hi; + int lo; + int hi; }; CCL_NAMESPACE_END #endif /* __BVH_NODE_H__ */ - diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h index 7b309504728..9795a7a4350 100644 --- a/intern/cycles/bvh/bvh_params.h +++ b/intern/cycles/bvh/bvh_params.h @@ -18,9 +18,9 @@ #ifndef __BVH_PARAMS_H__ #define __BVH_PARAMS_H__ -#include "util_boundbox.h" +#include "util/util_boundbox.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_sort.cpp b/intern/cycles/bvh/bvh_sort.cpp index e5bcf9995bf..d29629c0279 100644 --- a/intern/cycles/bvh/bvh_sort.cpp +++ b/intern/cycles/bvh/bvh_sort.cpp @@ -15,12 +15,12 @@ * limitations under the License. */ -#include "bvh_build.h" -#include "bvh_sort.h" +#include "bvh/bvh_build.h" +#include "bvh/bvh_sort.h" -#include "util_algorithm.h" -#include "util_debug.h" -#include "util_task.h" +#include "util/util_algorithm.h" +#include "util/util_debug.h" +#include "util/util_task.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_split.cpp b/intern/cycles/bvh/bvh_split.cpp index d0d5fbe5a7a..b10d69a495d 100644 --- a/intern/cycles/bvh/bvh_split.cpp +++ b/intern/cycles/bvh/bvh_split.cpp @@ -15,14 +15,14 @@ * limitations under the License. */ -#include "bvh_build.h" -#include "bvh_split.h" -#include "bvh_sort.h" +#include "bvh/bvh_build.h" +#include "bvh/bvh_split.h" +#include "bvh/bvh_sort.h" -#include "mesh.h" -#include "object.h" +#include "render/mesh.h" +#include "render/object.h" -#include "util_algorithm.h" +#include "util/util_algorithm.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_split.h b/intern/cycles/bvh/bvh_split.h index dbdb51f1a5b..a874a118b99 100644 --- a/intern/cycles/bvh/bvh_split.h +++ b/intern/cycles/bvh/bvh_split.h @@ -18,8 +18,8 @@ #ifndef __BVH_SPLIT_H__ #define __BVH_SPLIT_H__ -#include "bvh_build.h" -#include "bvh_params.h" +#include "bvh/bvh_build.h" +#include "bvh/bvh_params.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_unaligned.cpp b/intern/cycles/bvh/bvh_unaligned.cpp index a876c670914..ef227d20ea9 100644 --- a/intern/cycles/bvh/bvh_unaligned.cpp +++ b/intern/cycles/bvh/bvh_unaligned.cpp @@ -15,17 +15,17 @@ */ -#include "bvh_unaligned.h" +#include "bvh/bvh_unaligned.h" -#include "mesh.h" -#include "object.h" +#include "render/mesh.h" +#include "render/object.h" -#include "bvh_binning.h" +#include "bvh/bvh_binning.h" #include "bvh_params.h" -#include "util_boundbox.h" -#include "util_debug.h" -#include "util_transform.h" +#include "util/util_boundbox.h" +#include "util/util_debug.h" +#include "util/util_transform.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/bvh/bvh_unaligned.h b/intern/cycles/bvh/bvh_unaligned.h index 4d0872f4a39..f41bae79e2b 100644 --- a/intern/cycles/bvh/bvh_unaligned.h +++ b/intern/cycles/bvh/bvh_unaligned.h @@ -17,7 +17,7 @@ #ifndef __BVH_UNALIGNED_H__ #define __BVH_UNALIGNED_H__ -#include "util_vector.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index 3dae2270cb8..74ec57ddf74 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -1,14 +1,6 @@ set(INC - . - ../graph - ../kernel - ../filter - ../kernel/split - ../kernel/svm - ../kernel/osl - ../util - ../render + .. ../../glew-mx ) diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 6b07b9d04bd..968af447e29 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -17,18 +17,18 @@ #include <stdlib.h> #include <string.h> -#include "device.h" -#include "device_intern.h" - -#include "util_debug.h" -#include "util_foreach.h" -#include "util_half.h" -#include "util_math.h" -#include "util_opengl.h" -#include "util_time.h" -#include "util_types.h" -#include "util_vector.h" -#include "util_string.h" +#include "device/device.h" +#include "device/device_intern.h" + +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_half.h" +#include "util/util_math.h" +#include "util/util_opengl.h" +#include "util/util_time.h" +#include "util/util_types.h" +#include "util/util_vector.h" +#include "util/util_string.h" CCL_NAMESPACE_BEGIN @@ -48,11 +48,11 @@ std::ostream& operator <<(std::ostream &os, os << "Max nodes group: " << requested_features.max_nodes_group << std::endl; /* TODO(sergey): Decode bitflag into list of names. */ os << "Nodes features: " << requested_features.nodes_features << std::endl; - os << "Use hair: " + os << "Use Hair: " << string_from_bool(requested_features.use_hair) << std::endl; - os << "Use object motion: " + os << "Use Object Motion: " << string_from_bool(requested_features.use_object_motion) << std::endl; - os << "Use camera motion: " + os << "Use Camera Motion: " << string_from_bool(requested_features.use_camera_motion) << std::endl; os << "Use Baking: " << string_from_bool(requested_features.use_baking) << std::endl; diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index e924e40b99d..ef0c5810f3c 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -19,15 +19,15 @@ #include <stdlib.h> -#include "device_memory.h" -#include "device_task.h" - -#include "util_list.h" -#include "util_stats.h" -#include "util_string.h" -#include "util_thread.h" -#include "util_types.h" -#include "util_vector.h" +#include "device/device_memory.h" +#include "device/device_task.h" + +#include "util/util_list.h" +#include "util/util_stats.h" +#include "util/util_string.h" +#include "util/util_thread.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 8e41d618809..8160aee662c 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -20,37 +20,37 @@ /* So ImathMath is included before our kernel_cpu_compat. */ #ifdef WITH_OSL /* So no context pollution happens from indirectly included windows.h */ -# include "util_windows.h" +# include "util/util_windows.h" # include <OSL/oslexec.h> #endif -#include "device.h" -#include "device_intern.h" -#include "device_denoising.h" -#include "device_split_kernel.h" - -#include "kernel.h" -#include "kernel_compat_cpu.h" -#include "kernel_types.h" -#include "split/kernel_split_data.h" -#include "kernel_globals.h" - -#include "../filter/filter.h" - -#include "osl_shader.h" -#include "osl_globals.h" - -#include "buffers.h" - -#include "util_debug.h" -#include "util_foreach.h" -#include "util_function.h" -#include "util_logging.h" -#include "util_map.h" -#include "util_opengl.h" -#include "util_progress.h" -#include "util_system.h" -#include "util_thread.h" +#include "device/device.h" +#include "device/device_denoising.h" +#include "device/device_intern.h" +#include "device/device_split_kernel.h" + +#include "kernel/kernel.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/kernel_types.h" +#include "kernel/split/kernel_split_data.h" +#include "kernel/kernel_globals.h" + +#include "filter/filter.h" + +#include "kernel/osl/osl_shader.h" +#include "kernel/osl/osl_globals.h" + +#include "render/buffers.h" + +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_function.h" +#include "util/util_logging.h" +#include "util/util_map.h" +#include "util/util_opengl.h" +#include "util/util_progress.h" +#include "util/util_system.h" +#include "util/util_thread.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 88cb3085a29..aaa8ce88830 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -20,34 +20,34 @@ #include <stdlib.h> #include <string.h> -#include "device.h" -#include "device_intern.h" -#include "device_denoising.h" -#include "device_split_kernel.h" +#include "device/device.h" +#include "device/device_denoising.h" +#include "device/device_intern.h" +#include "device/device_split_kernel.h" -#include "buffers.h" +#include "render/buffers.h" -#include "filter_defines.h" +#include "filter/filter_defines.h" #ifdef WITH_CUDA_DYNLOAD # include "cuew.h" #else -# include "util_opengl.h" +# include "util/util_opengl.h" # include <cuda.h> # include <cudaGL.h> #endif -#include "util_debug.h" -#include "util_logging.h" -#include "util_map.h" -#include "util_md5.h" -#include "util_opengl.h" -#include "util_path.h" -#include "util_string.h" -#include "util_system.h" -#include "util_types.h" -#include "util_time.h" - -#include "split/kernel_split_data_types.h" +#include "util/util_debug.h" +#include "util/util_logging.h" +#include "util/util_map.h" +#include "util/util_md5.h" +#include "util/util_opengl.h" +#include "util/util_path.h" +#include "util/util_string.h" +#include "util/util_system.h" +#include "util/util_types.h" +#include "util/util_time.h" + +#include "kernel/split/kernel_split_data_types.h" CCL_NAMESPACE_BEGIN @@ -304,8 +304,8 @@ public: { const int cuda_version = cuewCompilerVersion(); const int machine = system_cpu_bits(); - const string kernel_path = path_get("kernel"); - const string include = kernel_path; + const string kernel_path = path_get("source/kernel"); + const string include = path_dirname(kernel_path); string cflags = string_printf("-m%d " "--ptxas-options=\"-v\" " "--use_fast_math " @@ -349,15 +349,15 @@ public: cuda_error_message("CUDA nvcc compiler version could not be parsed."); return false; } - if(cuda_version < 75) { + if(cuda_version < 80) { printf("Unsupported CUDA version %d.%d detected, " - "you need CUDA 7.5 or newer.\n", + "you need CUDA 8.0 or newer.\n", major, minor); return false; } - else if(cuda_version != 75 && cuda_version != 80) { + else if(cuda_version != 80) { printf("CUDA version %d.%d detected, build may succeed but only " - "CUDA 7.5 and 8.0 are officially supported.\n", + "CUDA 8.0 is officially supported.\n", major, minor); } return true; @@ -399,7 +399,7 @@ public: compile_kernel_get_common_cflags(requested_features, filter, split); /* Try to use locally compiled kernel. */ - const string kernel_path = path_get("kernel"); + const string kernel_path = path_get("source/kernel"); const string kernel_md5 = path_files_md5_hash(kernel_path); /* We include cflags into md5 so changing cuda toolkit or changing other diff --git a/intern/cycles/device/device_denoising.cpp b/intern/cycles/device/device_denoising.cpp index c6df83ab372..ae880f08f14 100644 --- a/intern/cycles/device/device_denoising.cpp +++ b/intern/cycles/device/device_denoising.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "device_denoising.h" +#include "device/device_denoising.h" -#include "filter_defines.h" +#include "filter/filter_defines.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_denoising.h b/intern/cycles/device/device_denoising.h index 4e06fa216b4..3dbc03b7861 100644 --- a/intern/cycles/device/device_denoising.h +++ b/intern/cycles/device/device_denoising.h @@ -17,10 +17,11 @@ #ifndef __DEVICE_DENOISING_H__ #define __DEVICE_DENOISING_H__ -#include "device.h" -#include "buffers.h" +#include "device/device.h" -#include "filter_defines.h" +#include "render/buffers.h" + +#include "filter/filter_defines.h" CCL_NAMESPACE_BEGIN @@ -142,4 +143,4 @@ protected: CCL_NAMESPACE_END -#endif /* __DEVICE_DENOISING_H__ */
\ No newline at end of file +#endif /* __DEVICE_DENOISING_H__ */ diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h index 0eccda4b395..e7a18b3d38d 100644 --- a/intern/cycles/device/device_memory.h +++ b/intern/cycles/device/device_memory.h @@ -28,10 +28,10 @@ * other devices this is a pointer to device memory, where we will copy memory * to and from. */ -#include "util_debug.h" -#include "util_half.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_debug.h" +#include "util/util_half.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp index 15826a5ef71..6c87f4ed606 100644 --- a/intern/cycles/device/device_multi.cpp +++ b/intern/cycles/device/device_multi.cpp @@ -17,17 +17,17 @@ #include <stdlib.h> #include <sstream> -#include "device.h" -#include "device_intern.h" -#include "device_network.h" +#include "device/device.h" +#include "device/device_intern.h" +#include "device/device_network.h" -#include "buffers.h" +#include "render/buffers.h" -#include "util_foreach.h" -#include "util_list.h" -#include "util_logging.h" -#include "util_map.h" -#include "util_time.h" +#include "util/util_foreach.h" +#include "util/util_list.h" +#include "util/util_logging.h" +#include "util/util_map.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp index 6dc4aecbc50..66758954f44 100644 --- a/intern/cycles/device/device_network.cpp +++ b/intern/cycles/device/device_network.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "device.h" -#include "device_intern.h" -#include "device_network.h" +#include "device/device.h" +#include "device/device_intern.h" +#include "device/device_network.h" -#include "util_foreach.h" -#include "util_logging.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" #if defined(WITH_NETWORK) diff --git a/intern/cycles/device/device_network.h b/intern/cycles/device/device_network.h index d28cfe3121f..a5d24c66018 100644 --- a/intern/cycles/device/device_network.h +++ b/intern/cycles/device/device_network.h @@ -33,12 +33,12 @@ #include <sstream> #include <deque> -#include "buffers.h" +#include "render/buffers.h" -#include "util_foreach.h" -#include "util_list.h" -#include "util_map.h" -#include "util_string.h" +#include "util/util_foreach.h" +#include "util/util_list.h" +#include "util/util_map.h" +#include "util/util_string.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index ba94c592a5f..edd2047debc 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -16,12 +16,12 @@ #ifdef WITH_OPENCL -#include "opencl/opencl.h" +#include "device/opencl/opencl.h" -#include "device_intern.h" +#include "device/device_intern.h" -#include "util_foreach.h" -#include "util_logging.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp index 22580a131f0..82cbb2a648a 100644 --- a/intern/cycles/device/device_split_kernel.cpp +++ b/intern/cycles/device/device_split_kernel.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "device_split_kernel.h" +#include "device/device_split_kernel.h" -#include "kernel_types.h" -#include "kernel_split_data_types.h" +#include "kernel/kernel_types.h" +#include "kernel/split/kernel_split_data_types.h" -#include "util_time.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_split_kernel.h b/intern/cycles/device/device_split_kernel.h index b58ec7d2518..922cf02397c 100644 --- a/intern/cycles/device/device_split_kernel.h +++ b/intern/cycles/device/device_split_kernel.h @@ -17,8 +17,8 @@ #ifndef __DEVICE_SPLIT_KERNEL_H__ #define __DEVICE_SPLIT_KERNEL_H__ -#include "device.h" -#include "buffers.h" +#include "device/device.h" +#include "render/buffers.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_task.cpp b/intern/cycles/device/device_task.cpp index 75a590de820..3bc4c310283 100644 --- a/intern/cycles/device/device_task.cpp +++ b/intern/cycles/device/device_task.cpp @@ -17,12 +17,12 @@ #include <stdlib.h> #include <string.h> -#include "device_task.h" +#include "device/device_task.h" -#include "buffers.h" +#include "render/buffers.h" -#include "util_algorithm.h" -#include "util_time.h" +#include "util/util_algorithm.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/device_task.h b/intern/cycles/device/device_task.h index f197ffffe1a..b7e8a50f790 100644 --- a/intern/cycles/device/device_task.h +++ b/intern/cycles/device/device_task.h @@ -17,11 +17,11 @@ #ifndef __DEVICE_TASK_H__ #define __DEVICE_TASK_H__ -#include "device_memory.h" +#include "device/device_memory.h" -#include "util_function.h" -#include "util_list.h" -#include "util_task.h" +#include "util/util_function.h" +#include "util/util_list.h" +#include "util/util_task.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h index a05feccccc0..cc1659c5d77 100644 --- a/intern/cycles/device/opencl/opencl.h +++ b/intern/cycles/device/opencl/opencl.h @@ -16,12 +16,12 @@ #ifdef WITH_OPENCL -#include "device.h" -#include "device_denoising.h" +#include "device/device.h" +#include "device/device_denoising.h" -#include "util_map.h" -#include "util_param.h" -#include "util_string.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_string.h" #include "clew.h" diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp index 471eb06d386..112c09753fb 100644 --- a/intern/cycles/device/opencl/opencl_base.cpp +++ b/intern/cycles/device/opencl/opencl_base.cpp @@ -16,15 +16,15 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN @@ -580,7 +580,7 @@ void OpenCLDeviceBase::film_convert(DeviceTask& task, device_ptr buffer, device_ #define KERNEL_TEX(type, ttype, name) \ set_kernel_arg_mem(ckFilmConvertKernel, &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += kernel_set_args(ckFilmConvertKernel, @@ -990,7 +990,7 @@ void OpenCLDeviceBase::shader(DeviceTask& task) #define KERNEL_TEX(type, ttype, name) \ set_kernel_arg_mem(kernel, &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += kernel_set_args(kernel, diff --git a/intern/cycles/device/opencl/opencl_mega.cpp b/intern/cycles/device/opencl/opencl_mega.cpp index a3750593980..7b4f84e4c6c 100644 --- a/intern/cycles/device/opencl/opencl_mega.cpp +++ b/intern/cycles/device/opencl/opencl_mega.cpp @@ -16,15 +16,15 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "buffers.h" +#include "render/buffers.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN @@ -84,7 +84,7 @@ public: #define KERNEL_TEX(type, ttype, name) \ set_kernel_arg_mem(ckPathTraceKernel, &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += kernel_set_args(ckPathTraceKernel, diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp index c7f425b067d..fa8184cc05f 100644 --- a/intern/cycles/device/opencl/opencl_split.cpp +++ b/intern/cycles/device/opencl/opencl_split.cpp @@ -16,19 +16,19 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "buffers.h" +#include "render/buffers.h" -#include "kernel_types.h" -#include "kernel_split_data_types.h" +#include "kernel/kernel_types.h" +#include "kernel/split/kernel_split_data_types.h" -#include "device_split_kernel.h" +#include "device/device_split_kernel.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN @@ -110,7 +110,7 @@ public: ccl_constant KernelData *data; #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name; -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX SplitData split_data; SplitParams split_param_data; @@ -303,7 +303,7 @@ public: /* TODO(sergey): Avoid map lookup here. */ #define KERNEL_TEX(type, ttype, name) \ device->set_kernel_arg_mem(device->program_data_init(), &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp index 1a8417d3f3e..54d60ce6e6e 100644 --- a/intern/cycles/device/opencl/opencl_util.cpp +++ b/intern/cycles/device/opencl/opencl_util.cpp @@ -16,12 +16,12 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" using std::cerr; using std::endl; @@ -235,7 +235,7 @@ string OpenCLCache::get_kernel_md5() thread_scoped_lock lock(self.kernel_md5_lock); if(self.kernel_md5.empty()) { - self.kernel_md5 = path_files_md5_hash(path_get("kernel")); + self.kernel_md5 = path_files_md5_hash(path_get("source/kernel")); } return self.kernel_md5; } @@ -339,12 +339,12 @@ bool OpenCLDeviceBase::OpenCLProgram::build_kernel(const string *debug_src) bool OpenCLDeviceBase::OpenCLProgram::compile_kernel(const string *debug_src) { - string source = "#include \"kernels/opencl/" + kernel_file + "\"\n"; + string source = "#include \"kernel/kernels/opencl/" + kernel_file + "\"\n"; /* We compile kernels consisting of many files. unfortunately OpenCL * kernel caches do not seem to recognize changes in included files. * so we force recompile on changes by adding the md5 hash of all files. */ - source = path_source_replace_includes(source, path_get("kernel")); + source = path_source_replace_includes(source, path_get("source")); source += "\n// " + util_md5_string(source) + "\n"; if(debug_src) { @@ -443,8 +443,8 @@ void OpenCLDeviceBase::OpenCLProgram::load() add_log(string("OpenCL program ") + program_name + " not found in cache.", true); /* need to create source to get md5 */ - string source = "#include \"kernels/opencl/" + kernel_file + "\"\n"; - source = path_source_replace_includes(source, path_get("kernel")); + string source = "#include \"kernel/kernels/opencl/" + kernel_file + "\"\n"; + source = path_source_replace_includes(source, path_get("source")); string basename = "cycles_kernel_" + program_name + "_" + device_md5 + "_" + util_md5_string(source); basename = path_cache_get(path_join("kernels", basename)); diff --git a/intern/cycles/filter/CMakeLists.txt b/intern/cycles/filter/CMakeLists.txt index 79a8e12c125..6d723583401 100644 --- a/intern/cycles/filter/CMakeLists.txt +++ b/intern/cycles/filter/CMakeLists.txt @@ -1,8 +1,7 @@ remove_extra_strict_flags() set(INC - . - ../util + .. ) set(INC_SYS @@ -115,7 +114,7 @@ if(WITH_CYCLES_CUDA_BINARIES) ${cuda_version_flags} ${cuda_math_flags} ${cuda_extra_flags} - -I${CMAKE_CURRENT_SOURCE_DIR}/../util + -I${CMAKE_CURRENT_SOURCE_DIR}/.. -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC diff --git a/intern/cycles/filter/filter.h b/intern/cycles/filter/filter.h index 13e1a09abea..f9f27dcec35 100644 --- a/intern/cycles/filter/filter.h +++ b/intern/cycles/filter/filter.h @@ -19,9 +19,9 @@ /* CPU Filter Kernel Interface */ -#include "util_types.h" +#include "util/util_types.h" -#include "filter_defines.h" +#include "filter/filter_defines.h" CCL_NAMESPACE_BEGIN @@ -30,22 +30,22 @@ CCL_NAMESPACE_BEGIN #define KERNEL_FUNCTION_FULL_NAME(name) KERNEL_NAME_EVAL(KERNEL_ARCH, name) #define KERNEL_ARCH cpu -#include "kernels/cpu/filter_cpu.h" +#include "filter/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_sse2 -#include "kernels/cpu/filter_cpu.h" +#include "filter/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_sse3 -#include "kernels/cpu/filter_cpu.h" +#include "filter/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_sse41 -#include "kernels/cpu/filter_cpu.h" +#include "filter/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_avx -#include "kernels/cpu/filter_cpu.h" +#include "filter/kernels/cpu/filter_cpu.h" #define KERNEL_ARCH cpu_avx2 -#include "kernels/cpu/filter_cpu.h" +#include "filter/kernels/cpu/filter_cpu.h" CCL_NAMESPACE_END diff --git a/intern/cycles/filter/filter_compat_cpu.h b/intern/cycles/filter/filter_compat_cpu.h index 2682243d2b6..d37b956b28c 100644 --- a/intern/cycles/filter/filter_compat_cpu.h +++ b/intern/cycles/filter/filter_compat_cpu.h @@ -27,12 +27,12 @@ # pragma GCC diagnostic ignored "-Wuninitialized" #endif -#include "util_debug.h" -#include "util_math.h" -#include "util_simd.h" -#include "util_system.h" -#include "util_half.h" -#include "util_types.h" +#include "util/util_debug.h" +#include "util/util_math.h" +#include "util/util_simd.h" +#include "util/util_system.h" +#include "util/util_half.h" +#include "util/util_types.h" #define ccl_addr_space diff --git a/intern/cycles/filter/filter_compat_cuda.h b/intern/cycles/filter/filter_compat_cuda.h index e056807996b..59712cef37a 100644 --- a/intern/cycles/filter/filter_compat_cuda.h +++ b/intern/cycles/filter/filter_compat_cuda.h @@ -54,8 +54,8 @@ /* Types */ -#include "util_half.h" -#include "util_types.h" +#include "util/util_half.h" +#include "util/util_types.h" /* Use fast math functions */ diff --git a/intern/cycles/filter/filter_compat_opencl.h b/intern/cycles/filter/filter_compat_opencl.h index ad06125694b..031821e2277 100644 --- a/intern/cycles/filter/filter_compat_opencl.h +++ b/intern/cycles/filter/filter_compat_opencl.h @@ -120,8 +120,8 @@ /* define NULL */ #define NULL 0 -#include "util_half.h" -#include "util_types.h" +#include "util/util_half.h" +#include "util/util_types.h" #endif /* __FILTER_COMPAT_OPENCL_H__ */ diff --git a/intern/cycles/filter/filter_kernel.h b/intern/cycles/filter/filter_kernel.h index 0db2673f630..b1fce73d2ec 100644 --- a/intern/cycles/filter/filter_kernel.h +++ b/intern/cycles/filter/filter_kernel.h @@ -14,39 +14,39 @@ * limitations under the License. */ -#include "util_color.h" -#include "util_math.h" -#include "util_math_fast.h" -#include "util_texture.h" +#include "util/util_color.h" +#include "util/util_math.h" +#include "util/util_math_fast.h" +#include "util/util_texture.h" -#include "util_atomic.h" -#include "util_math_matrix.h" +#include "util/util_atomic.h" +#include "util/util_math_matrix.h" -#include "filter_defines.h" +#include "filter/filter_defines.h" -#include "filter_features.h" +#include "filter/filter_features.h" #ifdef __KERNEL_SSE3__ -# include "filter_features_sse.h" +# include "filter/filter_features_sse.h" #endif -#include "filter_prefilter.h" +#include "filter/filter_prefilter.h" #ifdef __KERNEL_GPU__ -# include "filter_transform_gpu.h" +# include "filter/filter_transform_gpu.h" #else # ifdef __KERNEL_SSE3__ -# include "filter_transform_sse.h" +# include "filter/filter_transform_sse.h" # else -# include "filter_transform.h" +# include "filter/filter_transform.h" # endif #endif -#include "filter_reconstruction.h" +#include "filter/filter_reconstruction.h" #ifdef __KERNEL_CPU__ -#include "filter_nlm_cpu.h" +# include "filter/filter_nlm_cpu.h" #else -#include "filter_nlm_gpu.h" +# include "filter/filter_nlm_gpu.h" #endif CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/filter/kernels/cpu/filter.cpp b/intern/cycles/filter/kernels/cpu/filter.cpp index ce490f85287..398d13bd815 100644 --- a/intern/cycles/filter/kernels/cpu/filter.cpp +++ b/intern/cycles/filter/kernels/cpu/filter.cpp @@ -56,6 +56,6 @@ /* do nothing */ #endif -#include "../filter/filter.h" +#include "filter/filter.h" #define KERNEL_ARCH cpu -#include "filter_cpu_impl.h" +#include "filter/kernels/cpu/filter_cpu_impl.h" diff --git a/intern/cycles/filter/kernels/cpu/filter_avx.cpp b/intern/cycles/filter/kernels/cpu/filter_avx.cpp index f1e95db872b..8644d9f2e10 100644 --- a/intern/cycles/filter/kernels/cpu/filter_avx.cpp +++ b/intern/cycles/filter/kernels/cpu/filter_avx.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define KERNEL_STUB @@ -34,6 +34,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ -#include "../filter/filter.h" +#include "filter/filter.h" #define KERNEL_ARCH cpu_avx -#include "filter_cpu_impl.h" +#include "filter/kernels/cpu/filter_cpu_impl.h" diff --git a/intern/cycles/filter/kernels/cpu/filter_avx2.cpp b/intern/cycles/filter/kernels/cpu/filter_avx2.cpp index b446498fafa..643662dca83 100644 --- a/intern/cycles/filter/kernels/cpu/filter_avx2.cpp +++ b/intern/cycles/filter/kernels/cpu/filter_avx2.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define KERNEL_STUB @@ -35,6 +35,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ -#include "../filter/filter.h" +#include "filter/filter.h" #define KERNEL_ARCH cpu_avx2 -#include "filter_cpu_impl.h" +#include "filter/kernels/cpu/filter_cpu_impl.h" diff --git a/intern/cycles/filter/kernels/cpu/filter_cpu_impl.h b/intern/cycles/filter/kernels/cpu/filter_cpu_impl.h index b3927cd128e..0d87771c1ae 100644 --- a/intern/cycles/filter/kernels/cpu/filter_cpu_impl.h +++ b/intern/cycles/filter/kernels/cpu/filter_cpu_impl.h @@ -20,12 +20,12 @@ * simply includes this file without worry of copying actual implementation over. */ -#include "filter_compat_cpu.h" +#include "filter/filter_compat_cpu.h" -#include "filter_kernel.h" +#include "filter/filter_kernel.h" #ifdef KERNEL_STUB -# include "util_debug.h" +# include "util/util_debug.h" # define STUB_ASSERT(arch, name) assert(!(#name " kernel stub for architecture " #arch " was called!")) #endif diff --git a/intern/cycles/filter/kernels/cpu/filter_sse2.cpp b/intern/cycles/filter/kernels/cpu/filter_sse2.cpp index 58a2c580c1b..eb10a7fe2a1 100644 --- a/intern/cycles/filter/kernels/cpu/filter_sse2.cpp +++ b/intern/cycles/filter/kernels/cpu/filter_sse2.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define KERNEL_STUB @@ -29,6 +29,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ -#include "../filter/filter.h" +#include "filter/filter.h" #define KERNEL_ARCH cpu_sse2 -#include "filter_cpu_impl.h" +#include "filter/kernels/cpu/filter_cpu_impl.h" diff --git a/intern/cycles/filter/kernels/cpu/filter_sse3.cpp b/intern/cycles/filter/kernels/cpu/filter_sse3.cpp index 5c1973e9552..166771f7836 100644 --- a/intern/cycles/filter/kernels/cpu/filter_sse3.cpp +++ b/intern/cycles/filter/kernels/cpu/filter_sse3.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define KERNEL_STUB @@ -31,6 +31,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 */ -#include "../filter/filter.h" +#include "filter/filter.h" #define KERNEL_ARCH cpu_sse3 -#include "filter_cpu_impl.h" +#include "filter/kernels/cpu/filter_cpu_impl.h" diff --git a/intern/cycles/filter/kernels/cpu/filter_sse41.cpp b/intern/cycles/filter/kernels/cpu/filter_sse41.cpp index e9bc7d4c3a2..e2a47081985 100644 --- a/intern/cycles/filter/kernels/cpu/filter_sse41.cpp +++ b/intern/cycles/filter/kernels/cpu/filter_sse41.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define KERNEL_STUB @@ -32,6 +32,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ -#include "../filter/filter.h" +#include "filter/filter.h" #define KERNEL_ARCH cpu_sse41 -#include "filter_cpu_impl.h" +#include "filter/kernels/cpu/filter_cpu_impl.h" diff --git a/intern/cycles/filter/kernels/cuda/filter.cu b/intern/cycles/filter/kernels/cuda/filter.cu index 7ef2625e467..0fc6eef067a 100644 --- a/intern/cycles/filter/kernels/cuda/filter.cu +++ b/intern/cycles/filter/kernels/cuda/filter.cu @@ -20,9 +20,9 @@ #include "kernel_config.h" -#include "../../filter_compat_cuda.h" +#include "filter/filter_compat_cuda.h" -#include "../../filter_kernel.h" +#include "filter/filter_kernel.h" /* kernels */ diff --git a/intern/cycles/graph/CMakeLists.txt b/intern/cycles/graph/CMakeLists.txt index 4ea18728f1c..e70a18137bd 100644 --- a/intern/cycles/graph/CMakeLists.txt +++ b/intern/cycles/graph/CMakeLists.txt @@ -1,7 +1,6 @@ set(INC - . - ../util + .. ) set(SRC diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp index 3c228a716d5..10d91a1e4ef 100644 --- a/intern/cycles/graph/node.cpp +++ b/intern/cycles/graph/node.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "node.h" -#include "node_type.h" +#include "graph/node.h" +#include "graph/node_type.h" -#include "util_foreach.h" -#include "util_param.h" -#include "util_transform.h" +#include "util/util_foreach.h" +#include "util/util_param.h" +#include "util/util_transform.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/graph/node.h b/intern/cycles/graph/node.h index 64410f4539b..53425f5faf1 100644 --- a/intern/cycles/graph/node.h +++ b/intern/cycles/graph/node.h @@ -16,11 +16,11 @@ #pragma once -#include "node_type.h" +#include "graph/node_type.h" -#include "util_map.h" -#include "util_param.h" -#include "util_vector.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/graph/node_enum.h b/intern/cycles/graph/node_enum.h index 2bae531c036..4e40c294f4f 100644 --- a/intern/cycles/graph/node_enum.h +++ b/intern/cycles/graph/node_enum.h @@ -16,8 +16,8 @@ #pragma once -#include "util_map.h" -#include "util_param.h" +#include "util/util_map.h" +#include "util/util_param.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/graph/node_type.cpp b/intern/cycles/graph/node_type.cpp index 5b98de778ad..a3a8fa5f382 100644 --- a/intern/cycles/graph/node_type.cpp +++ b/intern/cycles/graph/node_type.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "node_type.h" -#include "util_foreach.h" -#include "util_transform.h" +#include "graph/node_type.h" +#include "util/util_foreach.h" +#include "util/util_transform.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/graph/node_type.h b/intern/cycles/graph/node_type.h index 1fb135f6d22..7d46e31ce24 100644 --- a/intern/cycles/graph/node_type.h +++ b/intern/cycles/graph/node_type.h @@ -16,12 +16,12 @@ #pragma once -#include "node_enum.h" +#include "graph/node_enum.h" -#include "util_map.h" -#include "util_param.h" -#include "util_string.h" -#include "util_vector.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_string.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/graph/node_xml.cpp b/intern/cycles/graph/node_xml.cpp index 590e09645ed..aad2740ffc0 100644 --- a/intern/cycles/graph/node_xml.cpp +++ b/intern/cycles/graph/node_xml.cpp @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "node_xml.h" +#include "graph/node_xml.h" -#include "util_foreach.h" -#include "util_string.h" -#include "util_transform.h" +#include "util/util_foreach.h" +#include "util/util_string.h" +#include "util/util_transform.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/graph/node_xml.h b/intern/cycles/graph/node_xml.h index 7494c5e6e55..63e80bf79f2 100644 --- a/intern/cycles/graph/node_xml.h +++ b/intern/cycles/graph/node_xml.h @@ -16,11 +16,11 @@ #pragma once -#include "node.h" +#include "graph/node.h" -#include "util_map.h" -#include "util_string.h" -#include "util_xml.h" +#include "util/util_map.h" +#include "util/util_string.h" +#include "util/util_xml.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 59ce13f86f7..f4cb0492c9f 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -1,10 +1,7 @@ remove_extra_strict_flags() set(INC - . - ../util - osl - svm + .. ) set(INC_SYS @@ -320,8 +317,7 @@ if(WITH_CYCLES_CUDA_BINARIES) ${cuda_math_flags} ${cuda_extra_flags} ${cuda_debug_flags} - -I${CMAKE_CURRENT_SOURCE_DIR}/../util - -I${CMAKE_CURRENT_SOURCE_DIR}/svm + -I${CMAKE_CURRENT_SOURCE_DIR}/.. -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC @@ -362,6 +358,9 @@ endif() include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) +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}") + 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}") @@ -407,33 +406,33 @@ endif() #add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED}) #delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_state_buffer_size.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_split.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_data_init.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_path_init.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_queue_enqueue.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_scene_intersect.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_lamp_emission.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_do_volume.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_indirect_background.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_shader_eval.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_subsurface_scatter.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_direct_lighting.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_shadow_blocked_ao.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_shadow_blocked_dl.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_next_iteration_setup.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_indirect_subsurface.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_buffer_update.cl" ${CYCLES_INSTALL_PATH}/kernel/kernels/opencl) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/cuda/kernel.cu" ${CYCLES_INSTALL_PATH}/kernel/kernels/cuda) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/cuda/kernel_split.cu" ${CYCLES_INSTALL_PATH}/kernel/kernels/cuda) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_CUDA_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/kernels/cuda) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_BVH_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/bvh) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_CLOSURE_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/closure) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SVM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/svm) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_GEOM_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/geom) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_UTIL_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel) -delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_SPLIT_HEADERS}" ${CYCLES_INSTALL_PATH}/kernel/split) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_state_buffer_size.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_split.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_data_init.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_path_init.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_queue_enqueue.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_scene_intersect.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_lamp_emission.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_do_volume.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_indirect_background.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_shader_eval.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_subsurface_scatter.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_direct_lighting.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_shadow_blocked_ao.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_shadow_blocked_dl.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_next_iteration_setup.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_indirect_subsurface.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/opencl/kernel_buffer_update.cl" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/opencl) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/cuda/kernel.cu" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "kernels/cuda/kernel_split.cu" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel) +delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_KERNELS_CUDA_HEADERS}" ${CYCLES_INSTALL_PATH}/source/kernel/kernels/cuda) +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) +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) diff --git a/intern/cycles/kernel/bvh/bvh.h b/intern/cycles/kernel/bvh/bvh.h index 1358288f832..85741016b25 100644 --- a/intern/cycles/kernel/bvh/bvh.h +++ b/intern/cycles/kernel/bvh/bvh.h @@ -27,43 +27,43 @@ CCL_NAMESPACE_BEGIN -#include "bvh_types.h" +#include "kernel/bvh/bvh_types.h" /* Common QBVH functions. */ #ifdef __QBVH__ -# include "qbvh_nodes.h" +# include "kernel/bvh/qbvh_nodes.h" #endif /* Regular BVH traversal */ -#include "bvh_nodes.h" +#include "kernel/bvh/bvh_nodes.h" #define BVH_FUNCTION_NAME bvh_intersect #define BVH_FUNCTION_FEATURES 0 -#include "bvh_traversal.h" +#include "kernel/bvh/bvh_traversal.h" #if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING -# include "bvh_traversal.h" +# include "kernel/bvh/bvh_traversal.h" #endif #if defined(__HAIR__) # define BVH_FUNCTION_NAME bvh_intersect_hair # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH -# include "bvh_traversal.h" +# include "kernel/bvh/bvh_traversal.h" #endif #if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION -# include "bvh_traversal.h" +# include "kernel/bvh/bvh_traversal.h" #endif #if defined(__HAIR__) && defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_hair_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_HAIR_MINIMUM_WIDTH|BVH_MOTION -# include "bvh_traversal.h" +# include "kernel/bvh/bvh_traversal.h" #endif /* Subsurface scattering BVH traversal */ @@ -71,12 +71,12 @@ CCL_NAMESPACE_BEGIN #if defined(__SUBSURFACE__) # define BVH_FUNCTION_NAME bvh_intersect_subsurface # define BVH_FUNCTION_FEATURES BVH_HAIR -# include "bvh_subsurface.h" +# include "kernel/bvh/bvh_subsurface.h" # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_subsurface_motion # define BVH_FUNCTION_FEATURES BVH_MOTION|BVH_HAIR -# include "bvh_subsurface.h" +# include "kernel/bvh/bvh_subsurface.h" # endif #endif /* __SUBSURFACE__ */ @@ -85,18 +85,18 @@ CCL_NAMESPACE_BEGIN #if defined(__VOLUME__) # define BVH_FUNCTION_NAME bvh_intersect_volume # define BVH_FUNCTION_FEATURES BVH_HAIR -# include "bvh_volume.h" +# include "kernel/bvh/bvh_volume.h" # if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_volume_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR -# include "bvh_volume.h" +# include "kernel/bvh/bvh_volume.h" # endif # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_volume_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR -# include "bvh_volume.h" +# include "kernel/bvh/bvh_volume.h" # endif #endif /* __VOLUME__ */ @@ -105,30 +105,30 @@ CCL_NAMESPACE_BEGIN #if defined(__SHADOW_RECORD_ALL__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all # define BVH_FUNCTION_FEATURES 0 -# include "bvh_shadow_all.h" +# include "kernel/bvh/bvh_shadow_all.h" # if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING -# include "bvh_shadow_all.h" +# include "kernel/bvh/bvh_shadow_all.h" # endif # if defined(__HAIR__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR -# include "bvh_shadow_all.h" +# include "kernel/bvh/bvh_shadow_all.h" # endif # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION -# include "bvh_shadow_all.h" +# include "kernel/bvh/bvh_shadow_all.h" # endif # if defined(__HAIR__) && defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_shadow_all_hair_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR|BVH_MOTION -# include "bvh_shadow_all.h" +# include "kernel/bvh/bvh_shadow_all.h" # endif #endif /* __SHADOW_RECORD_ALL__ */ @@ -137,18 +137,18 @@ CCL_NAMESPACE_BEGIN #if defined(__VOLUME_RECORD_ALL__) # define BVH_FUNCTION_NAME bvh_intersect_volume_all # define BVH_FUNCTION_FEATURES BVH_HAIR -# include "bvh_volume_all.h" +# include "kernel/bvh/bvh_volume_all.h" # if defined(__INSTANCING__) # define BVH_FUNCTION_NAME bvh_intersect_volume_all_instancing # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_HAIR -# include "bvh_volume_all.h" +# include "kernel/bvh/bvh_volume_all.h" # endif # if defined(__OBJECT_MOTION__) # define BVH_FUNCTION_NAME bvh_intersect_volume_all_motion # define BVH_FUNCTION_FEATURES BVH_INSTANCING|BVH_MOTION|BVH_HAIR -# include "bvh_volume_all.h" +# include "kernel/bvh/bvh_volume_all.h" # endif #endif /* __VOLUME_RECORD_ALL__ */ diff --git a/intern/cycles/kernel/bvh/bvh_nodes.h b/intern/cycles/kernel/bvh/bvh_nodes.h index 192aab89eae..74a9ebf14e4 100644 --- a/intern/cycles/kernel/bvh/bvh_nodes.h +++ b/intern/cycles/kernel/bvh/bvh_nodes.h @@ -17,8 +17,8 @@ // TODO(sergey): Look into avoid use of full Transform and use 3x3 matrix and // 3-vector which might be faster. ccl_device_forceinline Transform bvh_unaligned_node_fetch_space(KernelGlobals *kg, - int node_addr, - int child) + int node_addr, + int child) { Transform space; const int child_addr = node_addr + child * 3; @@ -31,12 +31,12 @@ ccl_device_forceinline Transform bvh_unaligned_node_fetch_space(KernelGlobals *k #if !defined(__KERNEL_SSE2__) ccl_device_forceinline int bvh_aligned_node_intersect(KernelGlobals *kg, - const float3 P, - const float3 idir, - const float t, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 idir, + const float t, + const int node_addr, + const uint visibility, + float dist[2]) { /* fetch node data */ @@ -78,14 +78,14 @@ ccl_device_forceinline int bvh_aligned_node_intersect(KernelGlobals *kg, } ccl_device_forceinline int bvh_aligned_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 idir, - const float t, - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 idir, + const float t, + const float difl, + const float extmax, + const int node_addr, + const uint visibility, + float dist[2]) { /* fetch node data */ @@ -203,13 +203,13 @@ ccl_device_forceinline bool bvh_unaligned_node_intersect_child_robust( } ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float3 idir, - const float t, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 dir, + const float3 idir, + const float t, + const int node_addr, + const uint visibility, + float dist[2]) { int mask = 0; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); @@ -233,15 +233,15 @@ ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, } ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float3 idir, - const float t, - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 dir, + const float3 idir, + const float t, + const float difl, + const float extmax, + const int node_addr, + const uint visibility, + float dist[2]) { int mask = 0; float4 cnodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); @@ -265,13 +265,13 @@ ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg } ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float3 idir, - const float t, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 dir, + const float3 idir, + const float t, + const int node_addr, + const uint visibility, + float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { @@ -296,15 +296,15 @@ ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, } ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const float3 idir, - const float t, - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 dir, + const float3 idir, + const float t, + const float difl, + const float extmax, + const int node_addr, + const uint visibility, + float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { @@ -442,13 +442,13 @@ ccl_device_forceinline int bvh_aligned_node_intersect_robust( } ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, - const float3 P, - const float3 dir, - const ssef& isect_near, - const ssef& isect_far, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 dir, + const ssef& isect_near, + const ssef& isect_far, + const int node_addr, + const uint visibility, + float dist[2]) { Transform space0 = bvh_unaligned_node_fetch_space(kg, node_addr, 0); Transform space1 = bvh_unaligned_node_fetch_space(kg, node_addr, 1); @@ -503,14 +503,14 @@ ccl_device_forceinline int bvh_unaligned_node_intersect(KernelGlobals *kg, } ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg, - const float3 P, - const float3 dir, - const ssef& isect_near, - const ssef& isect_far, - const float difl, - const int node_addr, - const uint visibility, - float dist[2]) + const float3 P, + const float3 dir, + const ssef& isect_near, + const ssef& isect_far, + const float difl, + const int node_addr, + const uint visibility, + float dist[2]) { Transform space0 = bvh_unaligned_node_fetch_space(kg, node_addr, 0); Transform space1 = bvh_unaligned_node_fetch_space(kg, node_addr, 1); @@ -574,17 +574,17 @@ ccl_device_forceinline int bvh_unaligned_node_intersect_robust(KernelGlobals *kg } ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, - const float3& P, - const float3& dir, - const ssef& isect_near, - const ssef& isect_far, - const ssef& tsplat, - const ssef Psplat[3], - const ssef idirsplat[3], - const shuffle_swap_t shufflexyz[3], - const int node_addr, - const uint visibility, - float dist[2]) + const float3& P, + const float3& dir, + const ssef& isect_near, + const ssef& isect_far, + const ssef& tsplat, + const ssef Psplat[3], + const ssef idirsplat[3], + const shuffle_swap_t shufflexyz[3], + const int node_addr, + const uint visibility, + float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { @@ -612,19 +612,19 @@ ccl_device_forceinline int bvh_node_intersect(KernelGlobals *kg, } ccl_device_forceinline int bvh_node_intersect_robust(KernelGlobals *kg, - const float3& P, - const float3& dir, - const ssef& isect_near, - const ssef& isect_far, - const ssef& tsplat, - const ssef Psplat[3], - const ssef idirsplat[3], - const shuffle_swap_t shufflexyz[3], - const float difl, - const float extmax, - const int node_addr, - const uint visibility, - float dist[2]) + const float3& P, + const float3& dir, + const ssef& isect_near, + const ssef& isect_far, + const ssef& tsplat, + const ssef Psplat[3], + const ssef idirsplat[3], + const shuffle_swap_t shufflexyz[3], + const float difl, + const float extmax, + const int node_addr, + const uint visibility, + float dist[2]) { float4 node = kernel_tex_fetch(__bvh_nodes, node_addr); if(__float_as_uint(node.x) & PATH_RAY_NODE_UNALIGNED) { diff --git a/intern/cycles/kernel/bvh/bvh_shadow_all.h b/intern/cycles/kernel/bvh/bvh_shadow_all.h index b2555b3a6bb..267e098f912 100644 --- a/intern/cycles/kernel/bvh/bvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/bvh_shadow_all.h @@ -18,7 +18,7 @@ */ #ifdef __QBVH__ -# include "qbvh_shadow_all.h" +# include "kernel/bvh/qbvh_shadow_all.h" #endif #if BVH_FEATURE(BVH_HAIR) @@ -101,9 +101,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* __KERNEL_SSE2__ */ - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* traversal loop */ do { do { @@ -209,9 +206,9 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, switch(p_type) { case PRIMITIVE_TRIANGLE: { hit = triangle_intersect(kg, - &isect_precalc, isect_array, P, + dir, PATH_RAY_SHADOW, object, prim_addr); @@ -220,9 +217,9 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { hit = motion_triangle_intersect(kg, - &isect_precalc, isect_array, P, + dir, ray->time, PATH_RAY_SHADOW, object, @@ -325,7 +322,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, isect_t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect_t); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); num_hits_in_instance = 0; isect_array->t = isect_t; @@ -365,8 +361,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, bvh_instance_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* scale isect->t to adjust for instancing */ for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; @@ -378,7 +372,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, # else bvh_instance_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); } isect_t = tmax; diff --git a/intern/cycles/kernel/bvh/bvh_subsurface.h b/intern/cycles/kernel/bvh/bvh_subsurface.h index cb7a4e3bc31..bda7e34907a 100644 --- a/intern/cycles/kernel/bvh/bvh_subsurface.h +++ b/intern/cycles/kernel/bvh/bvh_subsurface.h @@ -18,7 +18,7 @@ */ #ifdef __QBVH__ -# include "qbvh_subsurface.h" +# include "kernel/bvh/qbvh_subsurface.h" #endif #if BVH_FEATURE(BVH_HAIR) @@ -109,9 +109,6 @@ void BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* traversal loop */ do { do { @@ -197,9 +194,9 @@ void BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); triangle_intersect_subsurface(kg, - &isect_precalc, ss_isect, P, + dir, object, prim_addr, isect_t, @@ -214,9 +211,9 @@ void BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); motion_triangle_intersect_subsurface(kg, - &isect_precalc, ss_isect, P, + dir, ray->time, object, prim_addr, diff --git a/intern/cycles/kernel/bvh/bvh_traversal.h b/intern/cycles/kernel/bvh/bvh_traversal.h index eac98a3165a..c58d3b0316c 100644 --- a/intern/cycles/kernel/bvh/bvh_traversal.h +++ b/intern/cycles/kernel/bvh/bvh_traversal.h @@ -18,7 +18,7 @@ */ #ifdef __QBVH__ -# include "qbvh_traversal.h" +# include "kernel/bvh/qbvh_traversal.h" #endif #if BVH_FEATURE(BVH_HAIR) @@ -104,9 +104,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* traversal loop */ do { do { @@ -238,9 +235,9 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(triangle_intersect(kg, - &isect_precalc, isect, P, + dir, visibility, object, prim_addr)) @@ -267,9 +264,9 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(motion_triangle_intersect(kg, - &isect_precalc, isect, P, + dir, ray->time, visibility, object, @@ -358,7 +355,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, # else isect->t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect->t); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); @@ -395,7 +391,6 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, # else isect->t = bvh_instance_pop(kg, object, ray, &P, &dir, &idir, isect->t); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); diff --git a/intern/cycles/kernel/bvh/bvh_volume.h b/intern/cycles/kernel/bvh/bvh_volume.h index da97dae0b99..764aaee44a1 100644 --- a/intern/cycles/kernel/bvh/bvh_volume.h +++ b/intern/cycles/kernel/bvh/bvh_volume.h @@ -18,7 +18,7 @@ */ #ifdef __QBVH__ -# include "qbvh_volume.h" +# include "kernel/bvh/qbvh_volume.h" #endif #if BVH_FEATURE(BVH_HAIR) @@ -97,9 +97,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* traversal loop */ do { do { @@ -194,9 +191,9 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, continue; } triangle_intersect(kg, - &isect_precalc, isect, P, + dir, visibility, object, prim_addr); @@ -215,9 +212,9 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, continue; } motion_triangle_intersect(kg, - &isect_precalc, isect, P, + dir, ray->time, visibility, object, @@ -243,8 +240,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, isect->t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect->t); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); @@ -286,8 +281,6 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, isect->t = bvh_instance_pop(kg, object, ray, &P, &dir, &idir, isect->t); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - # if defined(__KERNEL_SSE2__) Psplat[0] = ssef(P.x); Psplat[1] = ssef(P.y); diff --git a/intern/cycles/kernel/bvh/bvh_volume_all.h b/intern/cycles/kernel/bvh/bvh_volume_all.h index 6efb7e265d0..04ec334e54d 100644 --- a/intern/cycles/kernel/bvh/bvh_volume_all.h +++ b/intern/cycles/kernel/bvh/bvh_volume_all.h @@ -18,7 +18,7 @@ */ #ifdef __QBVH__ -# include "qbvh_volume_all.h" +# include "kernel/bvh/qbvh_volume_all.h" #endif #if BVH_FEATURE(BVH_HAIR) @@ -101,9 +101,6 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, gen_idirsplat_swap(pn, shuf_identity, shuf_swap, idir, idirsplat, shufflexyz); #endif /* __KERNEL_SSE2__ */ - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* traversal loop */ do { do { @@ -199,9 +196,9 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, continue; } hit = triangle_intersect(kg, - &isect_precalc, isect_array, P, + dir, visibility, object, prim_addr); @@ -243,9 +240,9 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, continue; } hit = motion_triangle_intersect(kg, - &isect_precalc, isect_array, P, + dir, ray->time, visibility, object, @@ -294,7 +291,6 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, isect_t = bvh_instance_push(kg, object, ray, &P, &dir, &idir, isect_t); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); num_hits_in_instance = 0; isect_array->t = isect_t; @@ -340,7 +336,6 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, # else bvh_instance_pop_factor(kg, object, ray, &P, &dir, &idir, &t_fac); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); /* Scale isect->t to adjust for instancing. */ for(int i = 0; i < num_hits_in_instance; i++) { (isect_array-i-1)->t *= t_fac; @@ -352,7 +347,6 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg, # else bvh_instance_pop(kg, object, ray, &P, &dir, &idir, FLT_MAX); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); } isect_t = tmax; diff --git a/intern/cycles/kernel/bvh/qbvh_shadow_all.h b/intern/cycles/kernel/bvh/qbvh_shadow_all.h index 1663e23c334..ce474438f2c 100644 --- a/intern/cycles/kernel/bvh/qbvh_shadow_all.h +++ b/intern/cycles/kernel/bvh/qbvh_shadow_all.h @@ -97,15 +97,13 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); + (void)inodes; if(false #ifdef __VISIBILITY_FLAG__ @@ -290,9 +288,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, switch(p_type) { case PRIMITIVE_TRIANGLE: { hit = triangle_intersect(kg, - &isect_precalc, isect_array, P, + dir, PATH_RAY_SHADOW, object, prim_addr); @@ -301,9 +299,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, #if BVH_FEATURE(BVH_MOTION) case PRIMITIVE_MOTION_TRIANGLE: { hit = motion_triangle_intersect(kg, - &isect_precalc, isect_array, P, + dir, ray->time, PATH_RAY_SHADOW, object, @@ -425,8 +423,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; @@ -482,8 +478,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; diff --git a/intern/cycles/kernel/bvh/qbvh_subsurface.h b/intern/cycles/kernel/bvh/qbvh_subsurface.h index d67a7826589..be7658d11d7 100644 --- a/intern/cycles/kernel/bvh/qbvh_subsurface.h +++ b/intern/cycles/kernel/bvh/qbvh_subsurface.h @@ -105,9 +105,6 @@ ccl_device void BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* Traversal loop. */ do { do { @@ -253,9 +250,9 @@ ccl_device void BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); triangle_intersect_subsurface(kg, - &isect_precalc, ss_isect, P, + dir, object, prim_addr, isect_t, @@ -270,9 +267,9 @@ ccl_device void BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, for(; prim_addr < prim_addr2; prim_addr++) { kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); motion_triangle_intersect_subsurface(kg, - &isect_precalc, ss_isect, P, + dir, ray->time, object, prim_addr, diff --git a/intern/cycles/kernel/bvh/qbvh_traversal.h b/intern/cycles/kernel/bvh/qbvh_traversal.h index d88e0e07203..fca75a1d416 100644 --- a/intern/cycles/kernel/bvh/qbvh_traversal.h +++ b/intern/cycles/kernel/bvh/qbvh_traversal.h @@ -106,15 +106,13 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* Traversal loop. */ do { do { /* Traverse internal nodes. */ while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) { float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0); + (void)inodes; if(UNLIKELY(node_dist > isect->t) #if BVH_FEATURE(BVH_MOTION) @@ -122,8 +120,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, || UNLIKELY(ray->time > inodes.z) #endif #ifdef __VISIBILITY_FLAG__ - || (__float_as_uint(inodes.x) & visibility) == 0) + || (__float_as_uint(inodes.x) & visibility) == 0 #endif + ) { /* Pop. */ node_addr = traversal_stack[stack_ptr].addr; @@ -333,9 +332,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(triangle_intersect(kg, - &isect_precalc, isect, P, + dir, visibility, object, prim_addr)) { @@ -354,9 +353,9 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, BVH_DEBUG_NEXT_INTERSECTION(); kernel_assert(kernel_tex_fetch(__prim_type, prim_addr) == type); if(motion_triangle_intersect(kg, - &isect_precalc, isect, P, + dir, ray->time, visibility, object, @@ -447,8 +446,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; @@ -489,8 +486,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; node_dist = traversal_stack[stack_ptr].dist; diff --git a/intern/cycles/kernel/bvh/qbvh_volume.h b/intern/cycles/kernel/bvh/qbvh_volume.h index 7cfb2cf8c18..192ce009524 100644 --- a/intern/cycles/kernel/bvh/qbvh_volume.h +++ b/intern/cycles/kernel/bvh/qbvh_volume.h @@ -91,9 +91,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* Traversal loop. */ do { do { @@ -266,7 +263,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, continue; } /* Intersect ray against primitive. */ - triangle_intersect(kg, &isect_precalc, isect, P, visibility, object, prim_addr); + triangle_intersect(kg, isect, P, dir, visibility, object, prim_addr); } break; } @@ -281,7 +278,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, continue; } /* Intersect ray against primitive. */ - motion_triangle_intersect(kg, &isect_precalc, isect, P, ray->time, visibility, object, prim_addr); + motion_triangle_intersect(kg, isect, P, dir, ray->time, visibility, object, prim_addr); } break; } @@ -316,8 +313,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - ++stack_ptr; kernel_assert(stack_ptr < BVH_QSTACK_SIZE); traversal_stack[stack_ptr].addr = ENTRYPOINT_SENTINEL; @@ -362,8 +357,6 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; diff --git a/intern/cycles/kernel/bvh/qbvh_volume_all.h b/intern/cycles/kernel/bvh/qbvh_volume_all.h index 3dbac8446d7..ac5f58a9a51 100644 --- a/intern/cycles/kernel/bvh/qbvh_volume_all.h +++ b/intern/cycles/kernel/bvh/qbvh_volume_all.h @@ -95,9 +95,6 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, &near_x, &near_y, &near_z, &far_x, &far_y, &far_z); - TriangleIsectPrecalc isect_precalc; - ray_triangle_intersect_precalc(dir, &isect_precalc); - /* Traversal loop. */ do { do { @@ -271,7 +268,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, continue; } /* Intersect ray against primitive. */ - hit = triangle_intersect(kg, &isect_precalc, isect_array, P, visibility, object, prim_addr); + hit = triangle_intersect(kg, isect_array, P, dir, visibility, object, prim_addr); if(hit) { /* Move on to next entry in intersections array. */ isect_array++; @@ -309,7 +306,7 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, continue; } /* Intersect ray against primitive. */ - hit = motion_triangle_intersect(kg, &isect_precalc, isect_array, P, ray->time, visibility, object, prim_addr); + hit = motion_triangle_intersect(kg, isect_array, P, dir, ray->time, visibility, object, prim_addr); if(hit) { /* Move on to next entry in intersections array. */ isect_array++; @@ -367,7 +364,6 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); num_hits_in_instance = 0; isect_array->t = isect_t; @@ -432,8 +428,6 @@ ccl_device uint BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg, org4 = sse3f(ssef(P.x), ssef(P.y), ssef(P.z)); # endif - ray_triangle_intersect_precalc(dir, &isect_precalc); - object = OBJECT_NONE; node_addr = traversal_stack[stack_ptr].addr; --stack_ptr; diff --git a/intern/cycles/kernel/closure/bsdf.h b/intern/cycles/kernel/closure/bsdf.h index a44b9e2d9b9..9139b99353a 100644 --- a/intern/cycles/kernel/closure/bsdf.h +++ b/intern/cycles/kernel/closure/bsdf.h @@ -14,37 +14,37 @@ * limitations under the License. */ -#include "../closure/bsdf_ashikhmin_velvet.h" -#include "../closure/bsdf_diffuse.h" -#include "../closure/bsdf_oren_nayar.h" -#include "../closure/bsdf_phong_ramp.h" -#include "../closure/bsdf_diffuse_ramp.h" -#include "../closure/bsdf_microfacet.h" -#include "../closure/bsdf_microfacet_multi.h" -#include "../closure/bsdf_reflection.h" -#include "../closure/bsdf_refraction.h" -#include "../closure/bsdf_transparent.h" -#include "../closure/bsdf_ashikhmin_shirley.h" -#include "../closure/bsdf_toon.h" -#include "../closure/bsdf_hair.h" +#include "kernel/closure/bsdf_ashikhmin_velvet.h" +#include "kernel/closure/bsdf_diffuse.h" +#include "kernel/closure/bsdf_oren_nayar.h" +#include "kernel/closure/bsdf_phong_ramp.h" +#include "kernel/closure/bsdf_diffuse_ramp.h" +#include "kernel/closure/bsdf_microfacet.h" +#include "kernel/closure/bsdf_microfacet_multi.h" +#include "kernel/closure/bsdf_reflection.h" +#include "kernel/closure/bsdf_refraction.h" +#include "kernel/closure/bsdf_transparent.h" +#include "kernel/closure/bsdf_ashikhmin_shirley.h" +#include "kernel/closure/bsdf_toon.h" +#include "kernel/closure/bsdf_hair.h" #ifdef __SUBSURFACE__ -# include "../closure/bssrdf.h" +# include "kernel/closure/bssrdf.h" #endif #ifdef __VOLUME__ -# include "../closure/volume.h" +# include "kernel/closure/volume.h" #endif CCL_NAMESPACE_BEGIN ccl_device_forceinline int bsdf_sample(KernelGlobals *kg, - ShaderData *sd, - const ShaderClosure *sc, - float randu, - float randv, - float3 *eval, - float3 *omega_in, - differential3 *domega_in, - float *pdf) + ShaderData *sd, + const ShaderClosure *sc, + float randu, + float randv, + float3 *eval, + float3 *omega_in, + differential3 *domega_in, + float *pdf) { int label; diff --git a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h index e38dd33c040..194503e6e87 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet_multi.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi.h @@ -313,18 +313,18 @@ ccl_device_forceinline float mf_glass_pdf(const float3 wi, const float3 wo, cons #define MF_PHASE_FUNCTION glass #define MF_MULTI_GLASS -#include "bsdf_microfacet_multi_impl.h" +#include "kernel/closure/bsdf_microfacet_multi_impl.h" /* The diffuse phase function is not implemented as a node yet. */ #if 0 #define MF_PHASE_FUNCTION diffuse #define MF_MULTI_DIFFUSE -#include "bsdf_microfacet_multi_impl.h" +#include "kernel/closure/bsdf_microfacet_multi_impl.h" #endif #define MF_PHASE_FUNCTION glossy #define MF_MULTI_GLOSSY -#include "bsdf_microfacet_multi_impl.h" +#include "kernel/closure/bsdf_microfacet_multi_impl.h" ccl_device void bsdf_microfacet_multi_ggx_blur(ShaderClosure *sc, float roughness) { diff --git a/intern/cycles/kernel/geom/geom.h b/intern/cycles/kernel/geom/geom.h index 6838e26c242..c623e3490fd 100644 --- a/intern/cycles/kernel/geom/geom.h +++ b/intern/cycles/kernel/geom/geom.h @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "geom_attribute.h" -#include "geom_object.h" +#include "kernel/geom/geom_attribute.h" +#include "kernel/geom/geom_object.h" #ifdef __PATCH_EVAL__ -# include "geom_patch.h" +# include "kernel/geom/geom_patch.h" #endif -#include "geom_triangle.h" -#include "geom_subd_triangle.h" -#include "geom_triangle_intersect.h" -#include "geom_motion_triangle.h" -#include "geom_motion_triangle_intersect.h" -#include "geom_motion_triangle_shader.h" -#include "geom_motion_curve.h" -#include "geom_curve.h" -#include "geom_volume.h" -#include "geom_primitive.h" +#include "kernel/geom/geom_triangle.h" +#include "kernel/geom/geom_subd_triangle.h" +#include "kernel/geom/geom_triangle_intersect.h" +#include "kernel/geom/geom_motion_triangle.h" +#include "kernel/geom/geom_motion_triangle_intersect.h" +#include "kernel/geom/geom_motion_triangle_shader.h" +#include "kernel/geom/geom_motion_curve.h" +#include "kernel/geom/geom_curve.h" +#include "kernel/geom/geom_volume.h" +#include "kernel/geom/geom_primitive.h" diff --git a/intern/cycles/kernel/geom/geom_curve.h b/intern/cycles/kernel/geom/geom_curve.h index 4f84b80a5a8..bb33b91847e 100644 --- a/intern/cycles/kernel/geom/geom_curve.h +++ b/intern/cycles/kernel/geom/geom_curve.h @@ -22,6 +22,12 @@ CCL_NAMESPACE_BEGIN #ifdef __HAIR__ +#if defined(__KERNEL_CUDA__) && (__CUDA_ARCH__ < 300) +# define ccl_device_curveintersect ccl_device +#else +# define ccl_device_curveintersect ccl_device_forceinline +#endif + /* Reading attributes on various curve elements */ ccl_device float curve_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy) @@ -222,10 +228,10 @@ ccl_device_inline ssef transform_point_T3(const ssef t[3], const ssef &a) #ifdef __KERNEL_SSE2__ /* Pass P and dir by reference to aligned vector */ -ccl_device_forceinline bool bvh_cardinal_curve_intersect(KernelGlobals *kg, Intersection *isect, +ccl_device_curveintersect bool bvh_cardinal_curve_intersect(KernelGlobals *kg, Intersection *isect, const float3 &P, const float3 &dir, uint visibility, int object, int curveAddr, float time, int type, uint *lcg_state, float difl, float extmax) #else -ccl_device_forceinline bool bvh_cardinal_curve_intersect(KernelGlobals *kg, Intersection *isect, +ccl_device_curveintersect bool bvh_cardinal_curve_intersect(KernelGlobals *kg, Intersection *isect, float3 P, float3 dir, uint visibility, int object, int curveAddr, float time,int type, uint *lcg_state, float difl, float extmax) #endif { @@ -688,7 +694,7 @@ ccl_device_forceinline bool bvh_cardinal_curve_intersect(KernelGlobals *kg, Inte return hit; } -ccl_device_forceinline bool bvh_curve_intersect(KernelGlobals *kg, Intersection *isect, +ccl_device_curveintersect bool bvh_curve_intersect(KernelGlobals *kg, Intersection *isect, float3 P, float3 direction, uint visibility, int object, int curveAddr, float time, int type, uint *lcg_state, float difl, float extmax) { /* define few macros to minimize code duplication for SSE */ diff --git a/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h b/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h index 971a34308f1..f74995becf5 100644 --- a/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h +++ b/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h @@ -168,9 +168,9 @@ float3 motion_triangle_refine_subsurface(KernelGlobals *kg, ccl_device_inline bool motion_triangle_intersect( KernelGlobals *kg, - const TriangleIsectPrecalc *isect_precalc, Intersection *isect, float3 P, + float3 dir, float time, uint visibility, int object, @@ -186,10 +186,10 @@ ccl_device_inline bool motion_triangle_intersect( motion_triangle_vertices(kg, fobject, prim, time, verts); /* Ray-triangle intersection, unoptimized. */ float t, u, v; - if(ray_triangle_intersect(isect_precalc, - P, + if(ray_triangle_intersect(P, + dir, isect->t, -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) (ssef*)verts, #else verts[0], verts[1], verts[2], @@ -222,9 +222,9 @@ ccl_device_inline bool motion_triangle_intersect( #ifdef __SUBSURFACE__ ccl_device_inline void motion_triangle_intersect_subsurface( KernelGlobals *kg, - const TriangleIsectPrecalc *isect_precalc, SubsurfaceIntersection *ss_isect, float3 P, + float3 dir, float time, int object, int prim_addr, @@ -242,10 +242,10 @@ ccl_device_inline void motion_triangle_intersect_subsurface( motion_triangle_vertices(kg, fobject, prim, time, verts); /* Ray-triangle intersection, unoptimized. */ float t, u, v; - if(ray_triangle_intersect(isect_precalc, - P, + if(ray_triangle_intersect(P, + dir, tmax, -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) (ssef*)verts, #else verts[0], verts[1], verts[2], diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h index 584d0b3508f..804e74d7e37 100644 --- a/intern/cycles/kernel/geom/geom_triangle_intersect.h +++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h @@ -22,25 +22,16 @@ CCL_NAMESPACE_BEGIN -/* Ray-Triangle intersection for BVH traversal - * - * Sven Woop - * Watertight Ray/Triangle Intersection - * - * http://jcgt.org/published/0002/01/05/paper.pdf - */ - ccl_device_inline bool triangle_intersect(KernelGlobals *kg, - const TriangleIsectPrecalc *isect_precalc, Intersection *isect, float3 P, + float3 dir, uint visibility, int object, int prim_addr) { const uint tri_vindex = kernel_tex_fetch(__prim_tri_index, prim_addr); - -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const ssef *ssef_verts = (ssef*)&kg->__prim_tri_verts.data[tri_vindex]; #else const float4 tri_a = kernel_tex_fetch(__prim_tri_verts, tri_vindex+0), @@ -48,9 +39,10 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg, tri_c = kernel_tex_fetch(__prim_tri_verts, tri_vindex+2); #endif float t, u, v; - if(ray_triangle_intersect(isect_precalc, - P, isect->t, -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) + if(ray_triangle_intersect(P, + dir, + isect->t, +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) ssef_verts, #else float4_to_float3(tri_a), @@ -86,9 +78,9 @@ ccl_device_inline bool triangle_intersect(KernelGlobals *kg, #ifdef __SUBSURFACE__ ccl_device_inline void triangle_intersect_subsurface( KernelGlobals *kg, - const TriangleIsectPrecalc *isect_precalc, SubsurfaceIntersection *ss_isect, float3 P, + float3 dir, int object, int prim_addr, float tmax, @@ -96,8 +88,7 @@ ccl_device_inline void triangle_intersect_subsurface( int max_hits) { const uint tri_vindex = kernel_tex_fetch(__prim_tri_index, prim_addr); - -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const ssef *ssef_verts = (ssef*)&kg->__prim_tri_verts.data[tri_vindex]; #else const float3 tri_a = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+0)), @@ -105,14 +96,13 @@ ccl_device_inline void triangle_intersect_subsurface( tri_c = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+2)); #endif float t, u, v; - if(!ray_triangle_intersect(isect_precalc, - P, tmax, -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) + if(!ray_triangle_intersect(P, + dir, + tmax, +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) ssef_verts, #else - tri_a, - tri_b, - tri_c, + tri_a, tri_b, tri_c, #endif &u, &v, &t)) { @@ -150,15 +140,14 @@ ccl_device_inline void triangle_intersect_subsurface( isect->t = t; /* Record geometric normal. */ - /* TODO(sergey): Check whether it's faster to re-use ssef verts. */ -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const float3 tri_a = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+0)), tri_b = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+1)), tri_c = float4_to_float3(kernel_tex_fetch(__prim_tri_verts, tri_vindex+2)); #endif ss_isect->Ng[hit] = normalize(cross(tri_b - tri_a, tri_c - tri_a)); } -#endif +#endif /* __SUBSURFACE__ */ /* Refine triangle intersection to more precise hit point. For rays that travel * far the precision is often not so good, this reintersects the primitive from diff --git a/intern/cycles/kernel/kernel.h b/intern/cycles/kernel/kernel.h index 05ea665d981..84a988f1dbc 100644 --- a/intern/cycles/kernel/kernel.h +++ b/intern/cycles/kernel/kernel.h @@ -19,8 +19,8 @@ /* CPU Kernel Interface */ -#include "util_types.h" -#include "kernel_types.h" +#include "util/util_types.h" +#include "kernel/kernel_types.h" CCL_NAMESPACE_BEGIN @@ -48,22 +48,22 @@ void kernel_tex_copy(KernelGlobals *kg, ExtensionType extension = EXTENSION_REPEAT); #define KERNEL_ARCH cpu -#include "kernels/cpu/kernel_cpu.h" +#include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_sse2 -#include "kernels/cpu/kernel_cpu.h" +#include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_sse3 -#include "kernels/cpu/kernel_cpu.h" +#include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_sse41 -#include "kernels/cpu/kernel_cpu.h" +#include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_avx -#include "kernels/cpu/kernel_cpu.h" +#include "kernel/kernels/cpu/kernel_cpu.h" #define KERNEL_ARCH cpu_avx2 -#include "kernels/cpu/kernel_cpu.h" +#include "kernel/kernels/cpu/kernel_cpu.h" CCL_NAMESPACE_END diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index d39e684c5f5..ae7c9b836c4 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -35,13 +35,12 @@ # define __NODES_FEATURES__ NODE_FEATURE_ALL #endif -#include "util_debug.h" -#include "util_math.h" -#include "util_simd.h" -#include "util_system.h" -#include "util_half.h" -#include "util_types.h" -#include "util_texture.h" +#include "util/util_debug.h" +#include "util/util_math.h" +#include "util/util_simd.h" +#include "util/util_half.h" +#include "util/util_types.h" +#include "util/util_texture.h" #define ccl_addr_space diff --git a/intern/cycles/kernel/kernel_compat_cuda.h b/intern/cycles/kernel/kernel_compat_cuda.h index 37a9e8d2f84..39e98c7dda6 100644 --- a/intern/cycles/kernel/kernel_compat_cuda.h +++ b/intern/cycles/kernel/kernel_compat_cuda.h @@ -38,7 +38,7 @@ #define ccl_device __device__ __inline__ # define ccl_device_forceinline __device__ __forceinline__ -#if (__KERNEL_CUDA_VERSION__ == 80) && (__CUDA_ARCH__ < 500) +#if __CUDA_ARCH__ < 500 # define ccl_device_inline __device__ __forceinline__ #else # define ccl_device_inline __device__ __inline__ @@ -60,8 +60,8 @@ /* Types */ -#include "util_half.h" -#include "util_types.h" +#include "util/util_half.h" +#include "util/util_types.h" /* Work item functions */ diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h index 6c963dea4f5..c2263ac0d49 100644 --- a/intern/cycles/kernel/kernel_compat_opencl.h +++ b/intern/cycles/kernel/kernel_compat_opencl.h @@ -143,8 +143,8 @@ /* define NULL */ #define NULL 0 -#include "util_half.h" -#include "util_types.h" +#include "util/util_half.h" +#include "util/util_types.h" #endif /* __KERNEL_COMPAT_OPENCL_H__ */ diff --git a/intern/cycles/kernel/kernel_globals.h b/intern/cycles/kernel/kernel_globals.h index 1c3884890bf..c9c97ea977e 100644 --- a/intern/cycles/kernel/kernel_globals.h +++ b/intern/cycles/kernel/kernel_globals.h @@ -47,7 +47,7 @@ typedef struct KernelGlobals { # define KERNEL_TEX(type, ttype, name) ttype name; # define KERNEL_IMAGE_TEX(type, ttype, name) -# include "kernel_textures.h" +# include "kernel/kernel_textures.h" KernelData __data; @@ -97,7 +97,7 @@ typedef struct KernelGlobals { # define KERNEL_TEX(type, ttype, name) const __constant__ __device__ type *name; # endif # define KERNEL_IMAGE_TEX(type, ttype, name) ttype name; -# include "kernel_textures.h" +# include "kernel/kernel_textures.h" #endif /* __KERNEL_CUDA__ */ @@ -110,7 +110,7 @@ typedef ccl_addr_space struct KernelGlobals { # define KERNEL_TEX(type, ttype, name) \ ccl_global type *name; -# include "kernel_textures.h" +# include "kernel/kernel_textures.h" # ifdef __SPLIT_KERNEL__ SplitData split_data; diff --git a/intern/cycles/kernel/kernel_math.h b/intern/cycles/kernel/kernel_math.h index 7653fa53247..bd0e23b7705 100644 --- a/intern/cycles/kernel/kernel_math.h +++ b/intern/cycles/kernel/kernel_math.h @@ -17,12 +17,11 @@ #ifndef __KERNEL_MATH_H__ #define __KERNEL_MATH_H__ -#include "util_color.h" -#include "util_math.h" -#include "util_math_fast.h" -#include "util_math_intersect.h" -#include "util_texture.h" -#include "util_transform.h" +#include "util/util_color.h" +#include "util/util_math.h" +#include "util/util_math_fast.h" +#include "util/util_math_intersect.h" +#include "util/util_texture.h" +#include "util/util_transform.h" #endif /* __KERNEL_MATH_H__ */ - diff --git a/intern/cycles/kernel/kernel_path.h b/intern/cycles/kernel/kernel_path.h index da1b991a616..b12a4df32c1 100644 --- a/intern/cycles/kernel/kernel_path.h +++ b/intern/cycles/kernel/kernel_path.h @@ -15,41 +15,41 @@ */ #ifdef __OSL__ -# include "osl_shader.h" +# include "kernel/osl/osl_shader.h" #endif -#include "kernel_random.h" -#include "kernel_projection.h" -#include "kernel_montecarlo.h" -#include "kernel_differential.h" -#include "kernel_camera.h" +#include "kernel/kernel_random.h" +#include "kernel/kernel_projection.h" +#include "kernel/kernel_montecarlo.h" +#include "kernel/kernel_differential.h" +#include "kernel/kernel_camera.h" -#include "geom/geom.h" -#include "bvh/bvh.h" +#include "kernel/geom/geom.h" +#include "kernel/bvh/bvh.h" -#include "kernel_accumulate.h" -#include "kernel_shader.h" -#include "kernel_light.h" -#include "kernel_passes.h" +#include "kernel/kernel_accumulate.h" +#include "kernel/kernel_shader.h" +#include "kernel/kernel_light.h" +#include "kernel/kernel_passes.h" #ifdef __SUBSURFACE__ -# include "kernel_subsurface.h" +# include "kernel/kernel_subsurface.h" #endif #ifdef __VOLUME__ -# include "kernel_volume.h" +# include "kernel/kernel_volume.h" #endif -#include "kernel_path_state.h" -#include "kernel_shadow.h" -#include "kernel_emission.h" -#include "kernel_path_common.h" -#include "kernel_path_surface.h" -#include "kernel_path_volume.h" -#include "kernel_path_subsurface.h" +#include "kernel/kernel_path_state.h" +#include "kernel/kernel_shadow.h" +#include "kernel/kernel_emission.h" +#include "kernel/kernel_path_common.h" +#include "kernel/kernel_path_surface.h" +#include "kernel/kernel_path_volume.h" +#include "kernel/kernel_path_subsurface.h" #ifdef __KERNEL_DEBUG__ -# include "kernel_debug.h" +# include "kernel/kernel_debug.h" #endif CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/kernel_path_common.h b/intern/cycles/kernel/kernel_path_common.h index 596210f442e..82f83deb595 100644 --- a/intern/cycles/kernel/kernel_path_common.h +++ b/intern/cycles/kernel/kernel_path_common.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "util_hash.h" +#include "util/util_hash.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/kernel_random.h b/intern/cycles/kernel/kernel_random.h index 485b7b84fc8..d4f0caff5de 100644 --- a/intern/cycles/kernel/kernel_random.h +++ b/intern/cycles/kernel/kernel_random.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "kernel_jitter.h" +#include "kernel/kernel_jitter.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index eb540e30b26..c66f52255f0 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -24,12 +24,12 @@ * */ -#include "closure/alloc.h" -#include "closure/bsdf_util.h" -#include "closure/bsdf.h" -#include "closure/emissive.h" +#include "kernel/closure/alloc.h" +#include "kernel/closure/bsdf_util.h" +#include "kernel/closure/bsdf.h" +#include "kernel/closure/emissive.h" -#include "svm/svm.h" +#include "kernel/svm/svm.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index aace9594a40..24b5f12769a 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -17,9 +17,9 @@ #ifndef __KERNEL_TYPES_H__ #define __KERNEL_TYPES_H__ -#include "kernel_math.h" -#include "svm/svm_types.h" -#include "util_static_assert.h" +#include "kernel/kernel_math.h" +#include "kernel/svm/svm_types.h" +#include "util/util_static_assert.h" #ifndef __KERNEL_GPU__ # define __KERNEL_CPU__ diff --git a/intern/cycles/kernel/kernels/cpu/kernel.cpp b/intern/cycles/kernel/kernels/cpu/kernel.cpp index 72dbbd9a416..16992c681e6 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel.cpp @@ -56,9 +56,9 @@ /* do nothing */ #endif -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" CCL_NAMESPACE_BEGIN @@ -90,7 +90,7 @@ void kernel_tex_copy(KernelGlobals *kg, kg->tname.width = width; \ } #define KERNEL_IMAGE_TEX(type, ttype, tname) -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" else if(strstr(name, "__tex_image_float4")) { texture_image_float4 *tex = NULL; diff --git a/intern/cycles/kernel/kernels/cpu/kernel_avx.cpp b/intern/cycles/kernel/kernels/cpu/kernel_avx.cpp index 855f404dae8..a645fb4d8dd 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_avx.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_avx.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define KERNEL_STUB @@ -34,6 +34,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_avx2.cpp b/intern/cycles/kernel/kernels/cpu/kernel_avx2.cpp index dbed19753a7..6bbb87727b9 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_avx2.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_avx2.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define KERNEL_STUB @@ -35,6 +35,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx2 -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h index 586d5b42b48..3c7d8c9c3f3 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h @@ -20,43 +20,43 @@ * simply includes this file without worry of copying actual implementation over. */ -#include "kernel_compat_cpu.h" +#include "kernel/kernel_compat_cpu.h" #ifndef __SPLIT_KERNEL__ -# include "kernel_math.h" -# include "kernel_types.h" +# include "kernel/kernel_math.h" +# include "kernel/kernel_types.h" -# include "split/kernel_split_data.h" -# include "kernel_globals.h" +# include "kernel/split/kernel_split_data.h" +# include "kernel/kernel_globals.h" -# include "kernel_cpu_image.h" -# include "kernel_film.h" -# include "kernel_path.h" -# include "kernel_path_branched.h" -# include "kernel_bake.h" +# include "kernel/kernels/cpu/kernel_cpu_image.h" +# include "kernel/kernel_film.h" +# include "kernel/kernel_path.h" +# include "kernel/kernel_path_branched.h" +# include "kernel/kernel_bake.h" #else -# include "split/kernel_split_common.h" - -# include "split/kernel_data_init.h" -# include "split/kernel_path_init.h" -# include "split/kernel_scene_intersect.h" -# include "split/kernel_lamp_emission.h" -# include "split/kernel_do_volume.h" -# include "split/kernel_queue_enqueue.h" -# include "split/kernel_indirect_background.h" -# include "split/kernel_shader_eval.h" -# include "split/kernel_holdout_emission_blurring_pathtermination_ao.h" -# include "split/kernel_subsurface_scatter.h" -# include "split/kernel_direct_lighting.h" -# include "split/kernel_shadow_blocked_ao.h" -# include "split/kernel_shadow_blocked_dl.h" -# include "split/kernel_next_iteration_setup.h" -# include "split/kernel_indirect_subsurface.h" -# include "split/kernel_buffer_update.h" +# include "kernel/split/kernel_split_common.h" + +# include "kernel/split/kernel_data_init.h" +# include "kernel/split/kernel_path_init.h" +# include "kernel/split/kernel_scene_intersect.h" +# include "kernel/split/kernel_lamp_emission.h" +# include "kernel/split/kernel_do_volume.h" +# include "kernel/split/kernel_queue_enqueue.h" +# include "kernel/split/kernel_indirect_background.h" +# include "kernel/split/kernel_shader_eval.h" +# include "kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h" +# include "kernel/split/kernel_subsurface_scatter.h" +# include "kernel/split/kernel_direct_lighting.h" +# include "kernel/split/kernel_shadow_blocked_ao.h" +# include "kernel/split/kernel_shadow_blocked_dl.h" +# include "kernel/split/kernel_next_iteration_setup.h" +# include "kernel/split/kernel_indirect_subsurface.h" +# include "kernel/split/kernel_buffer_update.h" #endif #ifdef KERNEL_STUB -# include "util_debug.h" +# include "util/util_debug.h" # define STUB_ASSERT(arch, name) assert(!(#name " kernel stub for architecture " #arch " was called!")) #endif diff --git a/intern/cycles/kernel/kernels/cpu/kernel_split.cpp b/intern/cycles/kernel/kernels/cpu/kernel_split.cpp index 30519dae53e..ca750e5a00d 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_split.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_split.cpp @@ -57,7 +57,7 @@ /* do nothing */ #endif -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_split_avx.cpp b/intern/cycles/kernel/kernels/cpu/kernel_split_avx.cpp index cc20a8fe571..6ba3425a343 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_split_avx.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_split_avx.cpp @@ -20,7 +20,7 @@ #define __SPLIT_KERNEL__ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define KERNEL_STUB @@ -36,6 +36,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_split_avx2.cpp b/intern/cycles/kernel/kernels/cpu/kernel_split_avx2.cpp index e9451f09002..76b2d77ebb8 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_split_avx2.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_split_avx2.cpp @@ -20,7 +20,7 @@ #define __SPLIT_KERNEL__ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define KERNEL_STUB @@ -37,6 +37,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_avx2 -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_split_sse2.cpp b/intern/cycles/kernel/kernels/cpu/kernel_split_sse2.cpp index ee79a452377..b468b6f44c8 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_split_sse2.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_split_sse2.cpp @@ -20,7 +20,7 @@ #define __SPLIT_KERNEL__ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define KERNEL_STUB @@ -31,6 +31,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse2 -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_split_sse3.cpp b/intern/cycles/kernel/kernels/cpu/kernel_split_sse3.cpp index 4d880ed0b36..3e5792d0b17 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_split_sse3.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_split_sse3.cpp @@ -20,7 +20,7 @@ #define __SPLIT_KERNEL__ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define KERNEL_STUB @@ -33,6 +33,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse3 -#include "kernel_cpu_impl.h"
\ No newline at end of file +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_split_sse41.cpp b/intern/cycles/kernel/kernels/cpu/kernel_split_sse41.cpp index 4f42d40b012..3629f21cd29 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_split_sse41.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_split_sse41.cpp @@ -20,7 +20,7 @@ #define __SPLIT_KERNEL__ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define KERNEL_STUB @@ -34,6 +34,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse41 -#include "kernel_cpu_impl.h"
\ No newline at end of file +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_sse2.cpp b/intern/cycles/kernel/kernels/cpu/kernel_sse2.cpp index a59547e7a72..57530c88710 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_sse2.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_sse2.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define KERNEL_STUB @@ -29,6 +29,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse2 -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_sse3.cpp b/intern/cycles/kernel/kernels/cpu/kernel_sse3.cpp index ebed420a8a5..c607753bc4b 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_sse3.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_sse3.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define KERNEL_STUB @@ -31,6 +31,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse3 -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cpu/kernel_sse41.cpp b/intern/cycles/kernel/kernels/cpu/kernel_sse41.cpp index 57d5df16031..a278554731c 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_sse41.cpp +++ b/intern/cycles/kernel/kernels/cpu/kernel_sse41.cpp @@ -18,7 +18,7 @@ * optimization flags and nearly all functions inlined, while kernel.cpp * is compiled without for other CPU's. */ -#include "util_optimization.h" +#include "util/util_optimization.h" #ifndef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define KERNEL_STUB @@ -32,6 +32,6 @@ # endif #endif /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */ -#include "kernel.h" +#include "kernel/kernel.h" #define KERNEL_ARCH cpu_sse41 -#include "kernel_cpu_impl.h" +#include "kernel/kernels/cpu/kernel_cpu_impl.h" diff --git a/intern/cycles/kernel/kernels/cuda/kernel.cu b/intern/cycles/kernel/kernels/cuda/kernel.cu index 52e541321e3..dc343cb387a 100644 --- a/intern/cycles/kernel/kernels/cuda/kernel.cu +++ b/intern/cycles/kernel/kernels/cuda/kernel.cu @@ -18,15 +18,15 @@ #ifdef __CUDA_ARCH__ -#include "../../kernel_compat_cuda.h" +#include "kernel/kernel_compat_cuda.h" #include "kernel_config.h" -#include "../../kernel_math.h" -#include "../../kernel_types.h" -#include "../../kernel_globals.h" -#include "../../kernel_film.h" -#include "../../kernel_path.h" -#include "../../kernel_path_branched.h" -#include "../../kernel_bake.h" +#include "kernel/kernel_math.h" +#include "kernel/kernel_types.h" +#include "kernel/kernel_globals.h" +#include "kernel/kernel_film.h" +#include "kernel/kernel_path.h" +#include "kernel/kernel_path_branched.h" +#include "kernel/kernel_bake.h" /* kernels */ extern "C" __global__ void diff --git a/intern/cycles/kernel/kernels/cuda/kernel_split.cu b/intern/cycles/kernel/kernels/cuda/kernel_split.cu index 4479a044921..a679eff8409 100644 --- a/intern/cycles/kernel/kernels/cuda/kernel_split.cu +++ b/intern/cycles/kernel/kernels/cuda/kernel_split.cu @@ -20,28 +20,28 @@ #define __SPLIT_KERNEL__ -#include "../../kernel_compat_cuda.h" +#include "kernel/kernel_compat_cuda.h" #include "kernel_config.h" -#include "../../split/kernel_split_common.h" -#include "../../split/kernel_data_init.h" -#include "../../split/kernel_path_init.h" -#include "../../split/kernel_scene_intersect.h" -#include "../../split/kernel_lamp_emission.h" -#include "../../split/kernel_do_volume.h" -#include "../../split/kernel_queue_enqueue.h" -#include "../../split/kernel_indirect_background.h" -#include "../../split/kernel_shader_eval.h" -#include "../../split/kernel_holdout_emission_blurring_pathtermination_ao.h" -#include "../../split/kernel_subsurface_scatter.h" -#include "../../split/kernel_direct_lighting.h" -#include "../../split/kernel_shadow_blocked_ao.h" -#include "../../split/kernel_shadow_blocked_dl.h" -#include "../../split/kernel_next_iteration_setup.h" -#include "../../split/kernel_indirect_subsurface.h" -#include "../../split/kernel_buffer_update.h" - -#include "../../kernel_film.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_data_init.h" +#include "kernel/split/kernel_path_init.h" +#include "kernel/split/kernel_scene_intersect.h" +#include "kernel/split/kernel_lamp_emission.h" +#include "kernel/split/kernel_do_volume.h" +#include "kernel/split/kernel_queue_enqueue.h" +#include "kernel/split/kernel_indirect_background.h" +#include "kernel/split/kernel_shader_eval.h" +#include "kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h" +#include "kernel/split/kernel_subsurface_scatter.h" +#include "kernel/split/kernel_direct_lighting.h" +#include "kernel/split/kernel_shadow_blocked_ao.h" +#include "kernel/split/kernel_shadow_blocked_dl.h" +#include "kernel/split/kernel_next_iteration_setup.h" +#include "kernel/split/kernel_indirect_subsurface.h" +#include "kernel/split/kernel_buffer_update.h" + +#include "kernel/kernel_film.h" /* kernels */ extern "C" __global__ void diff --git a/intern/cycles/kernel/kernels/opencl/kernel.cl b/intern/cycles/kernel/kernels/opencl/kernel.cl index 52406d2f548..078acc1631e 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel.cl @@ -16,34 +16,34 @@ /* OpenCL kernel entry points - unfinished */ -#include "../../kernel_compat_opencl.h" -#include "../../kernel_math.h" -#include "../../kernel_types.h" -#include "../../kernel_globals.h" -#include "../../kernel_image_opencl.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/kernel_math.h" +#include "kernel/kernel_types.h" +#include "kernel/kernel_globals.h" +#include "kernel/kernel_image_opencl.h" -#include "../../kernel_film.h" +#include "kernel/kernel_film.h" #if defined(__COMPILE_ONLY_MEGAKERNEL__) || !defined(__NO_BAKING__) -# include "../../kernel_path.h" -# include "../../kernel_path_branched.h" +# include "kernel/kernel_path.h" +# include "kernel/kernel_path_branched.h" #else /* __COMPILE_ONLY_MEGAKERNEL__ */ /* Include only actually used headers for the case * when path tracing kernels are not needed. */ -# include "../../kernel_random.h" -# include "../../kernel_differential.h" -# include "../../kernel_montecarlo.h" -# include "../../kernel_projection.h" -# include "../../geom/geom.h" -# include "../../bvh/bvh.h" - -# include "../../kernel_accumulate.h" -# include "../../kernel_camera.h" -# include "../../kernel_shader.h" +# include "kernel/kernel_random.h" +# include "kernel/kernel_differential.h" +# include "kernel/kernel_montecarlo.h" +# include "kernel/kernel_projection.h" +# include "kernel/geom/geom.h" +# include "kernel/bvh/bvh.h" + +# include "kernel/kernel_accumulate.h" +# include "kernel/kernel_camera.h" +# include "kernel/kernel_shader.h" #endif /* defined(__COMPILE_ONLY_MEGAKERNEL__) || !defined(__NO_BAKING__) */ -#include "../../kernel_bake.h" +#include "kernel/kernel_bake.h" #ifdef __COMPILE_ONLY_MEGAKERNEL__ @@ -54,7 +54,7 @@ __kernel void kernel_ocl_path_trace( #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int sample, int sx, int sy, int sw, int sh, int offset, int stride) @@ -65,7 +65,7 @@ __kernel void kernel_ocl_path_trace( #define KERNEL_TEX(type, ttype, name) \ kg->name = name; -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int x = sx + ccl_global_id(0); int y = sy + ccl_global_id(1); @@ -84,7 +84,7 @@ __kernel void kernel_ocl_shader( #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int type, int sx, int sw, int offset, int sample) { @@ -94,7 +94,7 @@ __kernel void kernel_ocl_shader( #define KERNEL_TEX(type, ttype, name) \ kg->name = name; -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int x = sx + ccl_global_id(0); @@ -116,7 +116,7 @@ __kernel void kernel_ocl_bake( #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int type, int filter, int sx, int sw, int offset, int sample) { @@ -126,7 +126,7 @@ __kernel void kernel_ocl_bake( #define KERNEL_TEX(type, ttype, name) \ kg->name = name; -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int x = sx + ccl_global_id(0); @@ -146,7 +146,7 @@ __kernel void kernel_ocl_convert_to_byte( #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" float sample_scale, int sx, int sy, int sw, int sh, int offset, int stride) @@ -157,7 +157,7 @@ __kernel void kernel_ocl_convert_to_byte( #define KERNEL_TEX(type, ttype, name) \ kg->name = name; -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int x = sx + ccl_global_id(0); int y = sy + ccl_global_id(1); @@ -173,7 +173,7 @@ __kernel void kernel_ocl_convert_to_half_float( #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" float sample_scale, int sx, int sy, int sw, int sh, int offset, int stride) @@ -184,7 +184,7 @@ __kernel void kernel_ocl_convert_to_half_float( #define KERNEL_TEX(type, ttype, name) \ kg->name = name; -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int x = sx + ccl_global_id(0); int y = sy + ccl_global_id(1); diff --git a/intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl b/intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl index b61f1cda330..db65c91baf7 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_buffer_update.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_buffer_update.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_buffer_update.h" __kernel void kernel_ocl_path_trace_buffer_update( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_data_init.cl b/intern/cycles/kernel/kernels/opencl/kernel_data_init.cl index 54d4a577e10..8b85d362f8a 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_data_init.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_data_init.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_data_init.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_data_init.h" __kernel void kernel_ocl_path_trace_data_init( ccl_global char *kg, @@ -28,7 +28,7 @@ __kernel void kernel_ocl_path_trace_data_init( #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" int start_sample, int end_sample, @@ -48,7 +48,7 @@ __kernel void kernel_ocl_path_trace_data_init( rng_state, #define KERNEL_TEX(type, ttype, name) name, -#include "../../kernel_textures.h" +#include "kernel/kernel_textures.h" start_sample, end_sample, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_direct_lighting.cl b/intern/cycles/kernel/kernels/opencl/kernel_direct_lighting.cl index 374be6cbd05..eb34f750881 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_direct_lighting.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_direct_lighting.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_direct_lighting.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_direct_lighting.h" __kernel void kernel_ocl_path_trace_direct_lighting( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl b/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl index 08187b0e03e..83ef5f5f3f2 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_do_volume.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_do_volume.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_do_volume.h" __kernel void kernel_ocl_path_trace_do_volume( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl b/intern/cycles/kernel/kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl index 351687e2036..d071b39aa6f 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_holdout_emission_blurring_pathtermination_ao.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h" __kernel void kernel_ocl_path_trace_holdout_emission_blurring_pathtermination_ao( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl b/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl index b18fba4c01f..8c213ff5cb2 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_indirect_background.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_indirect_background.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_indirect_background.h" __kernel void kernel_ocl_path_trace_indirect_background( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl b/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl index ce2e96ad789..998ebc4c0c3 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_indirect_subsurface.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_indirect_subsurface.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_indirect_subsurface.h" __kernel void kernel_ocl_path_trace_indirect_subsurface( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_lamp_emission.cl b/intern/cycles/kernel/kernels/opencl/kernel_lamp_emission.cl index 830e4e373ac..822d2287715 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_lamp_emission.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_lamp_emission.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_lamp_emission.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_lamp_emission.h" __kernel void kernel_ocl_path_trace_lamp_emission( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_next_iteration_setup.cl b/intern/cycles/kernel/kernels/opencl/kernel_next_iteration_setup.cl index fd49ed5def8..6d207253a40 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_next_iteration_setup.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_next_iteration_setup.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_next_iteration_setup.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_next_iteration_setup.h" __kernel void kernel_ocl_path_trace_next_iteration_setup( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_path_init.cl b/intern/cycles/kernel/kernels/opencl/kernel_path_init.cl index 8194f5d22ca..bd9aa9538c8 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_path_init.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_path_init.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_path_init.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_path_init.h" __kernel void kernel_ocl_path_trace_path_init( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_queue_enqueue.cl b/intern/cycles/kernel/kernels/opencl/kernel_queue_enqueue.cl index 6dd9d39c4e2..9be154e3d75 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_queue_enqueue.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_queue_enqueue.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_queue_enqueue.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_queue_enqueue.h" __kernel void kernel_ocl_path_trace_queue_enqueue( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_scene_intersect.cl b/intern/cycles/kernel/kernels/opencl/kernel_scene_intersect.cl index c675640c599..eb4fb4d153a 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_scene_intersect.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_scene_intersect.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_scene_intersect.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_scene_intersect.h" __kernel void kernel_ocl_path_trace_scene_intersect( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_shader_eval.cl b/intern/cycles/kernel/kernels/opencl/kernel_shader_eval.cl index 71ac2886978..6baee460986 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_shader_eval.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_shader_eval.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_shader_eval.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_shader_eval.h" __kernel void kernel_ocl_path_trace_shader_eval( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_ao.cl b/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_ao.cl index 37824097031..6a8ef81b32a 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_ao.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_ao.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_shadow_blocked_ao.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_shadow_blocked_ao.h" __kernel void kernel_ocl_path_trace_shadow_blocked_ao( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_dl.cl b/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_dl.cl index 4889f49d8dc..b255cc5ef8b 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_dl.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked_dl.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_shadow_blocked_dl.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_shadow_blocked_dl.h" __kernel void kernel_ocl_path_trace_shadow_blocked_dl( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_split.cl b/intern/cycles/kernel/kernels/opencl/kernel_split.cl index 2d9e64824e7..732cda30115 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_split.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_split.cl @@ -14,22 +14,22 @@ * limitations under the License. */ -#include "kernel_state_buffer_size.cl" -#include "kernel_data_init.cl" -#include "kernel_path_init.cl" +#include "kernel/kernels/opencl/kernel_state_buffer_size.cl" +#include "kernel/kernels/opencl/kernel_data_init.cl" +#include "kernel/kernels/opencl/kernel_path_init.cl" -#include "kernel_scene_intersect.cl" -#include "kernel_lamp_emission.cl" -#include "kernel_do_volume.cl" -#include "kernel_indirect_background.cl" -#include "kernel_queue_enqueue.cl" -#include "kernel_shader_eval.cl" -#include "kernel_holdout_emission_blurring_pathtermination_ao.cl" -#include "kernel_subsurface_scatter.cl" -#include "kernel_direct_lighting.cl" -#include "kernel_shadow_blocked_ao.cl" -#include "kernel_shadow_blocked_dl.cl" -#include "kernel_next_iteration_setup.cl" -#include "kernel_indirect_subsurface.cl" -#include "kernel_buffer_update.cl" +#include "kernel/kernels/opencl/kernel_scene_intersect.cl" +#include "kernel/kernels/opencl/kernel_lamp_emission.cl" +#include "kernel/kernels/opencl/kernel_do_volume.cl" +#include "kernel/kernels/opencl/kernel_indirect_background.cl" +#include "kernel/kernels/opencl/kernel_queue_enqueue.cl" +#include "kernel/kernels/opencl/kernel_shader_eval.cl" +#include "kernel/kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl" +#include "kernel/kernels/opencl/kernel_subsurface_scatter.cl" +#include "kernel/kernels/opencl/kernel_direct_lighting.cl" +#include "kernel/kernels/opencl/kernel_shadow_blocked_ao.cl" +#include "kernel/kernels/opencl/kernel_shadow_blocked_dl.cl" +#include "kernel/kernels/opencl/kernel_next_iteration_setup.cl" +#include "kernel/kernels/opencl/kernel_indirect_subsurface.cl" +#include "kernel/kernels/opencl/kernel_buffer_update.cl" diff --git a/intern/cycles/kernel/kernels/opencl/kernel_state_buffer_size.cl b/intern/cycles/kernel/kernels/opencl/kernel_state_buffer_size.cl index b23ff33786d..c10ecc426c6 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_state_buffer_size.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_state_buffer_size.cl @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" __kernel void kernel_ocl_path_trace_state_buffer_size( ccl_global char *kg, diff --git a/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl b/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl index 853bba2efc5..7a1838e485f 100644 --- a/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl +++ b/intern/cycles/kernel/kernels/opencl/kernel_subsurface_scatter.cl @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "kernel_compat_opencl.h" -#include "split/kernel_split_common.h" -#include "split/kernel_subsurface_scatter.h" +#include "kernel/kernel_compat_opencl.h" +#include "kernel/split/kernel_split_common.h" +#include "kernel/split/kernel_subsurface_scatter.h" __kernel void kernel_ocl_path_trace_subsurface_scatter( ccl_global char *kg, diff --git a/intern/cycles/kernel/osl/CMakeLists.txt b/intern/cycles/kernel/osl/CMakeLists.txt index 98de40e5a8a..d2eb89e0e0a 100644 --- a/intern/cycles/kernel/osl/CMakeLists.txt +++ b/intern/cycles/kernel/osl/CMakeLists.txt @@ -1,12 +1,6 @@ set(INC - . - .. - ../svm - ../../graph - ../../render - ../../util - ../../device + ../.. ) set(INC_SYS diff --git a/intern/cycles/kernel/osl/background.cpp b/intern/cycles/kernel/osl/background.cpp index d835f9be45c..2e73e7a601e 100644 --- a/intern/cycles/kernel/osl/background.cpp +++ b/intern/cycles/kernel/osl/background.cpp @@ -34,10 +34,10 @@ #include <OSL/genclosure.h> -#include "osl_closures.h" +#include "kernel/osl/osl_closures.h" -#include "kernel_compat_cpu.h" -#include "closure/alloc.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/closure/alloc.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp b/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp index bc26f42b559..ea18f2c8c86 100644 --- a/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp +++ b/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp @@ -34,13 +34,13 @@ #include <OSL/genclosure.h> -#include "kernel_compat_cpu.h" -#include "osl_closures.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/osl/osl_closures.h" -#include "kernel_types.h" -#include "kernel_montecarlo.h" -#include "closure/alloc.h" -#include "closure/bsdf_diffuse_ramp.h" +#include "kernel/kernel_types.h" +#include "kernel/kernel_montecarlo.h" +#include "kernel/closure/alloc.h" +#include "kernel/closure/bsdf_diffuse_ramp.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp b/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp index 14c7644936e..a26671eb09e 100644 --- a/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp +++ b/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp @@ -34,12 +34,12 @@ #include <OSL/genclosure.h> -#include "kernel_compat_cpu.h" -#include "osl_closures.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/osl/osl_closures.h" -#include "kernel_types.h" -#include "closure/alloc.h" -#include "closure/bsdf_phong_ramp.h" +#include "kernel/kernel_types.h" +#include "kernel/closure/alloc.h" +#include "kernel/closure/bsdf_phong_ramp.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/emissive.cpp b/intern/cycles/kernel/osl/emissive.cpp index 3f13e08b302..8843a196dad 100644 --- a/intern/cycles/kernel/osl/emissive.cpp +++ b/intern/cycles/kernel/osl/emissive.cpp @@ -34,12 +34,12 @@ #include <OSL/genclosure.h> -#include "osl_closures.h" +#include "kernel/osl/osl_closures.h" -#include "kernel_compat_cpu.h" -#include "kernel_types.h" -#include "closure/alloc.h" -#include "closure/emissive.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/kernel_types.h" +#include "kernel/closure/alloc.h" +#include "kernel/closure/emissive.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/osl_bssrdf.cpp b/intern/cycles/kernel/osl/osl_bssrdf.cpp index d3a69d39597..95beea01d25 100644 --- a/intern/cycles/kernel/osl/osl_bssrdf.cpp +++ b/intern/cycles/kernel/osl/osl_bssrdf.cpp @@ -32,15 +32,15 @@ #include <OSL/genclosure.h> -#include "kernel_compat_cpu.h" -#include "osl_closures.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/osl/osl_closures.h" -#include "kernel_types.h" -#include "kernel_montecarlo.h" +#include "kernel/kernel_types.h" +#include "kernel/kernel_montecarlo.h" -#include "closure/alloc.h" -#include "closure/bsdf_diffuse.h" -#include "closure/bssrdf.h" +#include "kernel/closure/alloc.h" +#include "kernel/closure/bsdf_diffuse.h" +#include "kernel/closure/bssrdf.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp index fe61587d179..f44714c2150 100644 --- a/intern/cycles/kernel/osl/osl_closures.cpp +++ b/intern/cycles/kernel/osl/osl_closures.cpp @@ -33,34 +33,34 @@ #include <OSL/genclosure.h> #include <OSL/oslclosure.h> -#include "osl_closures.h" -#include "osl_shader.h" - -#include "util_debug.h" -#include "util_math.h" -#include "util_param.h" - -#include "kernel_types.h" -#include "kernel_compat_cpu.h" -#include "split/kernel_split_data_types.h" -#include "kernel_globals.h" -#include "kernel_montecarlo.h" -#include "kernel_random.h" - -#include "closure/alloc.h" -#include "closure/bsdf_util.h" -#include "closure/bsdf_ashikhmin_velvet.h" -#include "closure/bsdf_diffuse.h" -#include "closure/bsdf_microfacet.h" -#include "closure/bsdf_microfacet_multi.h" -#include "closure/bsdf_oren_nayar.h" -#include "closure/bsdf_reflection.h" -#include "closure/bsdf_refraction.h" -#include "closure/bsdf_transparent.h" -#include "closure/bsdf_ashikhmin_shirley.h" -#include "closure/bsdf_toon.h" -#include "closure/bsdf_hair.h" -#include "closure/volume.h" +#include "kernel/osl/osl_closures.h" +#include "kernel/osl/osl_shader.h" + +#include "util/util_debug.h" +#include "util/util_math.h" +#include "util/util_param.h" + +#include "kernel/kernel_types.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/split/kernel_split_data_types.h" +#include "kernel/kernel_globals.h" +#include "kernel/kernel_montecarlo.h" +#include "kernel/kernel_random.h" + +#include "kernel/closure/alloc.h" +#include "kernel/closure/bsdf_util.h" +#include "kernel/closure/bsdf_ashikhmin_velvet.h" +#include "kernel/closure/bsdf_diffuse.h" +#include "kernel/closure/bsdf_microfacet.h" +#include "kernel/closure/bsdf_microfacet_multi.h" +#include "kernel/closure/bsdf_oren_nayar.h" +#include "kernel/closure/bsdf_reflection.h" +#include "kernel/closure/bsdf_refraction.h" +#include "kernel/closure/bsdf_transparent.h" +#include "kernel/closure/bsdf_ashikhmin_shirley.h" +#include "kernel/closure/bsdf_toon.h" +#include "kernel/closure/bsdf_hair.h" +#include "kernel/closure/volume.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h index cd7b33703ff..929cf00a7e6 100644 --- a/intern/cycles/kernel/osl/osl_closures.h +++ b/intern/cycles/kernel/osl/osl_closures.h @@ -33,8 +33,8 @@ #ifndef __OSL_CLOSURES_H__ #define __OSL_CLOSURES_H__ -#include "util_types.h" -#include "kernel_types.h" +#include "util/util_types.h" +#include "kernel/kernel_types.h" #include <OSL/oslclosure.h> #include <OSL/oslexec.h> diff --git a/intern/cycles/kernel/osl/osl_globals.h b/intern/cycles/kernel/osl/osl_globals.h index 65cb7ecc6b4..02c083a83f8 100644 --- a/intern/cycles/kernel/osl/osl_globals.h +++ b/intern/cycles/kernel/osl/osl_globals.h @@ -21,10 +21,10 @@ #include <OSL/oslexec.h> -#include "util_map.h" -#include "util_param.h" -#include "util_thread.h" -#include "util_vector.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_thread.h" +#include "util/util_vector.h" #ifndef WIN32 using std::isfinite; diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index b08353e82d1..b767c60c617 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -25,34 +25,34 @@ #include <string.h> -#include "mesh.h" -#include "object.h" -#include "scene.h" - -#include "osl_closures.h" -#include "osl_globals.h" -#include "osl_services.h" -#include "osl_shader.h" - -#include "util_foreach.h" -#include "util_logging.h" -#include "util_string.h" - -#include "kernel_compat_cpu.h" -#include "split/kernel_split_data_types.h" -#include "kernel_globals.h" -#include "kernel_random.h" -#include "kernel_projection.h" -#include "kernel_differential.h" -#include "kernel_montecarlo.h" -#include "kernel_camera.h" -#include "kernels/cpu/kernel_cpu_image.h" -#include "geom/geom.h" -#include "bvh/bvh.h" - -#include "kernel_projection.h" -#include "kernel_accumulate.h" -#include "kernel_shader.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" + +#include "kernel/osl/osl_closures.h" +#include "kernel/osl/osl_globals.h" +#include "kernel/osl/osl_services.h" +#include "kernel/osl/osl_shader.h" + +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_string.h" + +#include "kernel/kernel_compat_cpu.h" +#include "kernel/split/kernel_split_data_types.h" +#include "kernel/kernel_globals.h" +#include "kernel/kernel_random.h" +#include "kernel/kernel_projection.h" +#include "kernel/kernel_differential.h" +#include "kernel/kernel_montecarlo.h" +#include "kernel/kernel_camera.h" +#include "kernel/kernels/cpu/kernel_cpu_image.h" +#include "kernel/geom/geom.h" +#include "kernel/bvh/bvh.h" + +#include "kernel/kernel_projection.h" +#include "kernel/kernel_accumulate.h" +#include "kernel/kernel_shader.h" #ifdef WITH_PTEX # include <Ptexture.h> diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index c7e9f57b18a..13b19d86eca 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -16,22 +16,22 @@ #include <OSL/oslexec.h> -#include "kernel_compat_cpu.h" -#include "kernel_montecarlo.h" -#include "kernel_types.h" -#include "split/kernel_split_data_types.h" -#include "kernel_globals.h" +#include "kernel/kernel_compat_cpu.h" +#include "kernel/kernel_montecarlo.h" +#include "kernel/kernel_types.h" +#include "kernel/split/kernel_split_data_types.h" +#include "kernel/kernel_globals.h" -#include "geom/geom_object.h" +#include "kernel/geom/geom_object.h" -#include "osl_closures.h" -#include "osl_globals.h" -#include "osl_services.h" -#include "osl_shader.h" +#include "kernel/osl/osl_closures.h" +#include "kernel/osl/osl_globals.h" +#include "kernel/osl/osl_services.h" +#include "kernel/osl/osl_shader.h" -#include "util_foreach.h" +#include "util/util_foreach.h" -#include "attribute.h" +#include "render/attribute.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/osl/osl_shader.h b/intern/cycles/kernel/osl/osl_shader.h index ad06dd6929d..32121e940b4 100644 --- a/intern/cycles/kernel/osl/osl_shader.h +++ b/intern/cycles/kernel/osl/osl_shader.h @@ -29,7 +29,7 @@ * This means no thread state must be passed along in the kernel itself. */ -#include "kernel_types.h" +#include "kernel/kernel_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/split/kernel_data_init.h b/intern/cycles/kernel/split/kernel_data_init.h index ed447049e48..9d3d01fff75 100644 --- a/intern/cycles/kernel/split/kernel_data_init.h +++ b/intern/cycles/kernel/split/kernel_data_init.h @@ -54,7 +54,7 @@ void KERNEL_FUNCTION_FULL_NAME(data_init)( #ifdef __KERNEL_OPENCL__ #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name, -#include "../kernel_textures.h" +#include "kernel/kernel_textures.h" #endif int start_sample, @@ -98,7 +98,7 @@ void KERNEL_FUNCTION_FULL_NAME(data_init)( #ifdef __KERNEL_OPENCL__ #define KERNEL_TEX(type, ttype, name) \ kg->name = name; -#include "../kernel_textures.h" +#include "kernel/kernel_textures.h" #endif int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); diff --git a/intern/cycles/kernel/split/kernel_split_common.h b/intern/cycles/kernel/split/kernel_split_common.h index 5c12fe426ac..4303ba0a905 100644 --- a/intern/cycles/kernel/split/kernel_split_common.h +++ b/intern/cycles/kernel/split/kernel_split_common.h @@ -17,61 +17,61 @@ #ifndef __KERNEL_SPLIT_H__ #define __KERNEL_SPLIT_H__ -#include "kernel_math.h" -#include "kernel_types.h" +#include "kernel/kernel_math.h" +#include "kernel/kernel_types.h" -#include "kernel_split_data.h" +#include "kernel/split/kernel_split_data.h" -#include "kernel_globals.h" +#include "kernel/kernel_globals.h" #ifdef __OSL__ -# include "osl_shader.h" +# include "kernel/osl/osl_shader.h" #endif #ifdef __KERNEL_OPENCL__ -# include "kernel_image_opencl.h" +# include "kernel/kernel_image_opencl.h" #endif #ifdef __KERNEL_CPU__ -# include "../kernels/cpu/kernel_cpu_image.h" +# include "kernel/kernels/cpu/kernel_cpu_image.h" #endif -#include "util_atomic.h" +#include "util/util_atomic.h" -#include "kernel_random.h" -#include "kernel_projection.h" -#include "kernel_montecarlo.h" -#include "kernel_differential.h" -#include "kernel_camera.h" +#include "kernel/kernel_random.h" +#include "kernel/kernel_projection.h" +#include "kernel/kernel_montecarlo.h" +#include "kernel/kernel_differential.h" +#include "kernel/kernel_camera.h" -#include "geom/geom.h" -#include "bvh/bvh.h" +#include "kernel/geom/geom.h" +#include "kernel/bvh/bvh.h" -#include "kernel_accumulate.h" -#include "kernel_shader.h" -#include "kernel_light.h" -#include "kernel_passes.h" +#include "kernel/kernel_accumulate.h" +#include "kernel/kernel_shader.h" +#include "kernel/kernel_light.h" +#include "kernel/kernel_passes.h" #ifdef __SUBSURFACE__ -# include "kernel_subsurface.h" +# include "kernel/kernel_subsurface.h" #endif #ifdef __VOLUME__ -# include "kernel_volume.h" +# include "kernel/kernel_volume.h" #endif -#include "kernel_path_state.h" -#include "kernel_shadow.h" -#include "kernel_emission.h" -#include "kernel_path_common.h" -#include "kernel_path_surface.h" -#include "kernel_path_volume.h" -#include "kernel_path_subsurface.h" +#include "kernel/kernel_path_state.h" +#include "kernel/kernel_shadow.h" +#include "kernel/kernel_emission.h" +#include "kernel/kernel_path_common.h" +#include "kernel/kernel_path_surface.h" +#include "kernel/kernel_path_volume.h" +#include "kernel/kernel_path_subsurface.h" #ifdef __KERNEL_DEBUG__ -# include "kernel_debug.h" +# include "kernel/kernel_debug.h" #endif -#include "kernel_queues.h" -#include "kernel_work_stealing.h" +#include "kernel/kernel_queues.h" +#include "kernel/kernel_work_stealing.h" #endif /* __KERNEL_SPLIT_H__ */ diff --git a/intern/cycles/kernel/split/kernel_split_data.h b/intern/cycles/kernel/split/kernel_split_data.h index d319514c190..17e6587883a 100644 --- a/intern/cycles/kernel/split/kernel_split_data.h +++ b/intern/cycles/kernel/split/kernel_split_data.h @@ -17,8 +17,8 @@ #ifndef __KERNEL_SPLIT_DATA_H__ #define __KERNEL_SPLIT_DATA_H__ -#include "kernel_split_data_types.h" -#include "kernel_globals.h" +#include "kernel/split/kernel_split_data_types.h" +#include "kernel/kernel_globals.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/svm/svm.h b/intern/cycles/kernel/svm/svm.h index 57ec9f94a3d..d748e76fa80 100644 --- a/intern/cycles/kernel/svm/svm.h +++ b/intern/cycles/kernel/svm/svm.h @@ -39,7 +39,7 @@ * mostly taken care of in the SVM compiler. */ -#include "svm_types.h" +#include "kernel/svm/svm_types.h" CCL_NAMESPACE_BEGIN @@ -139,49 +139,49 @@ CCL_NAMESPACE_END /* Nodes */ -#include "svm_noise.h" +#include "kernel/svm/svm_noise.h" #include "svm_texture.h" -#include "svm_color_util.h" -#include "svm_math_util.h" - -#include "svm_attribute.h" -#include "svm_gradient.h" -#include "svm_blackbody.h" -#include "svm_closure.h" -#include "svm_noisetex.h" -#include "svm_convert.h" -#include "svm_displace.h" -#include "svm_fresnel.h" -#include "svm_wireframe.h" -#include "svm_wavelength.h" -#include "svm_camera.h" -#include "svm_geometry.h" -#include "svm_hsv.h" -#include "svm_image.h" -#include "svm_gamma.h" -#include "svm_brightness.h" -#include "svm_invert.h" -#include "svm_light_path.h" -#include "svm_magic.h" -#include "svm_mapping.h" -#include "svm_normal.h" -#include "svm_wave.h" -#include "svm_math.h" -#include "svm_mix.h" -#include "svm_ramp.h" -#include "svm_sepcomb_hsv.h" -#include "svm_sepcomb_vector.h" -#include "svm_musgrave.h" -#include "svm_sky.h" -#include "svm_tex_coord.h" -#include "svm_value.h" -#include "svm_voronoi.h" -#include "svm_checker.h" -#include "svm_brick.h" -#include "svm_vector_transform.h" -#include "svm_voxel.h" -#include "svm_bump.h" +#include "kernel/svm/svm_color_util.h" +#include "kernel/svm/svm_math_util.h" + +#include "kernel/svm/svm_attribute.h" +#include "kernel/svm/svm_gradient.h" +#include "kernel/svm/svm_blackbody.h" +#include "kernel/svm/svm_closure.h" +#include "kernel/svm/svm_noisetex.h" +#include "kernel/svm/svm_convert.h" +#include "kernel/svm/svm_displace.h" +#include "kernel/svm/svm_fresnel.h" +#include "kernel/svm/svm_wireframe.h" +#include "kernel/svm/svm_wavelength.h" +#include "kernel/svm/svm_camera.h" +#include "kernel/svm/svm_geometry.h" +#include "kernel/svm/svm_hsv.h" +#include "kernel/svm/svm_image.h" +#include "kernel/svm/svm_gamma.h" +#include "kernel/svm/svm_brightness.h" +#include "kernel/svm/svm_invert.h" +#include "kernel/svm/svm_light_path.h" +#include "kernel/svm/svm_magic.h" +#include "kernel/svm/svm_mapping.h" +#include "kernel/svm/svm_normal.h" +#include "kernel/svm/svm_wave.h" +#include "kernel/svm/svm_math.h" +#include "kernel/svm/svm_mix.h" +#include "kernel/svm/svm_ramp.h" +#include "kernel/svm/svm_sepcomb_hsv.h" +#include "kernel/svm/svm_sepcomb_vector.h" +#include "kernel/svm/svm_musgrave.h" +#include "kernel/svm/svm_sky.h" +#include "kernel/svm/svm_tex_coord.h" +#include "kernel/svm/svm_value.h" +#include "kernel/svm/svm_voronoi.h" +#include "kernel/svm/svm_checker.h" +#include "kernel/svm/svm_brick.h" +#include "kernel/svm/svm_vector_transform.h" +#include "kernel/svm/svm_voxel.h" +#include "kernel/svm/svm_bump.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/kernel/svm/svm_voxel.h b/intern/cycles/kernel/svm/svm_voxel.h index a8b3604a8a7..9e826c8c23f 100644 --- a/intern/cycles/kernel/svm/svm_voxel.h +++ b/intern/cycles/kernel/svm/svm_voxel.h @@ -46,7 +46,7 @@ ccl_device void svm_node_tex_voxel(KernelGlobals *kg, # if defined(__KERNEL_CUDA__) # if __CUDA_ARCH__ >= 300 CUtexObject tex = kernel_tex_fetch(__bindless_mapping, id); - if(id < 2048) /* TODO(dingto): Make this a variable */ + if(id < TEX_START_HALF4_CUDA_KEPLER) r = kernel_tex_image_interp_3d_float4(tex, co.x, co.y, co.z); else { float f = kernel_tex_image_interp_3d_float(tex, co.x, co.y, co.z); diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt index 8eaa9de3874..17ac66644e2 100644 --- a/intern/cycles/render/CMakeLists.txt +++ b/intern/cycles/render/CMakeLists.txt @@ -1,14 +1,6 @@ set(INC - . - ../device - ../graph - ../kernel - ../kernel/svm - ../kernel/osl - ../bvh - ../subd - ../util + .. ../../glew-mx ) diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index c0d429a583c..e157a385904 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "image.h" -#include "mesh.h" -#include "attribute.h" +#include "render/image.h" +#include "render/mesh.h" +#include "render/attribute.h" -#include "util_debug.h" -#include "util_foreach.h" -#include "util_transform.h" +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_transform.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/attribute.h b/intern/cycles/render/attribute.h index f4538c76369..a64eb6542d5 100644 --- a/intern/cycles/render/attribute.h +++ b/intern/cycles/render/attribute.h @@ -17,12 +17,12 @@ #ifndef __ATTRIBUTE_H__ #define __ATTRIBUTE_H__ -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_list.h" -#include "util_param.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_list.h" +#include "util/util_param.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/background.cpp b/intern/cycles/render/background.cpp index 8d7d7b847fd..930debe1e33 100644 --- a/intern/cycles/render/background.cpp +++ b/intern/cycles/render/background.cpp @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "background.h" -#include "device.h" -#include "integrator.h" -#include "graph.h" -#include "nodes.h" -#include "scene.h" -#include "shader.h" - -#include "util_foreach.h" -#include "util_math.h" -#include "util_types.h" +#include "render/background.h" +#include "device/device.h" +#include "render/integrator.h" +#include "render/graph.h" +#include "render/nodes.h" +#include "render/scene.h" +#include "render/shader.h" + +#include "util/util_foreach.h" +#include "util/util_math.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/background.h b/intern/cycles/render/background.h index deb22c9c2f2..db20b6ebf87 100644 --- a/intern/cycles/render/background.h +++ b/intern/cycles/render/background.h @@ -17,9 +17,9 @@ #ifndef __BACKGROUND_H__ #define __BACKGROUND_H__ -#include "node.h" +#include "graph/node.h" -#include "util_types.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/bake.cpp b/intern/cycles/render/bake.cpp index c2f6293a50b..c0fcd517390 100644 --- a/intern/cycles/render/bake.cpp +++ b/intern/cycles/render/bake.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "bake.h" -#include "integrator.h" +#include "render/bake.h" +#include "render/integrator.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/bake.h b/intern/cycles/render/bake.h index aed9c5a8e75..ceb94cfb682 100644 --- a/intern/cycles/render/bake.h +++ b/intern/cycles/render/bake.h @@ -17,11 +17,11 @@ #ifndef __BAKE_H__ #define __BAKE_H__ -#include "device.h" -#include "scene.h" +#include "device/device.h" +#include "render/scene.h" -#include "util_progress.h" -#include "util_vector.h" +#include "util/util_progress.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp index 661466afb24..2c41bd88bda 100644 --- a/intern/cycles/render/buffers.cpp +++ b/intern/cycles/render/buffers.cpp @@ -16,17 +16,17 @@ #include <stdlib.h> -#include "buffers.h" -#include "device.h" - -#include "util_debug.h" -#include "util_foreach.h" -#include "util_hash.h" -#include "util_image.h" -#include "util_math.h" -#include "util_opengl.h" -#include "util_time.h" -#include "util_types.h" +#include "render/buffers.h" +#include "device/device.h" + +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_hash.h" +#include "util/util_image.h" +#include "util/util_math.h" +#include "util/util_opengl.h" +#include "util/util_time.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/buffers.h b/intern/cycles/render/buffers.h index 95900f13161..604aaba24d2 100644 --- a/intern/cycles/render/buffers.h +++ b/intern/cycles/render/buffers.h @@ -17,16 +17,16 @@ #ifndef __BUFFERS_H__ #define __BUFFERS_H__ -#include "device_memory.h" +#include "device/device_memory.h" -#include "film.h" +#include "render/film.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_half.h" -#include "util_string.h" -#include "util_thread.h" -#include "util_types.h" +#include "util/util_half.h" +#include "util/util_string.h" +#include "util/util_thread.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index c8c51ec96d2..83ff8a10618 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "camera.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "tables.h" - -#include "device.h" - -#include "util_foreach.h" -#include "util_function.h" -#include "util_math_cdf.h" -#include "util_vector.h" +#include "render/camera.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/tables.h" + +#include "device/device.h" + +#include "util/util_foreach.h" +#include "util/util_function.h" +#include "util/util_math_cdf.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/camera.h b/intern/cycles/render/camera.h index 655d74e42d8..dd6b831b347 100644 --- a/intern/cycles/render/camera.h +++ b/intern/cycles/render/camera.h @@ -17,13 +17,13 @@ #ifndef __CAMERA_H__ #define __CAMERA_H__ -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "node.h" +#include "graph/node.h" -#include "util_boundbox.h" -#include "util_transform.h" -#include "util_types.h" +#include "util/util_boundbox.h" +#include "util/util_transform.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/constant_fold.cpp b/intern/cycles/render/constant_fold.cpp index b7f25663bc3..2569d9eec27 100644 --- a/intern/cycles/render/constant_fold.cpp +++ b/intern/cycles/render/constant_fold.cpp @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "constant_fold.h" -#include "graph.h" +#include "render/constant_fold.h" +#include "render/graph.h" -#include "util_foreach.h" -#include "util_logging.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/constant_fold.h b/intern/cycles/render/constant_fold.h index 7962698319f..33f93b8c0ab 100644 --- a/intern/cycles/render/constant_fold.h +++ b/intern/cycles/render/constant_fold.h @@ -17,8 +17,8 @@ #ifndef __CONSTANT_FOLD_H__ #define __CONSTANT_FOLD_H__ -#include "util_types.h" -#include "svm_types.h" +#include "util/util_types.h" +#include "kernel/svm/svm_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/curves.cpp b/intern/cycles/render/curves.cpp index f671eb19cae..4c085b928fb 100644 --- a/intern/cycles/render/curves.cpp +++ b/intern/cycles/render/curves.cpp @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "device.h" -#include "curves.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" - -#include "util_foreach.h" -#include "util_map.h" -#include "util_progress.h" -#include "util_vector.h" +#include "device/device.h" +#include "render/curves.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" + +#include "util/util_foreach.h" +#include "util/util_map.h" +#include "util/util_progress.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/curves.h b/intern/cycles/render/curves.h index e41967eebf5..8834764bd63 100644 --- a/intern/cycles/render/curves.h +++ b/intern/cycles/render/curves.h @@ -17,8 +17,8 @@ #ifndef __CURVES_H__ #define __CURVES_H__ -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp index 4d19e882811..ff9f5a0fe29 100644 --- a/intern/cycles/render/film.cpp +++ b/intern/cycles/render/film.cpp @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "camera.h" -#include "device.h" -#include "film.h" -#include "integrator.h" -#include "mesh.h" -#include "scene.h" -#include "tables.h" - -#include "util_algorithm.h" -#include "util_debug.h" -#include "util_foreach.h" -#include "util_math.h" -#include "util_math_cdf.h" +#include "render/camera.h" +#include "device/device.h" +#include "render/film.h" +#include "render/integrator.h" +#include "render/mesh.h" +#include "render/scene.h" +#include "render/tables.h" + +#include "util/util_algorithm.h" +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_math.h" +#include "util/util_math_cdf.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/film.h b/intern/cycles/render/film.h index ee3a5171279..448740da48a 100644 --- a/intern/cycles/render/film.h +++ b/intern/cycles/render/film.h @@ -17,12 +17,12 @@ #ifndef __FILM_H__ #define __FILM_H__ -#include "util_string.h" -#include "util_vector.h" +#include "util/util_string.h" +#include "util/util_vector.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "node.h" +#include "graph/node.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index 0cfd08090c2..0362e8f834a 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "attribute.h" -#include "graph.h" -#include "nodes.h" -#include "scene.h" -#include "shader.h" -#include "constant_fold.h" - -#include "util_algorithm.h" -#include "util_debug.h" -#include "util_foreach.h" -#include "util_queue.h" -#include "util_logging.h" +#include "render/attribute.h" +#include "render/graph.h" +#include "render/nodes.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/constant_fold.h" + +#include "util/util_algorithm.h" +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_queue.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h index d22193d4e51..09932695d1f 100644 --- a/intern/cycles/render/graph.h +++ b/intern/cycles/render/graph.h @@ -17,17 +17,17 @@ #ifndef __GRAPH_H__ #define __GRAPH_H__ -#include "node.h" -#include "node_type.h" +#include "graph/node.h" +#include "graph/node_type.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_list.h" -#include "util_map.h" -#include "util_param.h" -#include "util_set.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_list.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_set.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp index 438b2347499..a8c4f446bea 100644 --- a/intern/cycles/render/image.cpp +++ b/intern/cycles/render/image.cpp @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "device.h" -#include "image.h" -#include "scene.h" - -#include "util_foreach.h" -#include "util_logging.h" -#include "util_path.h" -#include "util_progress.h" -#include "util_texture.h" +#include "device/device.h" +#include "render/image.h" +#include "render/scene.h" + +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_path.h" +#include "util/util_progress.h" +#include "util/util_texture.h" #ifdef WITH_OSL #include <OSL/oslexec.h> diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h index 494c74f0cdd..996b5a5b65f 100644 --- a/intern/cycles/render/image.h +++ b/intern/cycles/render/image.h @@ -17,13 +17,13 @@ #ifndef __IMAGE_H__ #define __IMAGE_H__ -#include "device.h" -#include "device_memory.h" +#include "device/device.h" +#include "device/device_memory.h" -#include "util_image.h" -#include "util_string.h" -#include "util_thread.h" -#include "util_vector.h" +#include "util/util_image.h" +#include "util/util_string.h" +#include "util/util_thread.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp index 1ab0f9874f2..a004bb5b856 100644 --- a/intern/cycles/render/integrator.cpp +++ b/intern/cycles/render/integrator.cpp @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "device.h" -#include "integrator.h" -#include "film.h" -#include "light.h" -#include "scene.h" -#include "shader.h" -#include "sobol.h" - -#include "util_foreach.h" -#include "util_hash.h" +#include "device/device.h" +#include "render/integrator.h" +#include "render/film.h" +#include "render/light.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/sobol.h" + +#include "util/util_foreach.h" +#include "util/util_hash.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h index 3ce41d5a185..9501d7f8416 100644 --- a/intern/cycles/render/integrator.h +++ b/intern/cycles/render/integrator.h @@ -17,9 +17,9 @@ #ifndef __INTEGRATOR_H__ #define __INTEGRATOR_H__ -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "node.h" +#include "graph/node.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index fc6790dc022..4886dcd563f 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "background.h" -#include "device.h" -#include "integrator.h" -#include "film.h" -#include "light.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "shader.h" - -#include "util_foreach.h" -#include "util_progress.h" -#include "util_logging.h" +#include "render/background.h" +#include "device/device.h" +#include "render/integrator.h" +#include "render/film.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/shader.h" + +#include "util/util_foreach.h" +#include "util/util_progress.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h index f56530b6490..7e9014eb823 100644 --- a/intern/cycles/render/light.h +++ b/intern/cycles/render/light.h @@ -17,12 +17,12 @@ #ifndef __LIGHT_H__ #define __LIGHT_H__ -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "node.h" +#include "graph/node.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 4f769e6a7a6..3c1351d0433 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -14,29 +14,29 @@ * limitations under the License. */ -#include "bvh.h" -#include "bvh_build.h" - -#include "camera.h" -#include "curves.h" -#include "device.h" -#include "graph.h" -#include "shader.h" -#include "light.h" -#include "mesh.h" -#include "nodes.h" -#include "object.h" -#include "scene.h" - -#include "osl_globals.h" - -#include "subd_split.h" -#include "subd_patch_table.h" - -#include "util_foreach.h" -#include "util_logging.h" -#include "util_progress.h" -#include "util_set.h" +#include "bvh/bvh.h" +#include "bvh/bvh_build.h" + +#include "render/camera.h" +#include "render/curves.h" +#include "device/device.h" +#include "render/graph.h" +#include "render/shader.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/nodes.h" +#include "render/object.h" +#include "render/scene.h" + +#include "kernel/osl/osl_globals.h" + +#include "subd/subd_split.h" +#include "subd/subd_patch_table.h" + +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_progress.h" +#include "util/util_set.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h index 1f8b880c161..043ce9d0ffc 100644 --- a/intern/cycles/render/mesh.h +++ b/intern/cycles/render/mesh.h @@ -17,17 +17,18 @@ #ifndef __MESH_H__ #define __MESH_H__ -#include "attribute.h" -#include "node.h" -#include "shader.h" - -#include "util_boundbox.h" -#include "util_list.h" -#include "util_map.h" -#include "util_param.h" -#include "util_transform.h" -#include "util_types.h" -#include "util_vector.h" +#include "graph/node.h" + +#include "render/attribute.h" +#include "render/shader.h" + +#include "util/util_boundbox.h" +#include "util/util_list.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_transform.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/mesh_displace.cpp b/intern/cycles/render/mesh_displace.cpp index 4acb7911560..cf28bb16bb7 100644 --- a/intern/cycles/render/mesh_displace.cpp +++ b/intern/cycles/render/mesh_displace.cpp @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "device.h" +#include "device/device.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "shader.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/shader.h" -#include "util_foreach.h" -#include "util_progress.h" +#include "util/util_foreach.h" +#include "util/util_progress.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/mesh_subdivision.cpp b/intern/cycles/render/mesh_subdivision.cpp index 57c76a9f1c8..585ed77b026 100644 --- a/intern/cycles/render/mesh_subdivision.cpp +++ b/intern/cycles/render/mesh_subdivision.cpp @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "mesh.h" -#include "attribute.h" -#include "camera.h" +#include "render/mesh.h" +#include "render/attribute.h" +#include "render/camera.h" -#include "subd_split.h" -#include "subd_patch.h" -#include "subd_patch_table.h" +#include "subd/subd_split.h" +#include "subd/subd_patch.h" +#include "subd/subd_patch_table.h" -#include "util_foreach.h" -#include "util_algorithm.h" +#include "util/util_foreach.h" +#include "util/util_algorithm.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 7052c03ed94..1070e05a03b 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "image.h" -#include "integrator.h" -#include "nodes.h" -#include "scene.h" -#include "svm.h" -#include "svm_color_util.h" -#include "svm_ramp_util.h" -#include "svm_math_util.h" -#include "osl.h" -#include "constant_fold.h" - -#include "util_sky_model.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_transform.h" +#include "render/image.h" +#include "render/integrator.h" +#include "render/nodes.h" +#include "render/scene.h" +#include "render/svm.h" +#include "kernel/svm/svm_color_util.h" +#include "kernel/svm/svm_ramp_util.h" +#include "kernel/svm/svm_math_util.h" +#include "render/osl.h" +#include "render/constant_fold.h" + +#include "util/util_sky_model.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_transform.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h index dfc44dbbf4a..a755b653a5b 100644 --- a/intern/cycles/render/nodes.h +++ b/intern/cycles/render/nodes.h @@ -17,10 +17,10 @@ #ifndef __NODES_H__ #define __NODES_H__ -#include "graph.h" -#include "node.h" +#include "render/graph.h" +#include "graph/node.h" -#include "util_string.h" +#include "util/util_string.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index a3a8c6d68e4..375abfeb27a 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -14,22 +14,22 @@ * limitations under the License. */ -#include "camera.h" -#include "device.h" -#include "light.h" -#include "mesh.h" -#include "curves.h" -#include "object.h" -#include "particles.h" -#include "scene.h" - -#include "util_foreach.h" -#include "util_logging.h" -#include "util_map.h" -#include "util_progress.h" -#include "util_vector.h" - -#include "subd_patch_table.h" +#include "render/camera.h" +#include "device/device.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/curves.h" +#include "render/object.h" +#include "render/particles.h" +#include "render/scene.h" + +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_map.h" +#include "util/util_progress.h" +#include "util/util_vector.h" + +#include "subd/subd_patch_table.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/object.h b/intern/cycles/render/object.h index dabe0f71662..12d7b2c81cf 100644 --- a/intern/cycles/render/object.h +++ b/intern/cycles/render/object.h @@ -17,14 +17,14 @@ #ifndef __OBJECT_H__ #define __OBJECT_H__ -#include "node.h" -#include "scene.h" - -#include "util_boundbox.h" -#include "util_param.h" -#include "util_transform.h" -#include "util_thread.h" -#include "util_types.h" +#include "graph/node.h" +#include "render/scene.h" + +#include "util/util_boundbox.h" +#include "util/util_param.h" +#include "util/util_transform.h" +#include "util/util_thread.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 68bd8d96bf9..6bff29d1c76 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -14,26 +14,26 @@ * limitations under the License. */ -#include "device.h" +#include "device/device.h" -#include "graph.h" -#include "light.h" -#include "osl.h" -#include "scene.h" -#include "shader.h" -#include "nodes.h" +#include "render/graph.h" +#include "render/light.h" +#include "render/osl.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/nodes.h" #ifdef WITH_OSL -#include "osl_globals.h" -#include "osl_services.h" -#include "osl_shader.h" +#include "kernel/osl/osl_globals.h" +#include "kernel/osl/osl_services.h" +#include "kernel/osl/osl_shader.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_progress.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_progress.h" #endif diff --git a/intern/cycles/render/osl.h b/intern/cycles/render/osl.h index b131b672b8c..2be1126fdd3 100644 --- a/intern/cycles/render/osl.h +++ b/intern/cycles/render/osl.h @@ -17,13 +17,13 @@ #ifndef __OSL_H__ #define __OSL_H__ -#include "util_set.h" -#include "util_string.h" -#include "util_thread.h" +#include "util/util_set.h" +#include "util/util_string.h" +#include "util/util_thread.h" -#include "graph.h" -#include "nodes.h" -#include "shader.h" +#include "render/graph.h" +#include "render/nodes.h" +#include "render/shader.h" #ifdef WITH_OSL #include <OSL/oslcomp.h> diff --git a/intern/cycles/render/particles.cpp b/intern/cycles/render/particles.cpp index 1a35d60fb4b..a51822a08be 100644 --- a/intern/cycles/render/particles.cpp +++ b/intern/cycles/render/particles.cpp @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "device.h" -#include "particles.h" -#include "scene.h" - -#include "util_foreach.h" -#include "util_logging.h" -#include "util_map.h" -#include "util_progress.h" -#include "util_vector.h" +#include "device/device.h" +#include "render/particles.h" +#include "render/scene.h" + +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_map.h" +#include "util/util_progress.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/particles.h b/intern/cycles/render/particles.h index 2509e27b44b..66d46114b3e 100644 --- a/intern/cycles/render/particles.h +++ b/intern/cycles/render/particles.h @@ -17,8 +17,8 @@ #ifndef __PARTICLES_H__ #define __PARTICLES_H__ -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index 68124e78cb5..4db20338744 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -16,27 +16,27 @@ #include <stdlib.h> -#include "background.h" -#include "bake.h" -#include "camera.h" -#include "curves.h" -#include "device.h" -#include "film.h" -#include "integrator.h" -#include "light.h" -#include "mesh.h" -#include "object.h" -#include "osl.h" -#include "particles.h" -#include "scene.h" -#include "shader.h" -#include "svm.h" -#include "tables.h" - -#include "util_foreach.h" -#include "util_guarded_allocator.h" -#include "util_logging.h" -#include "util_progress.h" +#include "render/background.h" +#include "render/bake.h" +#include "render/camera.h" +#include "render/curves.h" +#include "device/device.h" +#include "render/film.h" +#include "render/integrator.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/osl.h" +#include "render/particles.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/svm.h" +#include "render/tables.h" + +#include "util/util_foreach.h" +#include "util/util_guarded_allocator.h" +#include "util/util_logging.h" +#include "util/util_progress.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index 9f398c444f4..2b5267642a2 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -17,18 +17,18 @@ #ifndef __SCENE_H__ #define __SCENE_H__ -#include "image.h" -#include "shader.h" - -#include "device_memory.h" - -#include "util_param.h" -#include "util_string.h" -#include "util_system.h" -#include "util_texture.h" -#include "util_thread.h" -#include "util_types.h" -#include "util_vector.h" +#include "render/image.h" +#include "render/shader.h" + +#include "device/device_memory.h" + +#include "util/util_param.h" +#include "util/util_string.h" +#include "util/util_system.h" +#include "util/util_texture.h" +#include "util/util_thread.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index cb8aef855bd..b5e4328db29 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -17,24 +17,24 @@ #include <string.h> #include <limits.h> -#include "buffers.h" -#include "camera.h" -#include "device.h" -#include "graph.h" -#include "integrator.h" -#include "mesh.h" -#include "object.h" -#include "scene.h" -#include "session.h" -#include "bake.h" - -#include "util_foreach.h" -#include "util_function.h" -#include "util_logging.h" -#include "util_math.h" -#include "util_opengl.h" -#include "util_task.h" -#include "util_time.h" +#include "render/buffers.h" +#include "render/camera.h" +#include "device/device.h" +#include "render/graph.h" +#include "render/integrator.h" +#include "render/mesh.h" +#include "render/object.h" +#include "render/scene.h" +#include "render/session.h" +#include "render/bake.h" + +#include "util/util_foreach.h" +#include "util/util_function.h" +#include "util/util_logging.h" +#include "util/util_math.h" +#include "util/util_opengl.h" +#include "util/util_task.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/session.h b/intern/cycles/render/session.h index bd17c70380c..a98300fdd67 100644 --- a/intern/cycles/render/session.h +++ b/intern/cycles/render/session.h @@ -17,15 +17,15 @@ #ifndef __SESSION_H__ #define __SESSION_H__ -#include "buffers.h" -#include "device.h" -#include "shader.h" -#include "tile.h" - -#include "util_progress.h" -#include "util_stats.h" -#include "util_thread.h" -#include "util_vector.h" +#include "render/buffers.h" +#include "device/device.h" +#include "render/shader.h" +#include "render/tile.h" + +#include "util/util_progress.h" +#include "util/util_stats.h" +#include "util/util_thread.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index 335edcbe609..12d3c6cf832 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -14,22 +14,22 @@ * limitations under the License. */ -#include "background.h" -#include "camera.h" -#include "device.h" -#include "graph.h" -#include "integrator.h" -#include "light.h" -#include "mesh.h" -#include "nodes.h" -#include "object.h" -#include "osl.h" -#include "scene.h" -#include "shader.h" -#include "svm.h" -#include "tables.h" - -#include "util_foreach.h" +#include "render/background.h" +#include "render/camera.h" +#include "device/device.h" +#include "render/graph.h" +#include "render/integrator.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/nodes.h" +#include "render/object.h" +#include "render/osl.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/svm.h" +#include "render/tables.h" + +#include "util/util_foreach.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h index 490c3f1c95d..87fef19c592 100644 --- a/intern/cycles/render/shader.h +++ b/intern/cycles/render/shader.h @@ -19,20 +19,20 @@ #ifdef WITH_OSL /* So no context pollution happens from indirectly included windows.h */ -# include "util_windows.h" +# include "util/util_windows.h" # include <OSL/oslexec.h> #endif -#include "attribute.h" -#include "kernel_types.h" +#include "render/attribute.h" +#include "kernel/kernel_types.h" -#include "node.h" +#include "graph/node.h" -#include "util_map.h" -#include "util_param.h" -#include "util_string.h" -#include "util_thread.h" -#include "util_types.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_string.h" +#include "util/util_thread.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/sobol.cpp b/intern/cycles/render/sobol.cpp index e3c2e802067..ce93dc8c5d5 100644 --- a/intern/cycles/render/sobol.cpp +++ b/intern/cycles/render/sobol.cpp @@ -46,10 +46,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "util_debug.h" -#include "util_types.h" +#include "util/util_debug.h" +#include "util/util_types.h" -#include "sobol.h" +#include "render/sobol.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/sobol.h b/intern/cycles/render/sobol.h index 574f148b9a2..9fbce4e14a5 100644 --- a/intern/cycles/render/sobol.h +++ b/intern/cycles/render/sobol.h @@ -17,7 +17,7 @@ #ifndef __SOBOL_H__ #define __SOBOL_H__ -#include "util_types.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp index bbf14c24b56..4cb4018e2b4 100644 --- a/intern/cycles/render/svm.cpp +++ b/intern/cycles/render/svm.cpp @@ -14,20 +14,20 @@ * limitations under the License. */ -#include "device.h" -#include "graph.h" -#include "light.h" -#include "mesh.h" -#include "nodes.h" -#include "scene.h" -#include "shader.h" -#include "svm.h" - -#include "util_debug.h" -#include "util_logging.h" -#include "util_foreach.h" -#include "util_progress.h" -#include "util_task.h" +#include "device/device.h" +#include "render/graph.h" +#include "render/light.h" +#include "render/mesh.h" +#include "render/nodes.h" +#include "render/scene.h" +#include "render/shader.h" +#include "render/svm.h" + +#include "util/util_debug.h" +#include "util/util_logging.h" +#include "util/util_foreach.h" +#include "util/util_progress.h" +#include "util/util_task.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h index a501b6bc8b1..abbd9e50610 100644 --- a/intern/cycles/render/svm.h +++ b/intern/cycles/render/svm.h @@ -17,13 +17,13 @@ #ifndef __SVM_H__ #define __SVM_H__ -#include "attribute.h" -#include "graph.h" -#include "shader.h" +#include "render/attribute.h" +#include "render/graph.h" +#include "render/shader.h" -#include "util_set.h" -#include "util_string.h" -#include "util_thread.h" +#include "util/util_set.h" +#include "util/util_string.h" +#include "util/util_thread.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/tables.cpp b/intern/cycles/render/tables.cpp index dfafd99961b..bf1ef12d602 100644 --- a/intern/cycles/render/tables.cpp +++ b/intern/cycles/render/tables.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "device.h" -#include "scene.h" -#include "tables.h" +#include "device/device.h" +#include "render/scene.h" +#include "render/tables.h" -#include "util_debug.h" -#include "util_logging.h" +#include "util/util_debug.h" +#include "util/util_logging.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/tables.h b/intern/cycles/render/tables.h index 1bb70b22762..bc261c2a74d 100644 --- a/intern/cycles/render/tables.h +++ b/intern/cycles/render/tables.h @@ -17,7 +17,7 @@ #ifndef __TABLES_H__ #define __TABLES_H__ -#include <util_list.h> +#include "util/util_list.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp index 321760a3147..9eb1c3e4d52 100644 --- a/intern/cycles/render/tile.cpp +++ b/intern/cycles/render/tile.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "tile.h" +#include "render/tile.h" -#include "util_algorithm.h" -#include "util_types.h" +#include "util/util_algorithm.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/render/tile.h b/intern/cycles/render/tile.h index 445f3739675..1d879aa6602 100644 --- a/intern/cycles/render/tile.h +++ b/intern/cycles/render/tile.h @@ -19,8 +19,8 @@ #include <limits.h> -#include "buffers.h" -#include "util_list.h" +#include "render/buffers.h" +#include "util/util_list.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/subd/CMakeLists.txt b/intern/cycles/subd/CMakeLists.txt index dafb807bdf3..fe0c221ab0d 100644 --- a/intern/cycles/subd/CMakeLists.txt +++ b/intern/cycles/subd/CMakeLists.txt @@ -1,11 +1,6 @@ set(INC - . - ../graph - ../kernel - ../kernel/svm - ../render - ../util + .. ) set(INC_SYS diff --git a/intern/cycles/subd/subd_dice.cpp b/intern/cycles/subd/subd_dice.cpp index a1bd349b167..fae815901ee 100644 --- a/intern/cycles/subd/subd_dice.cpp +++ b/intern/cycles/subd/subd_dice.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "camera.h" -#include "mesh.h" +#include "render/camera.h" +#include "render/mesh.h" -#include "subd_dice.h" -#include "subd_patch.h" +#include "subd/subd_dice.h" +#include "subd/subd_patch.h" -#include "util_debug.h" +#include "util/util_debug.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/subd/subd_dice.h b/intern/cycles/subd/subd_dice.h index 33d13a4ab3a..c0e32be18c4 100644 --- a/intern/cycles/subd/subd_dice.h +++ b/intern/cycles/subd/subd_dice.h @@ -22,8 +22,8 @@ * DiagSplit. For more algorithm details, see the DiagSplit paper or the * ARB_tessellation_shader OpenGL extension, Section 2.X.2. */ -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/subd/subd_patch.cpp b/intern/cycles/subd/subd_patch.cpp index d3319c5ccf5..fa2fe2bf113 100644 --- a/intern/cycles/subd/subd_patch.cpp +++ b/intern/cycles/subd/subd_patch.cpp @@ -16,12 +16,12 @@ /* Parts adapted from code in the public domain in NVidia Mesh Tools. */ -#include "mesh.h" +#include "render/mesh.h" -#include "subd_patch.h" +#include "subd/subd_patch.h" -#include "util_math.h" -#include "util_types.h" +#include "util/util_math.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/subd/subd_patch.h b/intern/cycles/subd/subd_patch.h index 360c1abf27b..1bb81588835 100644 --- a/intern/cycles/subd/subd_patch.h +++ b/intern/cycles/subd/subd_patch.h @@ -17,8 +17,8 @@ #ifndef __SUBD_PATCH_H__ #define __SUBD_PATCH_H__ -#include "util_boundbox.h" -#include "util_types.h" +#include "util/util_boundbox.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/subd/subd_patch_table.cpp b/intern/cycles/subd/subd_patch_table.cpp index d437b045c07..63bf673a90b 100644 --- a/intern/cycles/subd/subd_patch_table.cpp +++ b/intern/cycles/subd/subd_patch_table.cpp @@ -25,10 +25,10 @@ * */ -#include "subd_patch_table.h" -#include "kernel_types.h" +#include "subd/subd_patch_table.h" +#include "kernel/kernel_types.h" -#include "util_math.h" +#include "util/util_math.h" #ifdef WITH_OPENSUBDIV #include <opensubdiv/far/patchTable.h> diff --git a/intern/cycles/subd/subd_patch_table.h b/intern/cycles/subd/subd_patch_table.h index 3166a1691d8..907f2dd6c28 100644 --- a/intern/cycles/subd/subd_patch_table.h +++ b/intern/cycles/subd/subd_patch_table.h @@ -17,8 +17,8 @@ #ifndef __SUBD_PATCH_TABLE_H__ #define __SUBD_PATCH_TABLE_H__ -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" #ifdef WITH_OPENSUBDIV #ifdef _MSC_VER diff --git a/intern/cycles/subd/subd_split.cpp b/intern/cycles/subd/subd_split.cpp index 3c91ad8ab0d..9dbfc1c4e2f 100644 --- a/intern/cycles/subd/subd_split.cpp +++ b/intern/cycles/subd/subd_split.cpp @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "camera.h" -#include "mesh.h" +#include "render/camera.h" +#include "render/mesh.h" -#include "subd_dice.h" -#include "subd_patch.h" -#include "subd_split.h" +#include "subd/subd_dice.h" +#include "subd/subd_patch.h" +#include "subd/subd_split.h" -#include "util_debug.h" -#include "util_math.h" -#include "util_types.h" +#include "util/util_debug.h" +#include "util/util_math.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/subd/subd_split.h b/intern/cycles/subd/subd_split.h index a2f76dd2e03..f869cc6a48e 100644 --- a/intern/cycles/subd/subd_split.h +++ b/intern/cycles/subd/subd_split.h @@ -22,10 +22,10 @@ * evaluation at arbitrary points is required for this to work. See the paper * for more details. */ -#include "subd_dice.h" +#include "subd/subd_dice.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index 5108a5c8692..922dad67e2e 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -1,6 +1,6 @@ set(INC - . + .. ../../glew-mx ) diff --git a/intern/cycles/util/util_aligned_malloc.cpp b/intern/cycles/util/util_aligned_malloc.cpp index 15d2eb3271b..cc7252dcc58 100644 --- a/intern/cycles/util/util_aligned_malloc.cpp +++ b/intern/cycles/util/util_aligned_malloc.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "util_aligned_malloc.h" -#include "util_guarded_allocator.h" +#include "util/util_aligned_malloc.h" +#include "util/util_guarded_allocator.h" #include <cassert> diff --git a/intern/cycles/util/util_aligned_malloc.h b/intern/cycles/util/util_aligned_malloc.h index ecc0f28c376..cf1e86ca916 100644 --- a/intern/cycles/util/util_aligned_malloc.h +++ b/intern/cycles/util/util_aligned_malloc.h @@ -17,7 +17,7 @@ #ifndef __UTIL_ALIGNED_MALLOC_H__ #define __UTIL_ALIGNED_MALLOC_H__ -#include "util_types.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_boundbox.h b/intern/cycles/util/util_boundbox.h index dfe4977aef3..ed94ca20211 100644 --- a/intern/cycles/util/util_boundbox.h +++ b/intern/cycles/util/util_boundbox.h @@ -20,10 +20,10 @@ #include <math.h> #include <float.h> -#include "util_math.h" -#include "util_string.h" -#include "util_transform.h" -#include "util_types.h" +#include "util/util_math.h" +#include "util/util_string.h" +#include "util/util_transform.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_color.h b/intern/cycles/util/util_color.h index d3598f84b94..4d673dc34d8 100644 --- a/intern/cycles/util/util_color.h +++ b/intern/cycles/util/util_color.h @@ -17,11 +17,11 @@ #ifndef __UTIL_COLOR_H__ #define __UTIL_COLOR_H__ -#include "util_math.h" -#include "util_types.h" +#include "util/util_math.h" +#include "util/util_types.h" #ifdef __KERNEL_SSE2__ -#include "util_simd.h" +#include "util/util_simd.h" #endif CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_debug.cpp b/intern/cycles/util/util_debug.cpp index da3ccae45bf..9cfa57dd741 100644 --- a/intern/cycles/util/util_debug.cpp +++ b/intern/cycles/util/util_debug.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "util_debug.h" +#include "util/util_debug.h" #include <stdlib.h> -#include "util_logging.h" -#include "util_string.h" +#include "util/util_logging.h" +#include "util/util_string.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_debug.h b/intern/cycles/util/util_debug.h index 5aa0d911884..4505d584490 100644 --- a/intern/cycles/util/util_debug.h +++ b/intern/cycles/util/util_debug.h @@ -20,7 +20,7 @@ #include <cassert> #include <iostream> -#include "util_static_assert.h" +#include "util/util_static_assert.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_guarded_allocator.cpp b/intern/cycles/util/util_guarded_allocator.cpp index 615ac95f324..54fa6a80df5 100644 --- a/intern/cycles/util/util_guarded_allocator.cpp +++ b/intern/cycles/util/util_guarded_allocator.cpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#include "util_guarded_allocator.h" -#include "util_stats.h" +#include "util/util_guarded_allocator.h" +#include "util/util_stats.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_guarded_allocator.h b/intern/cycles/util/util_guarded_allocator.h index c528a0d4f55..5f9dcfb2481 100644 --- a/intern/cycles/util/util_guarded_allocator.h +++ b/intern/cycles/util/util_guarded_allocator.h @@ -20,7 +20,8 @@ #include <cstddef> #include <memory> -#include "util_types.h" +#include "util/util_debug.h" +#include "util/util_types.h" #ifdef WITH_BLENDER_GUARDEDALLOC # include "../../guardedalloc/MEM_guardedalloc.h" diff --git a/intern/cycles/util/util_half.h b/intern/cycles/util/util_half.h index c1a47d58c55..612228dd1c1 100644 --- a/intern/cycles/util/util_half.h +++ b/intern/cycles/util/util_half.h @@ -17,11 +17,11 @@ #ifndef __UTIL_HALF_H__ #define __UTIL_HALF_H__ -#include "util_types.h" -#include "util_math.h" +#include "util/util_types.h" +#include "util/util_math.h" #ifdef __KERNEL_SSE2__ -#include "util_simd.h" +#include "util/util_simd.h" #endif CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_hash.h b/intern/cycles/util/util_hash.h index 98c3a681ff2..a30b7fe288e 100644 --- a/intern/cycles/util/util_hash.h +++ b/intern/cycles/util/util_hash.h @@ -17,7 +17,7 @@ #ifndef __UTIL_HASH_H__ #define __UTIL_HASH_H__ -#include "util_types.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_image.h b/intern/cycles/util/util_image.h index c8efc551d97..18876841b5b 100644 --- a/intern/cycles/util/util_image.h +++ b/intern/cycles/util/util_image.h @@ -21,7 +21,7 @@ #include <OpenImageIO/imageio.h> -#include "util_vector.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN @@ -42,4 +42,4 @@ CCL_NAMESPACE_END #endif /* __UTIL_IMAGE_H__ */ -#include "util_image_impl.h" +#include "util/util_image_impl.h" diff --git a/intern/cycles/util/util_image_impl.h b/intern/cycles/util/util_image_impl.h index 4daf1eaac22..a0f9c66f979 100644 --- a/intern/cycles/util/util_image_impl.h +++ b/intern/cycles/util/util_image_impl.h @@ -17,10 +17,10 @@ #ifndef __UTIL_IMAGE_IMPL_H__ #define __UTIL_IMAGE_IMPL_H__ -#include "util_algorithm.h" -#include "util_debug.h" -#include "util_half.h" -#include "util_image.h" +#include "util/util_algorithm.h" +#include "util/util_debug.h" +#include "util/util_half.h" +#include "util/util_image.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_logging.cpp b/intern/cycles/util/util_logging.cpp index 6824f1ff83c..a5a3bd34fff 100644 --- a/intern/cycles/util/util_logging.cpp +++ b/intern/cycles/util/util_logging.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include <util_logging.h> +#include "util/util_logging.h" -#include "util_math.h" +#include "util/util_math.h" #include <stdio.h> #ifdef _MSC_VER diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index f0f57de498e..6a0fb3500b7 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -35,7 +35,7 @@ #endif -#include "util_types.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_math_cdf.cpp b/intern/cycles/util/util_math_cdf.cpp index ec78ca15d88..c14d4793ea1 100644 --- a/intern/cycles/util/util_math_cdf.cpp +++ b/intern/cycles/util/util_math_cdf.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "util_math_cdf.h" +#include "util/util_math_cdf.h" -#include "util_algorithm.h" -#include "util_math.h" +#include "util/util_algorithm.h" +#include "util/util_math.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_math_cdf.h b/intern/cycles/util/util_math_cdf.h index 47dfb68ba44..79643fe26e3 100644 --- a/intern/cycles/util/util_math_cdf.h +++ b/intern/cycles/util/util_math_cdf.h @@ -17,9 +17,9 @@ #ifndef __UTIL_MATH_CDF_H__ #define __UTIL_MATH_CDF_H__ -#include "util_algorithm.h" -#include "util_math.h" -#include "util_vector.h" +#include "util/util_algorithm.h" +#include "util/util_math.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_math_intersect.h b/intern/cycles/util/util_math_intersect.h index 9e0587e1afb..2b65a0dfa48 100644 --- a/intern/cycles/util/util_math_intersect.h +++ b/intern/cycles/util/util_math_intersect.h @@ -79,216 +79,111 @@ ccl_device bool ray_aligned_disk_intersect( return true; } -/* Optimized watertight ray-triangle intersection. - * - * Sven Woop - * Watertight Ray/Triangle Intersection - * - * http://jcgt.org/published/0002/01/05/paper.pdf - */ - -/* Precalculated data for the ray->tri intersection. */ -typedef struct TriangleIsectPrecalc { - /* Maximal dimension kz, and orthogonal dimensions. */ - int kx, ky, kz; - - /* Shear constants. */ - float Sx, Sy, Sz; -} TriangleIsectPrecalc; - -/* Workaround stupidness of CUDA/OpenCL which doesn't allow to access indexed - * component of float3 value. - */ -#ifdef __KERNEL_GPU__ -# define IDX(vec, idx) \ - ((idx == 0) ? ((vec).x) : ( (idx == 1) ? ((vec).y) : ((vec).z) )) -#else -# define IDX(vec, idx) ((vec)[idx]) -#endif - -#if (defined(__KERNEL_OPENCL_APPLE__)) || \ - (defined(__KERNEL_CUDA__) && (defined(i386) || defined(_M_IX86))) -ccl_device_noinline -#else +#if defined(__KERNEL_CUDA__) && __CUDA_ARCH__ < 300 ccl_device_inline -#endif -void ray_triangle_intersect_precalc(float3 dir, - TriangleIsectPrecalc *isect_precalc) -{ - /* Calculate dimension where the ray direction is maximal. */ -#ifndef __KERNEL_SSE__ - int kz = util_max_axis(make_float3(fabsf(dir.x), - fabsf(dir.y), - fabsf(dir.z))); - int kx = kz + 1; if(kx == 3) kx = 0; - int ky = kx + 1; if(ky == 3) ky = 0; #else - int kx, ky, kz; - /* Avoiding mispredicted branch on direction. */ - kz = util_max_axis(fabs(dir)); - static const char inc_xaxis[] = {1, 2, 0, 55}; - static const char inc_yaxis[] = {2, 0, 1, 55}; - kx = inc_xaxis[kz]; - ky = inc_yaxis[kz]; +ccl_device_forceinline #endif - - float dir_kz = IDX(dir, kz); - - /* Swap kx and ky dimensions to preserve winding direction of triangles. */ - if(dir_kz < 0.0f) { - int tmp = kx; - kx = ky; - ky = tmp; - } - - /* Calculate the shear constants. */ - float inv_dir_z = 1.0f / dir_kz; - isect_precalc->Sx = IDX(dir, kx) * inv_dir_z; - isect_precalc->Sy = IDX(dir, ky) * inv_dir_z; - isect_precalc->Sz = inv_dir_z; - - /* Store the dimensions. */ - isect_precalc->kx = kx; - isect_precalc->ky = ky; - isect_precalc->kz = kz; -} - -ccl_device_forceinline bool ray_triangle_intersect( - const TriangleIsectPrecalc *isect_precalc, - float3 ray_P, float ray_t, -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) +bool ray_triangle_intersect( + float3 ray_P, float3 ray_dir, float ray_t, +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) const ssef *ssef_verts, #else const float3 tri_a, const float3 tri_b, const float3 tri_c, #endif float *isect_u, float *isect_v, float *isect_t) { - const int kx = isect_precalc->kx; - const int ky = isect_precalc->ky; - const int kz = isect_precalc->kz; - const float Sx = isect_precalc->Sx; - const float Sy = isect_precalc->Sy; - const float Sz = isect_precalc->Sz; - -#if defined(__KERNEL_AVX2__) && defined(__KERNEL_SSE__) - const avxf avxf_P(ray_P.m128, ray_P.m128); - const avxf tri_ab(_mm256_loadu_ps((float *)(ssef_verts))); - const avxf tri_bc(_mm256_loadu_ps((float *)(ssef_verts + 1))); - - const avxf AB = tri_ab - avxf_P; - const avxf BC = tri_bc - avxf_P; - - const __m256i permute_mask = _mm256_set_epi32(0x3, kz, ky, kx, 0x3, kz, ky, kx); - - const avxf AB_k = shuffle(AB, permute_mask); - const avxf BC_k = shuffle(BC, permute_mask); - - /* Akz, Akz, Bkz, Bkz, Bkz, Bkz, Ckz, Ckz */ - const avxf ABBC_kz = shuffle<2>(AB_k, BC_k); - - /* Akx, Aky, Bkx, Bky, Bkx,Bky, Ckx, Cky */ - const avxf ABBC_kxy = shuffle<0,1,0,1>(AB_k, BC_k); - - const avxf Sxy(Sy, Sx, Sy, Sx); - - /* Ax, Ay, Bx, By, Bx, By, Cx, Cy */ - const avxf ABBC_xy = nmadd(ABBC_kz, Sxy, ABBC_kxy); - - float ABBC_kz_array[8]; - _mm256_storeu_ps((float*)&ABBC_kz_array, ABBC_kz); - - const float A_kz = ABBC_kz_array[0]; - const float B_kz = ABBC_kz_array[2]; - const float C_kz = ABBC_kz_array[6]; - - /* By, Bx, Cy, Cx, By, Bx, Ay, Ax */ - const avxf BCBA_yx = permute<3,2,7,6,3,2,1,0>(ABBC_xy); - - const avxf neg_mask(0,0,0,0,0x80000000, 0x80000000, 0x80000000, 0x80000000); - - /* W U V - * (AxBy-AyBx) (BxCy-ByCx) XX XX (BxBy-ByBx) (CxAy-CyAx) XX XX - */ - const avxf WUxxxxVxx_neg = _mm256_hsub_ps(ABBC_xy * BCBA_yx, neg_mask /* Dont care */); - - const avxf WUVWnegWUVW = permute<0,1,5,0,0,1,5,0>(WUxxxxVxx_neg) ^ neg_mask; - - /* Calculate scaled barycentric coordinates. */ - float WUVW_array[4]; - _mm_storeu_ps((float*)&WUVW_array, _mm256_castps256_ps128 (WUVWnegWUVW)); - - const float W = WUVW_array[0]; - const float U = WUVW_array[1]; - const float V = WUVW_array[2]; - - const int WUVW_mask = 0x7 & _mm256_movemask_ps(WUVWnegWUVW); - const int WUVW_zero = 0x7 & _mm256_movemask_ps(_mm256_cmp_ps(WUVWnegWUVW, - _mm256_setzero_ps(), 0)); - - if(!((WUVW_mask == 7) || (WUVW_mask == 0)) && ((WUVW_mask | WUVW_zero) != 7)) { - return false; - } +#if defined(__KERNEL_SSE2__) && defined(__KERNEL_SSE__) + typedef ssef float3; + const float3 tri_a(ssef_verts[0]); + const float3 tri_b(ssef_verts[1]); + const float3 tri_c(ssef_verts[2]); + const float3 P(ray_P); + const float3 dir(ray_dir); #else - /* Calculate vertices relative to ray origin. */ - const float3 A = make_float3(tri_a.x - ray_P.x, tri_a.y - ray_P.y, tri_a.z - ray_P.z); - const float3 B = make_float3(tri_b.x - ray_P.x, tri_b.y - ray_P.y, tri_b.z - ray_P.z); - const float3 C = make_float3(tri_c.x - ray_P.x, tri_c.y - ray_P.y, tri_c.z - ray_P.z); - - const float A_kx = IDX(A, kx), A_ky = IDX(A, ky), A_kz = IDX(A, kz); - const float B_kx = IDX(B, kx), B_ky = IDX(B, ky), B_kz = IDX(B, kz); - const float C_kx = IDX(C, kx), C_ky = IDX(C, ky), C_kz = IDX(C, kz); - - /* Perform shear and scale of vertices. */ - const float Ax = A_kx - Sx * A_kz; - const float Ay = A_ky - Sy * A_kz; - const float Bx = B_kx - Sx * B_kz; - const float By = B_ky - Sy * B_kz; - const float Cx = C_kx - Sx * C_kz; - const float Cy = C_ky - Sy * C_kz; +# define dot3(a, b) dot(a, b) + const float3 P = ray_P; + const float3 dir = ray_dir; +#endif - /* Calculate scaled barycentric coordinates. */ - float U = Cx * By - Cy * Bx; - float V = Ax * Cy - Ay * Cx; - float W = Bx * Ay - By * Ax; - if((U < 0.0f || V < 0.0f || W < 0.0f) && - (U > 0.0f || V > 0.0f || W > 0.0f)) - { + /* Calculate vertices relative to ray origin. */ + const float3 v0 = tri_c - P; + const float3 v1 = tri_a - P; + const float3 v2 = tri_b - P; + + /* Calculate triangle edges. */ + const float3 e0 = v2 - v0; + const float3 e1 = v0 - v1; + const float3 e2 = v1 - v2; + + /* Perform edge tests. */ +#ifdef __KERNEL_SSE2__ + const float3 crossU = cross(v2 + v0, e0); + const float3 crossV = cross(v0 + v1, e1); + const float3 crossW = cross(v1 + v2, e2); +# ifndef __KERNEL_SSE__ + const ssef crossX(crossU.x, crossV.x, crossW.x, crossW.x); + const ssef crossY(crossU.y, crossV.y, crossW.y, crossW.y); + const ssef crossZ(crossU.z, crossV.z, crossW.z, crossW.z); +# else + ssef crossX(crossU); + ssef crossY(crossV); + ssef crossZ(crossW); + ssef zero = _mm_setzero_ps(); + _MM_TRANSPOSE4_PS(crossX, crossY, crossZ, zero); +# endif + const ssef dirX(ray_dir.x); + const ssef dirY(ray_dir.y); + const ssef dirZ(ray_dir.z); + /*const*/ ssef UVWW = crossX*dirX + crossY*dirY + crossZ*dirZ; + const float minUVW = reduce_min(UVWW); + const float maxUVW = reduce_max(UVWW); +#else /* __KERNEL_SSE2__ */ + const float U = dot(cross(v2 + v0, e0), ray_dir); + const float V = dot(cross(v0 + v1, e1), ray_dir); + const float W = dot(cross(v1 + v2, e2), ray_dir); + const float minUVW = min(U, min(V, W)); + const float maxUVW = max(U, max(V, W)); +#endif /* __KERNEL_SSE2__ */ + + if(minUVW < 0.0f && maxUVW > 0.0f) { return false; } -#endif - /* Calculate determinant. */ - float det = U + V + W; - if(UNLIKELY(det == 0.0f)) { + /* Calculate geometry normal and denominator. */ + const float3 Ng1 = cross(e1, e0); + //const Vec3vfM Ng1 = stable_triangle_normal(e2,e1,e0); + const float3 Ng = Ng1 + Ng1; + const float den = dot3(Ng, dir); + /* Avoid division by 0. */ + if(UNLIKELY(den == 0.0f)) { return false; } - /* Calculate scaled z-coordinates of vertices and use them to calculate - * the hit distance. - */ - const float T = (U * A_kz + V * B_kz + W * C_kz) * Sz; - const int sign_det = (__float_as_int(det) & 0x80000000); - const float sign_T = xor_signmask(T, sign_det); + /* Perform depth test. */ + const float T = dot3(v0, Ng); + const int sign_den = (__float_as_int(den) & 0x80000000); + const float sign_T = xor_signmask(T, sign_den); if((sign_T < 0.0f) || - (sign_T > ray_t * xor_signmask(det, sign_det))) + (sign_T > ray_t * xor_signmask(den, sign_den))) { return false; } - /* Workaround precision error on CUDA. */ -#ifdef __KERNEL_CUDA__ - if(A == B && B == C) { - return false; - } + const float inv_den = 1.0f / den; +#ifdef __KERNEL_SSE2__ + UVWW *= inv_den; + _mm_store_ss(isect_u, UVWW); + _mm_store_ss(isect_v, shuffle<1,1,3,3>(UVWW)); +#else + *isect_u = U * inv_den; + *isect_v = V * inv_den; #endif - const float inv_det = 1.0f / det; - *isect_u = U * inv_det; - *isect_v = V * inv_det; - *isect_t = T * inv_det; + *isect_t = T * inv_den; return true; -} -#undef IDX +#undef dot3 +} ccl_device bool ray_quad_intersect(float3 ray_P, float3 ray_D, float ray_mint, float ray_maxt, diff --git a/intern/cycles/util/util_md5.h b/intern/cycles/util/util_md5.h index d0af9fdb004..e4cd66c85b0 100644 --- a/intern/cycles/util/util_md5.h +++ b/intern/cycles/util/util_md5.h @@ -30,8 +30,8 @@ #ifndef __UTIL_MD5_H__ #define __UTIL_MD5_H__ -#include "util_string.h" -#include "util_types.h" +#include "util/util_string.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_optimization.h b/intern/cycles/util/util_optimization.h index adc141a7b28..6f70a474fe7 100644 --- a/intern/cycles/util/util_optimization.h +++ b/intern/cycles/util/util_optimization.h @@ -111,7 +111,7 @@ /* MinGW64 has conflicting declarations for these SSE headers in <windows.h>. * Since we can't avoid including <windows.h>, better only include that */ -#include "util_windows.h" +#include "util/util_windows.h" #endif diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index 1b2e8aace5b..5c00b0551d8 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "util_debug.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_string.h" +#include "util/util_debug.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_string.h" #include <OpenImageIO/filesystem.h> #include <OpenImageIO/strutil.h> @@ -45,7 +45,7 @@ OIIO_NAMESPACE_USING # include <shlwapi.h> #endif -#include "util_windows.h" +#include "util/util_windows.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_path.h b/intern/cycles/util/util_path.h index 70dbb5ae403..0e5e2d2c837 100644 --- a/intern/cycles/util/util_path.h +++ b/intern/cycles/util/util_path.h @@ -24,10 +24,10 @@ #include <stdio.h> -#include "util_set.h" -#include "util_string.h" -#include "util_types.h" -#include "util_vector.h" +#include "util/util_set.h" +#include "util/util_string.h" +#include "util/util_types.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_progress.h b/intern/cycles/util/util_progress.h index 14215056840..39c1eed04e7 100644 --- a/intern/cycles/util/util_progress.h +++ b/intern/cycles/util/util_progress.h @@ -23,10 +23,10 @@ * update notifications from a job running in another thread. All methods * except for the constructor/destructor are thread safe. */ -#include "util_function.h" -#include "util_string.h" -#include "util_time.h" -#include "util_thread.h" +#include "util/util_function.h" +#include "util/util_string.h" +#include "util/util_time.h" +#include "util/util_thread.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_simd.cpp b/intern/cycles/util/util_simd.cpp index de2df612578..f90439c188b 100644 --- a/intern/cycles/util/util_simd.cpp +++ b/intern/cycles/util/util_simd.cpp @@ -19,7 +19,7 @@ (defined(WITH_KERNEL_NATIVE) && defined(__SSE2__)) #define __KERNEL_SSE2__ -#include "util_simd.h" +#include "util/util_simd.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_simd.h b/intern/cycles/util/util_simd.h index 35c554c6c7c..545a3399f32 100644 --- a/intern/cycles/util/util_simd.h +++ b/intern/cycles/util/util_simd.h @@ -20,8 +20,8 @@ #include <limits> -#include "util_debug.h" -#include "util_types.h" +#include "util/util_debug.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN @@ -484,11 +484,11 @@ ccl_device_inline int bitscan(int value) CCL_NAMESPACE_END -#include "util_math.h" -#include "util_sseb.h" -#include "util_ssei.h" -#include "util_ssef.h" -#include "util_avxf.h" +#include "util/util_math.h" +#include "util/util_sseb.h" +#include "util/util_ssei.h" +#include "util/util_ssef.h" +#include "util/util_avxf.h" #endif /* __UTIL_SIMD_TYPES_H__ */ diff --git a/intern/cycles/util/util_sky_model.cpp b/intern/cycles/util/util_sky_model.cpp index 5730986cc4f..6dda8469907 100644 --- a/intern/cycles/util/util_sky_model.cpp +++ b/intern/cycles/util/util_sky_model.cpp @@ -97,8 +97,8 @@ All instructions on how to use this code are in the accompanying header file. */ -#include "util_sky_model.h" -#include "util_sky_model_data.h" +#include "util/util_sky_model.h" +#include "util/util_sky_model_data.h" #include <assert.h> #include <stdio.h> diff --git a/intern/cycles/util/util_stack_allocator.h b/intern/cycles/util/util_stack_allocator.h index d7aab5b250c..2f1799a739e 100644 --- a/intern/cycles/util/util_stack_allocator.h +++ b/intern/cycles/util/util_stack_allocator.h @@ -20,8 +20,8 @@ #include <cstddef> #include <memory> -#include "util_debug.h" -#include "util_types.h" +#include "util/util_debug.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_stats.h b/intern/cycles/util/util_stats.h index c21a8488c81..baba549753d 100644 --- a/intern/cycles/util/util_stats.h +++ b/intern/cycles/util/util_stats.h @@ -17,7 +17,7 @@ #ifndef __UTIL_STATS_H__ #define __UTIL_STATS_H__ -#include "util_atomic.h" +#include "util/util_atomic.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_string.cpp b/intern/cycles/util/util_string.cpp index 5594aa8edb6..a1008d510d1 100644 --- a/intern/cycles/util/util_string.cpp +++ b/intern/cycles/util/util_string.cpp @@ -17,9 +17,9 @@ #include <stdarg.h> #include <stdio.h> -#include "util_foreach.h" -#include "util_string.h" -#include "util_windows.h" +#include "util/util_foreach.h" +#include "util/util_string.h" +#include "util/util_windows.h" #ifdef _WIN32 # ifndef vsnprintf diff --git a/intern/cycles/util/util_string.h b/intern/cycles/util/util_string.h index 7aeed96f00b..e2c105db9c1 100644 --- a/intern/cycles/util/util_string.h +++ b/intern/cycles/util/util_string.h @@ -21,7 +21,7 @@ #include <string> #include <sstream> -#include "util_vector.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp index 87d885c44cf..a942d738b8a 100644 --- a/intern/cycles/util/util_system.cpp +++ b/intern/cycles/util/util_system.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "util_system.h" +#include "util/util_system.h" -#include "util_debug.h" -#include "util_logging.h" -#include "util_types.h" -#include "util_string.h" +#include "util/util_debug.h" +#include "util/util_logging.h" +#include "util/util_types.h" +#include "util/util_string.h" #ifdef _WIN32 # if(!defined(FREE_WINDOWS)) diff --git a/intern/cycles/util/util_system.h b/intern/cycles/util/util_system.h index ff61b260bed..db7a45b2d59 100644 --- a/intern/cycles/util/util_system.h +++ b/intern/cycles/util/util_system.h @@ -17,7 +17,7 @@ #ifndef __UTIL_SYSTEM_H__ #define __UTIL_SYSTEM_H__ -#include "util_string.h" +#include "util/util_string.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_task.cpp b/intern/cycles/util/util_task.cpp index 0d1fed3ebbf..fb0c34e1dc4 100644 --- a/intern/cycles/util/util_task.cpp +++ b/intern/cycles/util/util_task.cpp @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "util_debug.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_system.h" -#include "util_task.h" -#include "util_time.h" +#include "util/util_debug.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_system.h" +#include "util/util_task.h" +#include "util/util_time.h" //#define THREADING_DEBUG_ENABLED diff --git a/intern/cycles/util/util_task.h b/intern/cycles/util/util_task.h index 0b82f14f66f..3ebfb007e40 100644 --- a/intern/cycles/util/util_task.h +++ b/intern/cycles/util/util_task.h @@ -17,10 +17,10 @@ #ifndef __UTIL_TASK_H__ #define __UTIL_TASK_H__ -#include "util_list.h" -#include "util_string.h" -#include "util_thread.h" -#include "util_vector.h" +#include "util/util_list.h" +#include "util/util_string.h" +#include "util/util_thread.h" +#include "util/util_vector.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_thread.cpp b/intern/cycles/util/util_thread.cpp index 3db8b4bd197..3dcb09804b0 100644 --- a/intern/cycles/util/util_thread.cpp +++ b/intern/cycles/util/util_thread.cpp @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "util_thread.h" +#include "util/util_thread.h" -#include "util_system.h" -#include "util_windows.h" +#include "util/util_system.h" +#include "util/util_windows.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h index 427c633d2ce..1b4e87ebf03 100644 --- a/intern/cycles/util/util_thread.h +++ b/intern/cycles/util/util_thread.h @@ -32,7 +32,7 @@ # include <libkern/OSAtomic.h> #endif -#include "util_function.h" +#include "util/util_function.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_time.cpp b/intern/cycles/util/util_time.cpp index 59c963cfafb..7c39aa294bf 100644 --- a/intern/cycles/util/util_time.cpp +++ b/intern/cycles/util/util_time.cpp @@ -16,8 +16,8 @@ #include <stdlib.h> -#include "util_time.h" -#include "util_windows.h" +#include "util/util_time.h" +#include "util/util_windows.h" #ifdef _WIN32 diff --git a/intern/cycles/util/util_transform.cpp b/intern/cycles/util/util_transform.cpp index 2f10540c94e..b8f182ae962 100644 --- a/intern/cycles/util/util_transform.cpp +++ b/intern/cycles/util/util_transform.cpp @@ -46,10 +46,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "util_transform.h" +#include "util/util_transform.h" -#include "util_boundbox.h" -#include "util_math.h" +#include "util/util_boundbox.h" +#include "util/util_math.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index a0695f20488..aef168ca64d 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -21,8 +21,8 @@ #include <string.h> #endif -#include "util_math.h" -#include "util_types.h" +#include "util/util_math.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_types.h b/intern/cycles/util/util_types.h index 927c6d579d3..d445a979e6e 100644 --- a/intern/cycles/util/util_types.h +++ b/intern/cycles/util/util_types.h @@ -85,7 +85,7 @@ /* SIMD Types */ -#include "util_optimization.h" +#include "util/util_optimization.h" #endif @@ -180,7 +180,7 @@ struct ccl_try_align(16) int3 { }; __forceinline int3() {} - __forceinline int3(const __m128i a) : m128(a) {} + __forceinline int3(const __m128i& a) : m128(a) {} __forceinline operator const __m128i&(void) const { return m128; } __forceinline operator __m128i&(void) { return m128; } @@ -202,7 +202,7 @@ struct ccl_try_align(16) int4 { }; __forceinline int4() {} - __forceinline int4(const __m128i a) : m128(a) {} + __forceinline int4(const __m128i& a) : m128(a) {} __forceinline operator const __m128i&(void) const { return m128; } __forceinline operator __m128i&(void) { return m128; } @@ -274,7 +274,7 @@ struct ccl_try_align(16) float4 { }; __forceinline float4() {} - __forceinline float4(const __m128 a) : m128(a) {} + __forceinline float4(const __m128& a) : m128(a) {} __forceinline operator const __m128&(void) const { return m128; } __forceinline operator __m128&(void) { return m128; } diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h index 546b17570bb..4add91a3368 100644 --- a/intern/cycles/util/util_vector.h +++ b/intern/cycles/util/util_vector.h @@ -23,9 +23,9 @@ #include <cstring> #include <vector> -#include "util_aligned_malloc.h" -#include "util_guarded_allocator.h" -#include "util_types.h" +#include "util/util_aligned_malloc.h" +#include "util/util_guarded_allocator.h" +#include "util/util_types.h" CCL_NAMESPACE_BEGIN diff --git a/intern/cycles/util/util_view.cpp b/intern/cycles/util/util_view.cpp index 9796a5f896d..10d86167921 100644 --- a/intern/cycles/util/util_view.cpp +++ b/intern/cycles/util/util_view.cpp @@ -17,11 +17,11 @@ #include <stdio.h> #include <stdlib.h> -#include "util_opengl.h" -#include "util_string.h" -#include "util_time.h" -#include "util_version.h" -#include "util_view.h" +#include "util/util_opengl.h" +#include "util/util_string.h" +#include "util/util_time.h" +#include "util/util_version.h" +#include "util/util_view.h" #ifdef __APPLE__ #include <GLUT/glut.h> diff --git a/intern/cycles/util/util_windows.cpp b/intern/cycles/util/util_windows.cpp index 4de8483564b..073db2a27db 100644 --- a/intern/cycles/util/util_windows.cpp +++ b/intern/cycles/util/util_windows.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "util_windows.h" +#include "util/util_windows.h" #ifdef _WIN32 diff --git a/release/scripts/modules/bl_app_override/__init__.py b/release/scripts/modules/bl_app_override/__init__.py index 66857701669..89cc8a0eb28 100644 --- a/release/scripts/modules/bl_app_override/__init__.py +++ b/release/scripts/modules/bl_app_override/__init__.py @@ -147,10 +147,12 @@ def ui_draw_filter_register( return super().operator(*args, **kw) def draw_override(func_orig, self_real, context): - # simple, no wrapping - # return func_orig(self_wrap, context) + cls_real = self_real.__class__ + if cls_real is super: + # simple, no wrapping + return func_orig(self_real, context) - class Wrapper(self_real.__class__): + class Wrapper(cls_real): __slots__ = () def __getattribute__(self, attr): if attr == "layout": diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 26fdbc8cc56..545b891505f 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -48,11 +48,11 @@ def main(): import sys # Possibly temp. addons path - from os.path import join, dirname, normpath - sys.path.append(normpath(join(dirname(__file__), - "..", "..", "addons", "modules"))) - sys.path.append(join(utils.user_resource('SCRIPTS'), - "addons", "modules")) + from os.path import join, dirname + sys.path.extend([ + join(dirname(dirname(dirname(__file__))), "addons", "modules"), + join(utils.user_resource('SCRIPTS'), "addons", "modules"), + ]) # fake module to allow: # from bpy.types import Panel diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py index c28c1461003..1e0dbe6925e 100644 --- a/release/scripts/startup/bl_operators/__init__.py +++ b/release/scripts/startup/bl_operators/__init__.py @@ -21,8 +21,7 @@ # support reloading sub-modules if "bpy" in locals(): from importlib import reload - for val in _modules_loaded: - reload(val) + _modules_loaded[:] = [reload(val) for val in _modules_loaded] del reload _modules = [ @@ -73,4 +72,5 @@ def unregister(): from bpy.utils import unregister_class for mod in reversed(_modules_loaded): for cls in reversed(mod.classes): - unregister_class(cls) + if cls.is_registered: + unregister_class(cls) diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 3e81724c1f9..5b609605cee 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -23,8 +23,7 @@ # support reloading sub-modules if "bpy" in locals(): from importlib import reload - for val in _modules_loaded: - reload(val) + _modules_loaded[:] = [reload(val) for val in _modules_loaded] del reload _modules = [ @@ -149,7 +148,8 @@ def unregister(): from bpy.utils import unregister_class for mod in reversed(_modules_loaded): for cls in reversed(mod.classes): - unregister_class(cls) + if cls.is_registered: + unregister_class(cls) # Define a default UIList, when a list does not need any custom drawing... # Keep in sync with its #defined name in UI_interface.h diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index a098953699e..a37d61dd0af 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -569,6 +569,14 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "use_mirror_u", text="U") col.prop(md, "use_mirror_v", text="V") + col = layout.column(align=True) + + if md.use_mirror_u: + col.prop(md, "mirror_offset_u") + + if md.use_mirror_v: + col.prop(md, "mirror_offset_v") + col = layout.column() if md.use_mirror_merge is True: diff --git a/source/blender/blenkernel/BKE_blendfile.h b/source/blender/blenkernel/BKE_blendfile.h index 75978120051..ac58451e412 100644 --- a/source/blender/blenkernel/BKE_blendfile.h +++ b/source/blender/blenkernel/BKE_blendfile.h @@ -50,6 +50,7 @@ bool BKE_blendfile_read_from_memory( bool BKE_blendfile_read_from_memfile( struct bContext *C, struct MemFile *memfile, struct ReportList *reports, int skip_flag); +void BKE_blendfile_read_make_empty(struct bContext *C); struct UserDef *BKE_blendfile_userdef_read( const char *filepath, struct ReportList *reports); diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 6bcd3c8fb65..a521d671ea4 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -426,6 +426,32 @@ bool BKE_blendfile_read_from_memfile( return (bfd != NULL); } +/** + * Utility to make a file 'empty' used for startup to optionally give an empty file. + * Handy for tests. + */ +void BKE_blendfile_read_make_empty(bContext *C) +{ + Main *bmain = CTX_data_main(C); + + ListBase *lbarray[MAX_LIBARRAY]; + ID *id; + int a; + + a = set_listbasepointers(bmain, lbarray); + while (a--) { + id = lbarray[a]->first; + if (id != NULL) { + if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM)) { + continue; + } + while ((id = lbarray[a]->first)) { + BKE_libblock_delete(bmain, id); + } + } + } +} + /* only read the userdef from a .blend */ UserDef *BKE_blendfile_userdef_read(const char *filepath, ReportList *reports) { diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index b2641b110f8..a596869e5e8 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -130,18 +130,22 @@ void IDP_FreeIDPArray(IDProperty *prop) MEM_freeN(prop->data.pointer); } -/*shallow copies item*/ +/* shallow copies item */ void IDP_SetIndexArray(IDProperty *prop, int index, IDProperty *item) { IDProperty *old; BLI_assert(prop->type == IDP_IDPARRAY); + if (index >= prop->len || index < 0) + return; + old = GETPROP(prop, index); - if (index >= prop->len || index < 0) return; - if (item != old) IDP_FreeProperty(old); - - memcpy(GETPROP(prop, index), item, sizeof(IDProperty)); + if (item != old) { + IDP_FreeProperty(old); + + memcpy(old, item, sizeof(IDProperty)); + } } IDProperty *IDP_GetIndexArray(IDProperty *prop, int index) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0aa53dbe633..09c88ac945a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2192,19 +2192,19 @@ static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap) /* library brush linking after fileread */ static void lib_link_brush(FileData *fd, Main *main) { - Brush *brush; - /* only link ID pointers */ - for (brush = main->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = main->brush.first; brush; brush = brush->id.next) { if (brush->id.tag & LIB_TAG_NEED_LINK) { - brush->id.tag &= ~LIB_TAG_NEED_LINK; - + IDP_LibLinkProperty(brush->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + /* brush->(mask_)mtex.obj is ignored on purpose? */ brush->mtex.tex = newlibadr_us(fd, brush->id.lib, brush->mtex.tex); brush->mask_mtex.tex = newlibadr_us(fd, brush->id.lib, brush->mask_mtex.tex); brush->clone.image = newlibadr(fd, brush->id.lib, brush->clone.image); brush->toggle_brush = newlibadr(fd, brush->id.lib, brush->toggle_brush); brush->paint_curve = newlibadr_us(fd, brush->id.lib, brush->paint_curve); + + brush->id.tag &= ~LIB_TAG_NEED_LINK; } } } @@ -2227,13 +2227,13 @@ static void direct_link_brush(FileData *fd, Brush *brush) } /* ************ READ Palette *************** */ -static void lib_link_palette(FileData *UNUSED(fd), Main *main) +static void lib_link_palette(FileData *fd, Main *main) { - Palette *palette; - /* only link ID pointers */ - for (palette = main->palettes.first; palette; palette = palette->id.next) { + for (Palette *palette = main->palettes.first; palette; palette = palette->id.next) { if (palette->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(palette->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + palette->id.tag &= ~LIB_TAG_NEED_LINK; } } @@ -2245,13 +2245,13 @@ static void direct_link_palette(FileData *fd, Palette *palette) link_list(fd, &palette->colors); } -static void lib_link_paint_curve(FileData *UNUSED(fd), Main *main) +static void lib_link_paint_curve(FileData *fd, Main *main) { - PaintCurve *pc; - /* only link ID pointers */ - for (pc = main->paintcurves.first; pc; pc = pc->id.next) { + for (PaintCurve *pc = main->paintcurves.first; pc; pc = pc->id.next) { if (pc->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(pc->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + pc->id.tag &= ~LIB_TAG_NEED_LINK; } } @@ -2503,15 +2503,12 @@ static void direct_link_fcurves(FileData *fd, ListBase *list) static void lib_link_action(FileData *fd, Main *main) { - bAction *act; - bActionChannel *chan; - - for (act = main->action.first; act; act = act->id.next) { + for (bAction *act = main->action.first; act; act = act->id.next) { if (act->id.tag & LIB_TAG_NEED_LINK) { - act->id.tag &= ~LIB_TAG_NEED_LINK; + IDP_LibLinkProperty(act->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); // XXX deprecated - old animation system <<< - for (chan=act->chanbase.first; chan; chan=chan->next) { + for (bActionChannel *chan = act->chanbase.first; chan; chan = chan->next) { chan->ipo = newlibadr_us(fd, act->id.lib, chan->ipo); lib_link_constraint_channels(fd, &act->id, &chan->constraintChannels); } @@ -2524,6 +2521,8 @@ static void lib_link_action(FileData *fd, Main *main) marker->camera = newlibadr(fd, act->id.lib, marker->camera); } } + + act->id.tag &= ~LIB_TAG_NEED_LINK; } } } @@ -2710,26 +2709,20 @@ static void direct_link_animdata(FileData *fd, AnimData *adt) static void lib_link_cachefiles(FileData *fd, Main *bmain) { - CacheFile *cache_file; - /* only link ID pointers */ - for (cache_file = bmain->cachefiles.first; cache_file; cache_file = cache_file->id.next) { + for (CacheFile *cache_file = bmain->cachefiles.first; cache_file; cache_file = cache_file->id.next) { if (cache_file->id.tag & LIB_TAG_NEED_LINK) { - cache_file->id.tag &= ~LIB_TAG_NEED_LINK; - } - - BLI_listbase_clear(&cache_file->object_paths); - cache_file->handle = NULL; - cache_file->handle_mutex = NULL; - - if (cache_file->adt) { + IDP_LibLinkProperty(cache_file->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &cache_file->id, cache_file->adt); + + cache_file->id.tag &= ~LIB_TAG_NEED_LINK; } } } static void direct_link_cachefile(FileData *fd, CacheFile *cache_file) { + BLI_listbase_clear(&cache_file->object_paths); cache_file->handle = NULL; cache_file->handle_mutex = NULL; @@ -2766,6 +2759,7 @@ static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree) bNode *node; bNodeSocket *sock; + IDP_LibLinkProperty(ntree->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &ntree->id, ntree->adt); ntree->gpd = newlibadr_us(fd, id->lib, ntree->gpd); @@ -2775,30 +2769,37 @@ static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree) * of library blocks that implement this.*/ IDP_LibLinkProperty(node->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); - node->id= newlibadr_us(fd, id->lib, node->id); + node->id = newlibadr_us(fd, id->lib, node->id); - for (sock = node->inputs.first; sock; sock = sock->next) + for (sock = node->inputs.first; sock; sock = sock->next) { + IDP_LibLinkProperty(sock->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_node_socket(fd, id, sock); - for (sock = node->outputs.first; sock; sock = sock->next) + } + for (sock = node->outputs.first; sock; sock = sock->next) { + IDP_LibLinkProperty(sock->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_node_socket(fd, id, sock); + } } - for (sock = ntree->inputs.first; sock; sock = sock->next) + for (sock = ntree->inputs.first; sock; sock = sock->next) { + IDP_LibLinkProperty(sock->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_node_socket(fd, id, sock); - for (sock = ntree->outputs.first; sock; sock = sock->next) + } + for (sock = ntree->outputs.first; sock; sock = sock->next) { + IDP_LibLinkProperty(sock->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_node_socket(fd, id, sock); + } } /* library ntree linking after fileread */ static void lib_link_nodetree(FileData *fd, Main *main) { - bNodeTree *ntree; - /* only link ID pointers */ - for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { + for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { if (ntree->id.tag & LIB_TAG_NEED_LINK) { - ntree->id.tag &= ~LIB_TAG_NEED_LINK; lib_link_ntree(fd, &ntree->id, ntree); + + ntree->id.tag &= ~LIB_TAG_NEED_LINK; } } } @@ -3313,11 +3314,11 @@ static void lib_link_pose(FileData *fd, Main *bmain, Object *ob, bPose *pose) static void lib_link_armature(FileData *fd, Main *main) { - bArmature *arm; - - for (arm = main->armature.first; arm; arm = arm->id.next) { + for (bArmature *arm = main->armature.first; arm; arm = arm->id.next) { if (arm->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(arm->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &arm->id, arm->adt); + arm->id.tag &= ~LIB_TAG_NEED_LINK; } } @@ -3362,14 +3363,13 @@ static void direct_link_armature(FileData *fd, bArmature *arm) static void lib_link_camera(FileData *fd, Main *main) { - Camera *ca; - - for (ca = main->camera.first; ca; ca = ca->id.next) { + for (Camera *ca = main->camera.first; ca; ca = ca->id.next) { if (ca->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(ca->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &ca->id, ca->adt); ca->ipo = newlibadr_us(fd, ca->id.lib, ca->ipo); // XXX deprecated - old animation system - + ca->dof_ob = newlibadr(fd, ca->id.lib, ca->dof_ob); ca->id.tag &= ~LIB_TAG_NEED_LINK; @@ -3388,16 +3388,13 @@ static void direct_link_camera(FileData *fd, Camera *ca) static void lib_link_lamp(FileData *fd, Main *main) { - Lamp *la; - MTex *mtex; - int a; - - for (la = main->lamp.first; la; la = la->id.next) { + for (Lamp *la = main->lamp.first; la; la = la->id.next) { if (la->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(la->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &la->id, la->adt); - for (a = 0; a < MAX_MTEX; a++) { - mtex = la->mtex[a]; + for (int a = 0; a < MAX_MTEX; a++) { + MTex *mtex = la->mtex[a]; if (mtex) { mtex->tex = newlibadr_us(fd, la->id.lib, mtex->tex); mtex->object = newlibadr(fd, la->id.lib, mtex->object); @@ -3454,17 +3451,11 @@ void blo_do_versions_key_uidgen(Key *key) static void lib_link_key(FileData *fd, Main *main) { - Key *key; - - for (key = main->key.first; key; key = key->id.next) { - /*check if we need to generate unique ids for the shapekeys*/ - if (!key->uidgen) { - blo_do_versions_key_uidgen(key); - } - + for (Key *key = main->key.first; key; key = key->id.next) { BLI_assert((key->id.tag & LIB_TAG_EXTERN) == 0); if (key->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(key->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &key->id, key->adt); key->ipo = newlibadr_us(fd, key->id.lib, key->ipo); // XXX deprecated - old animation system @@ -3527,15 +3518,14 @@ static void direct_link_key(FileData *fd, Key *key) static void lib_link_mball(FileData *fd, Main *main) { - MetaBall *mb; - int a; - - for (mb = main->mball.first; mb; mb = mb->id.next) { + for (MetaBall *mb = main->mball.first; mb; mb = mb->id.next) { if (mb->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(mb->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &mb->id, mb->adt); - for (a = 0; a < mb->totcol; a++) + for (int a = 0; a < mb->totcol; a++) { mb->mat[a] = newlibadr_us(fd, mb->id.lib, mb->mat[a]); + } mb->ipo = newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX deprecated - old animation system @@ -3564,18 +3554,15 @@ static void direct_link_mball(FileData *fd, MetaBall *mb) static void lib_link_world(FileData *fd, Main *main) { - World *wrld; - MTex *mtex; - int a; - - for (wrld = main->world.first; wrld; wrld = wrld->id.next) { + for (World *wrld = main->world.first; wrld; wrld = wrld->id.next) { if (wrld->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(wrld->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &wrld->id, wrld->adt); wrld->ipo = newlibadr_us(fd, wrld->id.lib, wrld->ipo); // XXX deprecated - old animation system - for (a=0; a < MAX_MTEX; a++) { - mtex = wrld->mtex[a]; + for (int a = 0; a < MAX_MTEX; a++) { + MTex *mtex = wrld->mtex[a]; if (mtex) { mtex->tex = newlibadr_us(fd, wrld->id.lib, mtex->tex); mtex->object = newlibadr(fd, wrld->id.lib, mtex->object); @@ -3616,12 +3603,12 @@ static void direct_link_world(FileData *fd, World *wrld) /* ************ READ VFONT ***************** */ -static void lib_link_vfont(FileData *UNUSED(fd), Main *main) +static void lib_link_vfont(FileData *fd, Main *main) { - VFont *vf; - - for (vf = main->vfont.first; vf; vf = vf->id.next) { + for (VFont *vf = main->vfont.first; vf; vf = vf->id.next) { if (vf->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(vf->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + vf->id.tag &= ~LIB_TAG_NEED_LINK; } } @@ -3636,12 +3623,12 @@ static void direct_link_vfont(FileData *fd, VFont *vf) /* ************ READ TEXT ****************** */ -static void lib_link_text(FileData *UNUSED(fd), Main *main) +static void lib_link_text(FileData *fd, Main *main) { - Text *text; - - for (text = main->text.first; text; text = text->id.next) { + for (Text *text = main->text.first; text; text = text->id.next) { if (text->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(text->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + text->id.tag &= ~LIB_TAG_NEED_LINK; } } @@ -3690,9 +3677,7 @@ static void direct_link_text(FileData *fd, Text *text) static void lib_link_image(FileData *fd, Main *main) { - Image *ima; - - for (ima = main->image.first; ima; ima = ima->id.next) { + for (Image *ima = main->image.first; ima; ima = ima->id.next) { if (ima->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(ima->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); @@ -3759,15 +3744,14 @@ static void direct_link_image(FileData *fd, Image *ima) static void lib_link_curve(FileData *fd, Main *main) { - Curve *cu; - int a; - - for (cu = main->curve.first; cu; cu = cu->id.next) { + for (Curve *cu = main->curve.first; cu; cu = cu->id.next) { if (cu->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(cu->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &cu->id, cu->adt); - for (a = 0; a < cu->totcol; a++) + for (int a = 0; a < cu->totcol; a++) { cu->mat[a] = newlibadr_us(fd, cu->id.lib, cu->mat[a]); + } cu->bevobj = newlibadr(fd, cu->id.lib, cu->bevobj); cu->taperobj = newlibadr(fd, cu->id.lib, cu->taperobj); @@ -3852,10 +3836,9 @@ static void direct_link_curve(FileData *fd, Curve *cu) static void lib_link_texture(FileData *fd, Main *main) { - Tex *tex; - - for (tex = main->tex.first; tex; tex = tex->id.next) { + for (Tex *tex = main->tex.first; tex; tex = tex->id.next) { if (tex->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(tex->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &tex->id, tex->adt); tex->ima = newlibadr_us(fd, tex->id.lib, tex->ima); @@ -3931,12 +3914,9 @@ static void direct_link_texture(FileData *fd, Tex *tex) static void lib_link_material(FileData *fd, Main *main) { - Material *ma; - MTex *mtex; - int a; - - for (ma = main->mat.first; ma; ma = ma->id.next) { + for (Material *ma = main->mat.first; ma; ma = ma->id.next) { if (ma->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(ma->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &ma->id, ma->adt); /* Link ID Properties -- and copy this comment EXACTLY for easy finding @@ -3946,8 +3926,8 @@ static void lib_link_material(FileData *fd, Main *main) ma->ipo = newlibadr_us(fd, ma->id.lib, ma->ipo); // XXX deprecated - old animation system ma->group = newlibadr_us(fd, ma->id.lib, ma->group); - for (a = 0; a < MAX_MTEX; a++) { - mtex = ma->mtex[a]; + for (int a = 0; a < MAX_MTEX; a++) { + MTex *mtex = ma->mtex[a]; if (mtex) { mtex->tex = newlibadr_us(fd, ma->id.lib, mtex->tex); mtex->object = newlibadr(fd, ma->id.lib, mtex->object); @@ -4078,14 +4058,11 @@ static void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd) static void lib_link_particlesettings(FileData *fd, Main *main) { - ParticleSettings *part; - ParticleDupliWeight *dw; - MTex *mtex; - int a; - - for (part = main->particle.first; part; part = part->id.next) { + for (ParticleSettings *part = main->particle.first; part; part = part->id.next) { if (part->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(part->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &part->id, part->adt); + part->ipo = newlibadr_us(fd, part->id.lib, part->ipo); // XXX deprecated - old animation system part->dup_ob = newlibadr(fd, part->id.lib, part->dup_ob); @@ -4105,6 +4082,7 @@ static void lib_link_particlesettings(FileData *fd, Main *main) } if (part->dupliweights.first && part->dup_group) { + ParticleDupliWeight *dw; int index_ok = 0; /* check for old files without indices (all indexes 0) */ if (BLI_listbase_is_single(&part->dupliweights)) { @@ -4169,8 +4147,8 @@ static void lib_link_particlesettings(FileData *fd, Main *main) } } - for (a = 0; a < MAX_MTEX; a++) { - mtex= part->mtex[a]; + for (int a = 0; a < MAX_MTEX; a++) { + MTex *mtex= part->mtex[a]; if (mtex) { mtex->tex = newlibadr_us(fd, part->id.lib, mtex->tex); mtex->object = newlibadr(fd, part->id.lib, mtex->object); @@ -4677,10 +4655,9 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) static void lib_link_latt(FileData *fd, Main *main) { - Lattice *lt; - - for (lt = main->latt.first; lt; lt = lt->id.next) { + for (Lattice *lt = main->latt.first; lt; lt = lt->id.next) { if (lt->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(lt->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, <->id, lt->adt); lt->ipo = newlibadr_us(fd, lt->id.lib, lt->ipo); // XXX deprecated - old animation system @@ -4724,16 +4701,12 @@ static void lib_link_modifiers(FileData *fd, Object *ob) static void lib_link_object(FileData *fd, Main *main) { - Object *ob; - PartEff *paf; - bSensor *sens; - bController *cont; - bActuator *act; - void *poin; - int warn=0, a; - - for (ob = main->object.first; ob; ob = ob->id.next) { + bool warn = false; + + for (Object *ob = main->object.first; ob; ob = ob->id.next) { if (ob->id.tag & LIB_TAG_NEED_LINK) { + int a; + IDP_LibLinkProperty(ob->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &ob->id, ob->adt); @@ -4766,17 +4739,17 @@ static void lib_link_object(FileData *fd, Main *main) } ob->proxy_group = newlibadr(fd, ob->id.lib, ob->proxy_group); - poin = ob->data; + void *poin = ob->data; ob->data = newlibadr_us(fd, ob->id.lib, ob->data); - if (ob->data==NULL && poin!=NULL) { + if (ob->data == NULL && poin != NULL) { if (ob->id.lib) printf("Can't find obdata of %s lib %s\n", ob->id.name + 2, ob->id.lib->name); else printf("Object %s lost data.\n", ob->id.name + 2); ob->type = OB_EMPTY; - warn = 1; + warn = true; if (ob->pose) { /* we can't call #BKE_pose_free() here because of library linking @@ -4822,13 +4795,13 @@ static void lib_link_object(FileData *fd, Main *main) lib_link_nlastrips(fd, &ob->id, &ob->nlastrips); // >>> XXX deprecated - old animation system - for (paf = ob->effect.first; paf; paf = paf->next) { + for (PartEff *paf = ob->effect.first; paf; paf = paf->next) { if (paf->type == EFF_PARTICLE) { paf->group = newlibadr_us(fd, ob->id.lib, paf->group); } } - for (sens = ob->sensors.first; sens; sens = sens->next) { + for (bSensor *sens = ob->sensors.first; sens; sens = sens->next) { for (a = 0; a < sens->totlinks; a++) sens->links[a] = newglobadr(fd, sens->links[a]); @@ -4839,7 +4812,7 @@ static void lib_link_object(FileData *fd, Main *main) } } - for (cont = ob->controllers.first; cont; cont = cont->next) { + for (bController *cont = ob->controllers.first; cont; cont = cont->next) { for (a=0; a < cont->totlinks; a++) cont->links[a] = newglobadr(fd, cont->links[a]); @@ -4851,86 +4824,117 @@ static void lib_link_object(FileData *fd, Main *main) cont->totslinks = 0; } - for (act = ob->actuators.first; act; act = act->next) { - if (act->type == ACT_SOUND) { - bSoundActuator *sa = act->data; - sa->sound= newlibadr_us(fd, ob->id.lib, sa->sound); - } - else if (act->type == ACT_GAME) { - /* bGameActuator *ga= act->data; */ - } - else if (act->type == ACT_CAMERA) { - bCameraActuator *ca = act->data; - ca->ob= newlibadr(fd, ob->id.lib, ca->ob); - } - /* leave this one, it's obsolete but necessary to read for conversion */ - else if (act->type == ACT_ADD_OBJECT) { - bAddObjectActuator *eoa = act->data; - if (eoa) eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob); - } - else if (act->type == ACT_OBJECT) { - bObjectActuator *oa = act->data; - if (oa == NULL) { - init_actuator(act); + for (bActuator *act = ob->actuators.first; act; act = act->next) { + switch (act->type) { + case ACT_SOUND: + { + bSoundActuator *sa = act->data; + sa->sound = newlibadr_us(fd, ob->id.lib, sa->sound); + break; } - else { - oa->reference = newlibadr(fd, ob->id.lib, oa->reference); + case ACT_GAME: + /* bGameActuator *ga= act->data; */ + break; + case ACT_CAMERA: + { + bCameraActuator *ca = act->data; + ca->ob = newlibadr(fd, ob->id.lib, ca->ob); + break; } - } - else if (act->type == ACT_EDIT_OBJECT) { - bEditObjectActuator *eoa = act->data; - if (eoa == NULL) { - init_actuator(act); + /* leave this one, it's obsolete but necessary to read for conversion */ + case ACT_ADD_OBJECT: + { + bAddObjectActuator *eoa = act->data; + if (eoa) + eoa->ob = newlibadr(fd, ob->id.lib, eoa->ob); + break; } - else { - eoa->ob= newlibadr(fd, ob->id.lib, eoa->ob); - eoa->me= newlibadr(fd, ob->id.lib, eoa->me); + case ACT_OBJECT: + { + bObjectActuator *oa = act->data; + if (oa == NULL) { + init_actuator(act); + } + else { + oa->reference = newlibadr(fd, ob->id.lib, oa->reference); + } + break; } - } - else if (act->type == ACT_SCENE) { - bSceneActuator *sa = act->data; - sa->camera= newlibadr(fd, ob->id.lib, sa->camera); - sa->scene= newlibadr(fd, ob->id.lib, sa->scene); - } - else if (act->type == ACT_ACTION) { - bActionActuator *aa = act->data; - aa->act= newlibadr_us(fd, ob->id.lib, aa->act); - } - else if (act->type == ACT_SHAPEACTION) { - bActionActuator *aa = act->data; - aa->act= newlibadr_us(fd, ob->id.lib, aa->act); - } - else if (act->type == ACT_PROPERTY) { - bPropertyActuator *pa = act->data; - pa->ob= newlibadr(fd, ob->id.lib, pa->ob); - } - else if (act->type == ACT_MESSAGE) { - bMessageActuator *ma = act->data; - ma->toObject= newlibadr(fd, ob->id.lib, ma->toObject); - } - else if (act->type == ACT_2DFILTER) { - bTwoDFilterActuator *_2dfa = act->data; - _2dfa->text= newlibadr(fd, ob->id.lib, _2dfa->text); - } - else if (act->type == ACT_PARENT) { - bParentActuator *parenta = act->data; - parenta->ob = newlibadr(fd, ob->id.lib, parenta->ob); - } - else if (act->type == ACT_STATE) { - /* bStateActuator *statea = act->data; */ - } - else if (act->type == ACT_ARMATURE) { - bArmatureActuator *arma= act->data; - arma->target= newlibadr(fd, ob->id.lib, arma->target); - arma->subtarget= newlibadr(fd, ob->id.lib, arma->subtarget); - } - else if (act->type == ACT_STEERING) { - bSteeringActuator *steeringa = act->data; - steeringa->target = newlibadr(fd, ob->id.lib, steeringa->target); - steeringa->navmesh = newlibadr(fd, ob->id.lib, steeringa->navmesh); - } - else if (act->type == ACT_MOUSE) { - /* bMouseActuator *moa= act->data; */ + case ACT_EDIT_OBJECT: + { + bEditObjectActuator *eoa = act->data; + if (eoa == NULL) { + init_actuator(act); + } + else { + eoa->ob = newlibadr(fd, ob->id.lib, eoa->ob); + eoa->me = newlibadr(fd, ob->id.lib, eoa->me); + } + break; + } + case ACT_SCENE: + { + bSceneActuator *sa = act->data; + sa->camera = newlibadr(fd, ob->id.lib, sa->camera); + sa->scene = newlibadr(fd, ob->id.lib, sa->scene); + break; + } + case ACT_ACTION: + { + bActionActuator *aa = act->data; + aa->act = newlibadr_us(fd, ob->id.lib, aa->act); + break; + } + case ACT_SHAPEACTION: + { + bActionActuator *aa = act->data; + aa->act = newlibadr_us(fd, ob->id.lib, aa->act); + break; + } + case ACT_PROPERTY: + { + bPropertyActuator *pa = act->data; + pa->ob = newlibadr(fd, ob->id.lib, pa->ob); + break; + } + case ACT_MESSAGE: + { + bMessageActuator *ma = act->data; + ma->toObject = newlibadr(fd, ob->id.lib, ma->toObject); + break; + } + case ACT_2DFILTER: + { + bTwoDFilterActuator *_2dfa = act->data; + _2dfa->text = newlibadr(fd, ob->id.lib, _2dfa->text); + break; + } + case ACT_PARENT: + { + bParentActuator *parenta = act->data; + parenta->ob = newlibadr(fd, ob->id.lib, parenta->ob); + break; + } + case ACT_STATE: + /* bStateActuator *statea = act->data; */ + break; + case ACT_ARMATURE: + { + bArmatureActuator *arma= act->data; + arma->target = newlibadr(fd, ob->id.lib, arma->target); + arma->subtarget = newlibadr(fd, ob->id.lib, arma->subtarget); + break; + } + case ACT_STEERING: + { + bSteeringActuator *steeringa = act->data; + steeringa->target = newlibadr(fd, ob->id.lib, steeringa->target); + steeringa->navmesh = newlibadr(fd, ob->id.lib, steeringa->navmesh); + break; + } + case ACT_MOUSE: + /* bMouseActuator *moa = act->data; */ + break; } } @@ -5662,19 +5666,12 @@ static bool scene_validate_setscene__liblink(Scene *sce, const int totscene) static void lib_link_scene(FileData *fd, Main *main) { - Scene *sce; - Base *base, *next; - Sequence *seq; - SceneRenderLayer *srl; - FreestyleModuleConfig *fmc; - FreestyleLineSet *fls; - #ifdef USE_SETSCENE_CHECK bool need_check_set = false; int totscene = 0; #endif - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (Scene *sce = main->scene.first; sce; sce = sce->id.next) { if (sce->id.tag & LIB_TAG_NEED_LINK) { /* Link ID Properties -- and copy this comment EXACTLY for easy finding * of library blocks that implement this.*/ @@ -5714,7 +5711,7 @@ static void lib_link_scene(FileData *fd, Main *main) sce->toolsettings->particle.shape_object = newlibadr(fd, sce->id.lib, sce->toolsettings->particle.shape_object); - for (base = sce->base.first; base; base = next) { + for (Base *next, *base = sce->base.first; base; base = next) { next = base->next; base->object = newlibadr_us(fd, sce->id.lib, base->object); @@ -5728,6 +5725,7 @@ static void lib_link_scene(FileData *fd, Main *main) } } + Sequence *seq; SEQ_BEGIN (sce->ed, seq) { if (seq->ipo) seq->ipo = newlibadr_us(fd, sce->id.lib, seq->ipo); // XXX deprecated - old animation system @@ -5793,13 +5791,13 @@ static void lib_link_scene(FileData *fd, Main *main) composite_patch(sce->nodetree, sce); } - for (srl = sce->r.layers.first; srl; srl = srl->next) { + for (SceneRenderLayer *srl = sce->r.layers.first; srl; srl = srl->next) { srl->mat_override = newlibadr_us(fd, sce->id.lib, srl->mat_override); srl->light_override = newlibadr_us(fd, sce->id.lib, srl->light_override); - for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { + for (FreestyleModuleConfig *fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { fmc->script = newlibadr(fd, sce->id.lib, fmc->script); } - for (fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) { + for (FreestyleLineSet *fls = srl->freestyleConfig.linesets.first; fls; fls = fls->next) { fls->linestyle = newlibadr_us(fd, sce->id.lib, fls->linestyle); fls->group = newlibadr_us(fd, sce->id.lib, fls->group); } @@ -5833,7 +5831,7 @@ static void lib_link_scene(FileData *fd, Main *main) #ifdef USE_SETSCENE_CHECK if (need_check_set) { - for (sce = main->scene.first; sce; sce = sce->id.next) { + for (Scene *sce = main->scene.first; sce; sce = sce->id.next) { if (sce->id.tag & LIB_TAG_NEED_LINK) { sce->id.tag &= ~LIB_TAG_NEED_LINK; if (!scene_validate_setscene__liblink(sce, totscene)) { @@ -6243,8 +6241,10 @@ static void lib_link_windowmanager(FileData *fd, Main *main) for (wm = main->wm.first; wm; wm = wm->id.next) { if (wm->id.tag & LIB_TAG_NEED_LINK) { - for (win = wm->windows.first; win; win = win->next) + /* Note: WM IDProperties are never written to file, hence no need to read/link them here. */ + for (win = wm->windows.first; win; win = win->next) { win->screen = newlibadr(fd, NULL, win->screen); + } wm->id.tag &= ~LIB_TAG_NEED_LINK; } @@ -6256,13 +6256,12 @@ static void lib_link_windowmanager(FileData *fd, Main *main) /* relink's grease pencil data's refs */ static void lib_link_gpencil(FileData *fd, Main *main) { - bGPdata *gpd; - - for (gpd = main->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) { if (gpd->id.tag & LIB_TAG_NEED_LINK) { - gpd->id.tag &= ~LIB_TAG_NEED_LINK; - + IDP_LibLinkProperty(gpd->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &gpd->id, gpd->adt); + + gpd->id.tag &= ~LIB_TAG_NEED_LINK; } } } @@ -6324,12 +6323,11 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd) * check lib pointers in call below */ static void lib_link_screen(FileData *fd, Main *main) { - bScreen *sc; - ScrArea *sa; - - for (sc = main->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = main->screen.first; sc; sc = sc->id.next) { if (sc->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(sc->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); id_us_ensure_real(&sc->id); + sc->scene = newlibadr(fd, sc->id.lib, sc->scene); /* this should not happen, but apparently it does somehow. Until we figure out the cause, @@ -6340,177 +6338,204 @@ static void lib_link_screen(FileData *fd, Main *main) sc->animtimer = NULL; /* saved in rare cases */ sc->scrubbing = false; - for (sa = sc->areabase.first; sa; sa = sa->next) { - SpaceLink *sl; - + for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { sa->full = newlibadr(fd, sc->id.lib, sa->full); - for (sl = sa->spacedata.first; sl; sl= sl->next) { - if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D*) sl; - BGpic *bgpic = NULL; - - v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera); - v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre); - - /* should be do_versions but not easy adding into the listbase */ - if (v3d->bgpic) { - v3d->bgpic = newlibadr(fd, sc->id.lib, v3d->bgpic); - BLI_addtail(&v3d->bgpicbase, bgpic); - v3d->bgpic = NULL; + for (SpaceLink *sl = sa->spacedata.first; sl; sl= sl->next) { + switch (sl->spacetype) { + case SPACE_VIEW3D: + { + View3D *v3d = (View3D*) sl; + BGpic *bgpic = NULL; + + v3d->camera= newlibadr(fd, sc->id.lib, v3d->camera); + v3d->ob_centre= newlibadr(fd, sc->id.lib, v3d->ob_centre); + + /* should be do_versions but not easy adding into the listbase */ + if (v3d->bgpic) { + v3d->bgpic = newlibadr(fd, sc->id.lib, v3d->bgpic); + BLI_addtail(&v3d->bgpicbase, bgpic); + v3d->bgpic = NULL; + } + + for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) { + bgpic->ima = newlibadr_us(fd, sc->id.lib, bgpic->ima); + bgpic->clip = newlibadr_us(fd, sc->id.lib, bgpic->clip); + } + if (v3d->localvd) { + v3d->localvd->camera = newlibadr(fd, sc->id.lib, v3d->localvd->camera); + } + break; } - - for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) { - bgpic->ima = newlibadr_us(fd, sc->id.lib, bgpic->ima); - bgpic->clip = newlibadr_us(fd, sc->id.lib, bgpic->clip); + case SPACE_IPO: + { + SpaceIpo *sipo = (SpaceIpo *)sl; + bDopeSheet *ads = sipo->ads; + + if (ads) { + ads->source = newlibadr(fd, sc->id.lib, ads->source); + ads->filter_grp = newlibadr(fd, sc->id.lib, ads->filter_grp); + } + break; } - if (v3d->localvd) { - v3d->localvd->camera = newlibadr(fd, sc->id.lib, v3d->localvd->camera); + case SPACE_BUTS: + { + SpaceButs *sbuts = (SpaceButs *)sl; + sbuts->pinid = newlibadr(fd, sc->id.lib, sbuts->pinid); + if (sbuts->pinid == NULL) { + sbuts->flag &= ~SB_PIN_CONTEXT; + } + break; } - } - else if (sl->spacetype == SPACE_IPO) { - SpaceIpo *sipo = (SpaceIpo *)sl; - bDopeSheet *ads = sipo->ads; - - if (ads) { - ads->source = newlibadr(fd, sc->id.lib, ads->source); - ads->filter_grp = newlibadr(fd, sc->id.lib, ads->filter_grp); + case SPACE_FILE: + break; + case SPACE_ACTION: + { + SpaceAction *saction = (SpaceAction *)sl; + bDopeSheet *ads = &saction->ads; + + if (ads) { + ads->source = newlibadr(fd, sc->id.lib, ads->source); + ads->filter_grp = newlibadr(fd, sc->id.lib, ads->filter_grp); + } + + saction->action = newlibadr(fd, sc->id.lib, saction->action); + break; } - } - else if (sl->spacetype == SPACE_BUTS) { - SpaceButs *sbuts = (SpaceButs *)sl; - sbuts->pinid = newlibadr(fd, sc->id.lib, sbuts->pinid); - if (sbuts->pinid == NULL) { - sbuts->flag &= ~SB_PIN_CONTEXT; + case SPACE_IMAGE: + { + SpaceImage *sima = (SpaceImage *)sl; + + sima->image = newlibadr_real_us(fd, sc->id.lib, sima->image); + sima->mask_info.mask = newlibadr_real_us(fd, sc->id.lib, sima->mask_info.mask); + + /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data + * so fingers crossed this works fine! + */ + sima->gpd = newlibadr_us(fd, sc->id.lib, sima->gpd); + break; } - } - else if (sl->spacetype == SPACE_FILE) { - ; - } - else if (sl->spacetype == SPACE_ACTION) { - SpaceAction *saction = (SpaceAction *)sl; - bDopeSheet *ads = &saction->ads; - - if (ads) { - ads->source = newlibadr(fd, sc->id.lib, ads->source); - ads->filter_grp = newlibadr(fd, sc->id.lib, ads->filter_grp); + case SPACE_SEQ: + { + SpaceSeq *sseq = (SpaceSeq *)sl; + + /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data + * so fingers crossed this works fine! + */ + sseq->gpd = newlibadr_us(fd, sc->id.lib, sseq->gpd); + break; } - - saction->action = newlibadr(fd, sc->id.lib, saction->action); - } - else if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *)sl; - - sima->image = newlibadr_real_us(fd, sc->id.lib, sima->image); - sima->mask_info.mask = newlibadr_real_us(fd, sc->id.lib, sima->mask_info.mask); - - /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data - * so fingers crossed this works fine! - */ - sima->gpd = newlibadr_us(fd, sc->id.lib, sima->gpd); - } - else if (sl->spacetype == SPACE_SEQ) { - SpaceSeq *sseq = (SpaceSeq *)sl; - - /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data - * so fingers crossed this works fine! - */ - sseq->gpd = newlibadr_us(fd, sc->id.lib, sseq->gpd); + case SPACE_NLA: + { + SpaceNla *snla= (SpaceNla *)sl; + bDopeSheet *ads= snla->ads; + + if (ads) { + ads->source = newlibadr(fd, sc->id.lib, ads->source); + ads->filter_grp = newlibadr(fd, sc->id.lib, ads->filter_grp); + } + break; + } + case SPACE_TEXT: + { + SpaceText *st= (SpaceText *)sl; - } - else if (sl->spacetype == SPACE_NLA) { - SpaceNla *snla= (SpaceNla *)sl; - bDopeSheet *ads= snla->ads; - - if (ads) { - ads->source = newlibadr(fd, sc->id.lib, ads->source); - ads->filter_grp = newlibadr(fd, sc->id.lib, ads->filter_grp); + st->text= newlibadr(fd, sc->id.lib, st->text); + break; } - } - else if (sl->spacetype == SPACE_TEXT) { - SpaceText *st= (SpaceText *)sl; - - st->text= newlibadr(fd, sc->id.lib, st->text); - } - else if (sl->spacetype == SPACE_SCRIPT) { - SpaceScript *scpt = (SpaceScript *)sl; - /*scpt->script = NULL; - 2.45 set to null, better re-run the script */ - if (scpt->script) { - scpt->script = newlibadr(fd, sc->id.lib, scpt->script); + case SPACE_SCRIPT: + { + SpaceScript *scpt = (SpaceScript *)sl; + /*scpt->script = NULL; - 2.45 set to null, better re-run the script */ if (scpt->script) { - SCRIPT_SET_NULL(scpt->script); + scpt->script = newlibadr(fd, sc->id.lib, scpt->script); + if (scpt->script) { + SCRIPT_SET_NULL(scpt->script); + } } + break; } - } - else if (sl->spacetype == SPACE_OUTLINER) { - SpaceOops *so= (SpaceOops *)sl; - so->search_tse.id = newlibadr(fd, NULL, so->search_tse.id); - - if (so->treestore) { - TreeStoreElem *tselem; - BLI_mempool_iter iter; + case SPACE_OUTLINER: + { + SpaceOops *so= (SpaceOops *)sl; + so->search_tse.id = newlibadr(fd, NULL, so->search_tse.id); + + if (so->treestore) { + TreeStoreElem *tselem; + BLI_mempool_iter iter; + + BLI_mempool_iternew(so->treestore, &iter); + while ((tselem = BLI_mempool_iterstep(&iter))) { + tselem->id = newlibadr(fd, NULL, tselem->id); + } + if (so->treehash) { + /* rebuild hash table, because it depends on ids too */ + so->storeflag |= SO_TREESTORE_REBUILD; + } + } + break; + } + case SPACE_NODE: + { + SpaceNode *snode = (SpaceNode *)sl; + bNodeTreePath *path, *path_next; + bNodeTree *ntree; + + /* node tree can be stored locally in id too, link this first */ + snode->id = newlibadr(fd, sc->id.lib, snode->id); + snode->from = newlibadr(fd, sc->id.lib, snode->from); + + ntree = snode->id ? ntreeFromID(snode->id) : NULL; + snode->nodetree = ntree ? ntree : newlibadr_us(fd, sc->id.lib, snode->nodetree); + + for (path = snode->treepath.first; path; path = path->next) { + if (path == snode->treepath.first) { + /* first nodetree in path is same as snode->nodetree */ + path->nodetree = snode->nodetree; + } + else + path->nodetree = newlibadr_us(fd, sc->id.lib, path->nodetree); - BLI_mempool_iternew(so->treestore, &iter); - while ((tselem = BLI_mempool_iterstep(&iter))) { - tselem->id = newlibadr(fd, NULL, tselem->id); + if (!path->nodetree) + break; } - if (so->treehash) { - /* rebuild hash table, because it depends on ids too */ - so->storeflag |= SO_TREESTORE_REBUILD; + + /* remaining path entries are invalid, remove */ + for (; path; path = path_next) { + path_next = path->next; + + BLI_remlink(&snode->treepath, path); + MEM_freeN(path); } - } - } - else if (sl->spacetype == SPACE_NODE) { - SpaceNode *snode = (SpaceNode *)sl; - bNodeTreePath *path, *path_next; - bNodeTree *ntree; - - /* node tree can be stored locally in id too, link this first */ - snode->id = newlibadr(fd, sc->id.lib, snode->id); - snode->from = newlibadr(fd, sc->id.lib, snode->from); - - ntree = snode->id ? ntreeFromID(snode->id) : NULL; - snode->nodetree = ntree ? ntree : newlibadr_us(fd, sc->id.lib, snode->nodetree); - - for (path = snode->treepath.first; path; path = path->next) { - if (path == snode->treepath.first) { - /* first nodetree in path is same as snode->nodetree */ - path->nodetree = snode->nodetree; + + /* edittree is just the last in the path, + * set this directly since the path may have been shortened above */ + if (snode->treepath.last) { + path = snode->treepath.last; + snode->edittree = path->nodetree; } - else - path->nodetree = newlibadr_us(fd, sc->id.lib, path->nodetree); - - if (!path->nodetree) - break; + else { + snode->edittree = NULL; + } + break; } - - /* remaining path entries are invalid, remove */ - for (; path; path = path_next) { - path_next = path->next; - - BLI_remlink(&snode->treepath, path); - MEM_freeN(path); + case SPACE_CLIP: + { + SpaceClip *sclip = (SpaceClip *)sl; + + sclip->clip = newlibadr_real_us(fd, sc->id.lib, sclip->clip); + sclip->mask_info.mask = newlibadr_real_us(fd, sc->id.lib, sclip->mask_info.mask); + break; } - - /* edittree is just the last in the path, - * set this directly since the path may have been shortened above */ - if (snode->treepath.last) { - path = snode->treepath.last; - snode->edittree = path->nodetree; + case SPACE_LOGIC: + { + SpaceLogic *slogic = (SpaceLogic *)sl; + + slogic->gpd = newlibadr_us(fd, sc->id.lib, slogic->gpd); + break; } - else - snode->edittree = NULL; - } - else if (sl->spacetype == SPACE_CLIP) { - SpaceClip *sclip = (SpaceClip *)sl; - - sclip->clip = newlibadr_real_us(fd, sc->id.lib, sclip->clip); - sclip->mask_info.mask = newlibadr_real_us(fd, sc->id.lib, sclip->mask_info.mask); - } - else if (sl->spacetype == SPACE_LOGIC) { - SpaceLogic *slogic = (SpaceLogic *)sl; - - slogic->gpd = newlibadr_us(fd, sc->id.lib, slogic->gpd); + default: + break; } } } @@ -7384,13 +7409,13 @@ static void fix_relpaths_library(const char *basepath, Main *main) static void lib_link_speaker(FileData *fd, Main *main) { - Speaker *spk; - - for (spk = main->speaker.first; spk; spk = spk->id.next) { + for (Speaker *spk = main->speaker.first; spk; spk = spk->id.next) { if (spk->id.tag & LIB_TAG_NEED_LINK) { + IDP_LibLinkProperty(spk->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &spk->id, spk->adt); spk->sound = newlibadr_us(fd, spk->id.lib, spk->sound); + spk->id.tag &= ~LIB_TAG_NEED_LINK; } } @@ -7440,14 +7465,15 @@ static void direct_link_sound(FileData *fd, bSound *sound) static void lib_link_sound(FileData *fd, Main *main) { - bSound *sound; - - for (sound = main->sound.first; sound; sound = sound->id.next) { + for (bSound *sound = main->sound.first; sound; sound = sound->id.next) { if (sound->id.tag & LIB_TAG_NEED_LINK) { - sound->id.tag &= ~LIB_TAG_NEED_LINK; + IDP_LibLinkProperty(sound->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); + sound->ipo = newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX deprecated - old animation system BKE_sound_load(main, sound); + + sound->id.tag &= ~LIB_TAG_NEED_LINK; } } } @@ -7462,17 +7488,13 @@ static void direct_link_group(FileData *fd, Group *group) static void lib_link_group(FileData *fd, Main *main) { - Group *group; - GroupObject *go; - bool add_us; - - for (group = main->group.first; group; group = group->id.next) { + for (Group *group = main->group.first; group; group = group->id.next) { if (group->id.tag & LIB_TAG_NEED_LINK) { - group->id.tag &= ~LIB_TAG_NEED_LINK; + IDP_LibLinkProperty(group->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); - add_us = false; + bool add_us = false; - for (go = group->gobject.first; go; go = go->next) { + for (GroupObject *go = group->gobject.first; go; go = go->next) { go->ob = newlibadr_real_us(fd, group->id.lib, go->ob); if (go->ob) { go->ob->flag |= OB_FROMGROUP; @@ -7484,6 +7506,8 @@ static void lib_link_group(FileData *fd, Main *main) id_us_ensure_real(&group->id); } BKE_group_object_unlink(group, NULL, NULL, NULL); /* removes NULL entries */ + + group->id.tag &= ~LIB_TAG_NEED_LINK; } } } @@ -7588,13 +7612,11 @@ static void lib_link_moviePlaneTracks(FileData *fd, MovieClip *clip, ListBase *t static void lib_link_movieclip(FileData *fd, Main *main) { - MovieClip *clip; - - for (clip = main->movieclip.first; clip; clip = clip->id.next) { + for (MovieClip *clip = main->movieclip.first; clip; clip = clip->id.next) { if (clip->id.tag & LIB_TAG_NEED_LINK) { MovieTracking *tracking = &clip->tracking; - MovieTrackingObject *object; + IDP_LibLinkProperty(clip->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &clip->id, clip->adt); clip->gpd = newlibadr_us(fd, clip->id.lib, clip->gpd); @@ -7602,7 +7624,7 @@ static void lib_link_movieclip(FileData *fd, Main *main) lib_link_movieTracks(fd, clip, &tracking->tracks); lib_link_moviePlaneTracks(fd, clip, &tracking->plane_tracks); - for (object = tracking->objects.first; object; object = object->next) { + for (MovieTrackingObject *object = tracking->objects.first; object; object = object->next) { lib_link_movieTracks(fd, clip, &object->tracks); lib_link_moviePlaneTracks(fd, clip, &object->plane_tracks); } @@ -7679,16 +7701,12 @@ static void lib_link_mask_parent(FileData *fd, Mask *mask, MaskParent *parent) static void lib_link_mask(FileData *fd, Main *main) { - Mask *mask; - - mask = main->mask.first; - while (mask) { + for (Mask *mask = main->mask.first; mask; mask = mask->id.next) { if (mask->id.tag & LIB_TAG_NEED_LINK) { - MaskLayer *masklay; - + IDP_LibLinkProperty(mask->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &mask->id, mask->adt); - for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { + for (MaskLayer *masklay = mask->masklayers.first; masklay; masklay = masklay->next) { MaskSpline *spline; spline = masklay->splines.first; @@ -7709,7 +7727,6 @@ static void lib_link_mask(FileData *fd, Main *main) mask->id.tag &= ~LIB_TAG_NEED_LINK; } - mask = mask->id.next; } } @@ -7717,18 +7734,13 @@ static void lib_link_mask(FileData *fd, Main *main) static void lib_link_linestyle(FileData *fd, Main *main) { - FreestyleLineStyle *linestyle; - LineStyleModifier *m; - MTex *mtex; - int a; - - linestyle = main->linestyle.first; - while (linestyle) { + for (FreestyleLineStyle *linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) { if (linestyle->id.tag & LIB_TAG_NEED_LINK) { - linestyle->id.tag &= ~LIB_TAG_NEED_LINK; + LineStyleModifier *m; IDP_LibLinkProperty(linestyle->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); lib_link_animdata(fd, &linestyle->id, linestyle->adt); + for (m = linestyle->color_modifiers.first; m; m = m->next) { switch (m->type) { case LS_MODIFIER_DISTANCE_FROM_OBJECT: @@ -7759,8 +7771,8 @@ static void lib_link_linestyle(FileData *fd, Main *main) break; } } - for (a=0; a < MAX_MTEX; a++) { - mtex = linestyle->mtex[a]; + for (int a = 0; a < MAX_MTEX; a++) { + MTex *mtex = linestyle->mtex[a]; if (mtex) { mtex->tex = newlibadr_us(fd, linestyle->id.lib, mtex->tex); mtex->object = newlibadr(fd, linestyle->id.lib, mtex->object); @@ -7770,8 +7782,9 @@ static void lib_link_linestyle(FileData *fd, Main *main) lib_link_ntree(fd, &linestyle->id, linestyle->nodetree); linestyle->nodetree->id.lib = linestyle->id.lib; } + + linestyle->id.tag &= ~LIB_TAG_NEED_LINK; } - linestyle = linestyle->id.next; } } @@ -8442,12 +8455,13 @@ static void lib_link_all(FileData *fd, Main *main) lib_link_screen(fd, main); lib_link_scene(fd, main); lib_link_object(fd, main); + lib_link_mesh(fd, main); lib_link_curve(fd, main); lib_link_mball(fd, main); lib_link_material(fd, main); lib_link_texture(fd, main); lib_link_image(fd, main); - lib_link_ipo(fd, main); // XXX deprecated... still needs to be maintained for version patches still + lib_link_ipo(fd, main); /* XXX deprecated... still needs to be maintained for version patches still */ lib_link_key(fd, main); lib_link_world(fd, main); lib_link_lamp(fd, main); @@ -8460,7 +8474,7 @@ static void lib_link_all(FileData *fd, Main *main) lib_link_armature(fd, main); lib_link_action(fd, main); lib_link_vfont(fd, main); - lib_link_nodetree(fd, main); /* has to be done after scene/materials, this will verify group nodes */ + lib_link_nodetree(fd, main); /* has to be done after scene/materials, this will verify group nodes */ lib_link_brush(fd, main); lib_link_palette(fd, main); lib_link_paint_curve(fd, main); @@ -8471,9 +8485,7 @@ static void lib_link_all(FileData *fd, Main *main) lib_link_gpencil(fd, main); lib_link_cachefiles(fd, main); - lib_link_mesh(fd, main); /* as last: tpage images with users at zero */ - - lib_link_library(fd, main); /* only init users */ + lib_link_library(fd, main); /* only init users */ } static void direct_link_keymapitem(FileData *fd, wmKeyMapItem *kmi) diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 3ce3ec7a27a..828da6cb056 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -77,28 +77,8 @@ static bool check_object_needs_evaluation(Object *object) return false; } -void deg_graph_build_finalize(Depsgraph *graph) +void deg_graph_build_flush_layers(Depsgraph *graph) { - /* STEP 1: Make sure new invisible dependencies are ready for use. - * - * TODO(sergey): This might do a bit of extra tagging, but it's kinda nice - * to do it ahead of a time and don't spend time on flushing updates on - * every frame change. - */ - GHASH_FOREACH_BEGIN(IDDepsNode *, id_node, graph->id_hash) - { - if (id_node->layers == 0) { - ID *id = id_node->id; - if (GS(id->name) == ID_OB) { - Object *object = (Object *)id; - if (check_object_needs_evaluation(object)) { - id_node->tag_update(graph); - } - } - } - } - GHASH_FOREACH_END(); - /* STEP 2: Flush visibility layers from children to parent. */ std::stack<OperationDepsNode *> stack; foreach (OperationDepsNode *node, graph->operations) { IDDepsNode *id_node = node->owner->owner; @@ -143,6 +123,31 @@ void deg_graph_build_finalize(Depsgraph *graph) } } } +} + +void deg_graph_build_finalize(Depsgraph *graph) +{ + /* STEP 1: Make sure new invisible dependencies are ready for use. + * + * TODO(sergey): This might do a bit of extra tagging, but it's kinda nice + * to do it ahead of a time and don't spend time on flushing updates on + * every frame change. + */ + GHASH_FOREACH_BEGIN(IDDepsNode *, id_node, graph->id_hash) + { + if (id_node->layers == 0) { + ID *id = id_node->id; + if (GS(id->name) == ID_OB) { + Object *object = (Object *)id; + if (check_object_needs_evaluation(object)) { + id_node->tag_update(graph); + } + } + } + } + GHASH_FOREACH_END(); + /* STEP 2: Flush visibility layers from children to parent. */ + deg_graph_build_flush_layers(graph); /* STEP 3: Re-tag IDs for update if it was tagged before the relations * update tag. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder.h b/source/blender/depsgraph/intern/builder/deg_builder.h index bdc030e3810..3cc51a2d7db 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.h +++ b/source/blender/depsgraph/intern/builder/deg_builder.h @@ -42,5 +42,6 @@ struct Depsgraph; string deg_fcurve_id_name(const FCurve *fcu); void deg_graph_build_finalize(struct Depsgraph *graph); +void deg_graph_build_flush_layers(struct Depsgraph *graph); } // namespace DEG diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index e8ed03666a6..ad73a2db826 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -56,8 +56,8 @@ extern "C" { #include "DEG_depsgraph.h" } /* extern "C" */ +#include "intern/builder/deg_builder.h" #include "intern/eval/deg_eval_flush.h" - #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_component.h" #include "intern/nodes/deg_node_operation.h" @@ -346,6 +346,18 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene) GHASH_FOREACH_END(); } scene->lay_updated |= graph->layers; + /* Special trick to get local view to work. */ + LINKLIST_FOREACH (Base *, base, &scene->base) { + Object *object = base->object; + DEG::IDDepsNode *node = graph->find_id_node(&object->id); + node->layers = 0; + } + LINKLIST_FOREACH (Base *, base, &scene->base) { + Object *object = base->object; + DEG::IDDepsNode *node = graph->find_id_node(&object->id); + node->layers |= base->lay; + } + DEG::deg_graph_build_flush_layers(graph); } void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 297058168a0..d2360fea672 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -86,13 +86,14 @@ /* Core/Shared Utilities */ /* Poll callback for interpolation operators */ -static int gpencil_interpolate_poll(bContext *C) +static int gpencil_view3d_poll(bContext *C) { bGPdata *gpd = CTX_data_gpencil_data(C); bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); /* only 3D view */ - if (CTX_wm_area(C)->spacetype != SPACE_VIEW3D) { + ScrArea *sa = CTX_wm_area(C); + if (sa && sa->spacetype != SPACE_VIEW3D) { return 0; } @@ -673,7 +674,7 @@ void GPENCIL_OT_interpolate(wmOperatorType *ot) ot->invoke = gpencil_interpolate_invoke; ot->modal = gpencil_interpolate_modal; ot->cancel = gpencil_interpolate_cancel; - ot->poll = gpencil_interpolate_poll; + ot->poll = gpencil_view3d_poll; /* flags */ ot->flag = OPTYPE_UNDO | OPTYPE_BLOCKING; @@ -1017,7 +1018,7 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot) /* api callbacks */ ot->exec = gpencil_interpolate_seq_exec; - ot->poll = gpencil_interpolate_poll; + ot->poll = gpencil_view3d_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -1025,24 +1026,14 @@ void GPENCIL_OT_interpolate_sequence(wmOperatorType *ot) /* ******************** Remove Breakdowns ************************ */ -/* Same as gpencil_interpolate_poll(), - * except we ALSO need to have an active frame that is a breakdown - */ static int gpencil_interpolate_reverse_poll(bContext *C) { - bGPdata *gpd = CTX_data_gpencil_data(C); - bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); - - /* only 3D view */ - if (CTX_wm_area(C)->spacetype != SPACE_VIEW3D) { - return 0; - } - - /* need data to interpolate */ - if (ELEM(NULL, gpd, gpl)) { + if (!gpencil_view3d_poll(C)) { return 0; } - + + bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); + /* need to be on a breakdown frame */ if ((gpl->actframe == NULL) || (gpl->actframe->key_type != BEZT_KEYTYPE_BREAKDOWN)) { CTX_wm_operator_poll_msg_set(C, "Expected current frame to be a breakdown"); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 9fbce7dd203..2ce4f3e2790 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -421,7 +421,7 @@ typedef void (*uiBlockCancelFunc)(struct bContext *C, void *arg1); void UI_popup_block_invoke(struct bContext *C, uiBlockCreateFunc func, void *arg); void UI_popup_block_invoke_ex(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext); -void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg); +void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg, struct wmOperator *op); /* void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); */ /* UNUSED */ void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 4846272b17d..259ccb60ba7 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -87,6 +87,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "wm_event_system.h" #ifdef WITH_INPUT_IME # include "wm_window.h" @@ -380,6 +381,7 @@ typedef struct uiAfterFunc { void *butm_func_arg; int a2; + wmOperator *popup_op; wmOperatorType *optype; int opcontext; PointerRNA *opptr; @@ -635,13 +637,24 @@ PointerRNA *ui_handle_afterfunc_add_operator(wmOperatorType *ot, int opcontext, return ptr; } +static void popup_check(bContext *C, const wmOperator *op) +{ + if (op && op->type->check && op->type->check(C, op)) { + /* check for popup and re-layout buttons */ + ARegion *ar_menu = CTX_wm_menu(C); + if (ar_menu) + ED_region_tag_refresh_ui(ar_menu); + } +} + /** * Check if a #uiAfterFunc is needed for this button. */ static bool ui_afterfunc_check(const uiBlock *block, const uiBut *but) { return (but->func || but->funcN || but->rename_func || but->optype || but->rnaprop || block->handle_func || - (but->type == UI_BTYPE_BUT_MENU && block->butm_func)); + (but->type == UI_BTYPE_BUT_MENU && block->butm_func) || + block->handle && block->handle->popup_op); } static void ui_apply_but_func(bContext *C, uiBut *but) @@ -682,6 +695,9 @@ static void ui_apply_but_func(bContext *C, uiBut *but) after->butm_func_arg = block->butm_func_arg; after->a2 = but->a2; } + + if (block->handle) + after->popup_op = block->handle->popup_op; after->optype = but->optype; after->opcontext = but->opcontext; @@ -766,6 +782,9 @@ static void ui_apply_but_funcs_after(bContext *C) if (after.context) CTX_store_set(C, after.context); + if (after.popup_op) + popup_check(C, after.popup_op); + if (after.opptr) { /* free in advance to avoid leak on exit */ opptr = *after.opptr; @@ -6665,7 +6684,7 @@ static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2)) static void popup_add_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2)) { uiBut *but = (uiBut *)arg1; - UI_popup_block_ex(C, menu_add_shortcut, NULL, menu_add_shortcut_cancel, but); + UI_popup_block_ex(C, menu_add_shortcut, NULL, menu_add_shortcut_cancel, but, NULL); } /** @@ -10179,6 +10198,25 @@ void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle * void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup) { + wmEventHandler *handler; + + for (handler = handlers->first; handler; handler = handler->next) { + if (handler->ui_handle == ui_popup_handler && + handler->ui_remove == ui_popup_handler_remove && + handler->ui_userdata == popup) + { + /* tag refresh parent popup */ + if (handler->next && + handler->next->ui_handle == ui_popup_handler && + handler->next->ui_remove == ui_popup_handler_remove) + { + uiPopupBlockHandle *parent_popup = handler->next->ui_userdata; + ED_region_tag_refresh_ui(parent_popup->region); + } + break; + } + } + WM_event_remove_ui_handler(handlers, ui_popup_handler, ui_popup_handler_remove, popup, false); } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index d8f9fdcbaae..067279777ba 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -556,6 +556,7 @@ struct uiPopupBlockHandle { struct uiKeyNavLock keynav_state; /* for operator popups */ + struct wmOperator *popup_op; struct wmOperatorType *optype; ScrArea *ctx_area; ARegion *ctx_region; diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index bb789f91e76..7b0921941e7 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2266,6 +2266,7 @@ static void ui_litem_estimate_column(uiLayout *litem, bool is_box) { uiItem *item; int itemw, itemh; + bool min_size_flag = true; litem->w = 0; litem->h = 0; @@ -2273,12 +2274,18 @@ static void ui_litem_estimate_column(uiLayout *litem, bool is_box) for (item = litem->items.first; item; item = item->next) { ui_item_size(item, &itemw, &itemh); + min_size_flag = min_size_flag && (item->flag & UI_ITEM_MIN); + litem->w = MAX2(litem->w, itemw); litem->h += itemh; if (item->next && (!is_box || item != litem->items.first)) litem->h += litem->space; } + + if (min_size_flag) { + litem->item.flag |= UI_ITEM_MIN; + } } static void ui_litem_layout_column(uiLayout *litem, bool is_box) @@ -2446,6 +2453,7 @@ static void ui_litem_estimate_box(uiLayout *litem) uiStyle *style = litem->root->style; ui_litem_estimate_column(litem, true); + litem->item.flag &= ~UI_ITEM_MIN; litem->w += 2 * style->boxspace; litem->h += 2 * style->boxspace; } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 7b6b41eeef3..534bd4278ca 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -3312,7 +3312,7 @@ void UI_popup_block_invoke(bContext *C, uiBlockCreateFunc func, void *arg) UI_popup_block_invoke_ex(C, func, arg, NULL, WM_OP_INVOKE_DEFAULT); } -void UI_popup_block_ex(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg) +void UI_popup_block_ex(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg, wmOperator *op) { wmWindow *window = CTX_wm_window(C); uiPopupBlockHandle *handle; @@ -3321,6 +3321,7 @@ void UI_popup_block_ex(bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc po handle->popup = true; handle->retvalue = 1; + handle->popup_op = op; handle->popup_arg = arg; handle->popup_func = popup_func; handle->cancel_func = cancel_func; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 5ec0c49a8cd..f7f2b422724 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -874,24 +874,18 @@ static void widget_draw_icon( float ofs = 1.0f / aspect; if (but->drawflag & UI_BUT_ICON_LEFT) { - if (but->block->flag & UI_BLOCK_LOOP) { - if (but->type == UI_BTYPE_SEARCH_MENU) - xs = rect->xmin + 4.0f * ofs; - else - xs = rect->xmin + ofs; - } - else { - if (but->dt == UI_EMBOSS_NONE || but->type == UI_BTYPE_LABEL) - xs = rect->xmin + 2.0f * ofs; - else - xs = rect->xmin + 4.0f * ofs; - } - ys = (rect->ymin + rect->ymax - height) / 2.0f; + /* special case - icon_only pie buttons */ + if (ui_block_is_pie_menu(but->block) && but->type != UI_BTYPE_MENU && but->str && but->str[0] == '\0') + xs = rect->xmin + 2.0f * ofs; + else if (but->dt == UI_EMBOSS_NONE || but->type == UI_BTYPE_LABEL) + xs = rect->xmin + 2.0f * ofs; + else + xs = rect->xmin + 4.0f * ofs; } else { xs = (rect->xmin + rect->xmax - height) / 2.0f; - ys = (rect->ymin + rect->ymax - height) / 2.0f; } + ys = (rect->ymin + rect->ymax - height) / 2.0f; /* force positions to integers, for zoom levels near 1. draws icons crisp. */ if (aspect > 0.95f && aspect < 1.05f) { diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index d601f5c3b14..06d306ded42 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1484,7 +1484,6 @@ static int skin_root_mark_exec(bContext *C, wmOperator *UNUSED(op)) Object *ob = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(ob); BMesh *bm = em->bm; - const int cd_vert_skin_offset = CustomData_get_offset(&bm->vdata, CD_MVERT_SKIN); BMVert *bm_vert; BMIter bm_iter; GSet *visited; @@ -1493,6 +1492,8 @@ static int skin_root_mark_exec(bContext *C, wmOperator *UNUSED(op)) BKE_mesh_ensure_skin_customdata(ob->data); + const int cd_vert_skin_offset = CustomData_get_offset(&bm->vdata, CD_MVERT_SKIN); + BM_ITER_MESH (bm_vert, &bm_iter, bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(bm_vert, BM_ELEM_SELECT) && BLI_gset_add(visited, bm_vert)) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 8230a0de6b9..fe8274064e5 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1405,6 +1405,8 @@ static bool view3d_localview_init( } } + DAG_on_visible_update(bmain, false); + return ok; } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 32b43c7ea55..823a7f0812f 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -277,6 +277,7 @@ typedef struct MirrorModifierData { short axis DNA_DEPRECATED; /* deprecated, use flag instead */ short flag; float tolerance; + float uv_offset[2]; struct Object *mirror_ob; } MirrorModifierData; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 36cf909b299..1a8dd05a7b5 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1526,6 +1526,20 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "mirror_offset_u", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "uv_offset[0]"); + RNA_def_property_range(prop, -1, 1); + RNA_def_property_ui_range(prop, -1, 1, 2, 4); + RNA_def_property_ui_text(prop, "U Offset", "Amount to offset mirrored UVs from the 0.5 point on the U axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "mirror_offset_v", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "uv_offset[1]"); + RNA_def_property_range(prop, -1, 1); + RNA_def_property_ui_range(prop, -1, 1, 2, 4); + RNA_def_property_ui_text(prop, "V Offset", "Amount to offset mirrored UVs from the 0.5 point on the V axis"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "tolerance"); RNA_def_property_range(prop, 0, FLT_MAX); diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index dd127cc255c..9705edc580c 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -274,8 +274,8 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd, int j = maxLoops; dmloopuv += j; /* second set of loops only */ for (; j-- > 0; dmloopuv++) { - if (do_mirr_u) dmloopuv->uv[0] = 1.0f - dmloopuv->uv[0]; - if (do_mirr_v) dmloopuv->uv[1] = 1.0f - dmloopuv->uv[1]; + if (do_mirr_u) dmloopuv->uv[0] = 1.0f - dmloopuv->uv[0] + mmd->uv_offset[0]; + if (do_mirr_v) dmloopuv->uv[1] = 1.0f - dmloopuv->uv[1] + mmd->uv_offset[1]; } } } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 27395dbaf3e..2e799307cc0 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -643,7 +643,8 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) * When not-null, this is written into the user preferences. */ int wm_homefile_read( - bContext *C, ReportList *reports, bool use_factory_settings, + bContext *C, ReportList *reports, + bool use_factory_settings, bool use_empty_data, const char *filepath_startup_override, const char *app_template_override) { ListBase wmbase; @@ -779,6 +780,10 @@ int wm_homefile_read( } } + if (use_empty_data) { + BKE_blendfile_read_make_empty(C); + } + /* Load template preferences, * unlike regular preferences we only use some of the settings, * see: BKE_blender_userdef_set_app_template */ @@ -1551,6 +1556,7 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op) const char *app_template; PropertyRNA *prop_app_template = RNA_struct_find_property(op->ptr, "app_template"); const bool use_splash = !use_factory_settings && RNA_boolean_get(op->ptr, "use_splash"); + const bool use_empty_data = RNA_boolean_get(op->ptr, "use_empty"); if (prop_app_template && RNA_property_is_set(op->ptr, prop_app_template)) { RNA_property_string_get(op->ptr, prop_app_template, app_template_buf); @@ -1560,7 +1566,7 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op) app_template = NULL; } - if (wm_homefile_read(C, op->reports, use_factory_settings, filepath, app_template)) { + if (wm_homefile_read(C, op->reports, use_factory_settings, use_empty_data, filepath, app_template)) { if (use_splash) { WM_init_splash(C); } @@ -1591,6 +1597,9 @@ void WM_OT_read_homefile(wmOperatorType *ot) "Load user interface setup from the .blend file"); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + prop = RNA_def_boolean(ot->srna, "use_empty", false, "Empty", ""); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + /* So the splash can be kept open after loading a file (for templates). */ prop = RNA_def_boolean(ot->srna, "use_splash", false, "Splash", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); @@ -1615,6 +1624,9 @@ void WM_OT_read_factory_settings(wmOperatorType *ot) prop = RNA_def_string(ot->srna, "app_template", "Template", sizeof(U.app_template), "", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + prop = RNA_def_boolean(ot->srna, "use_empty", false, "Empty", ""); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + /* omit poll to run in background mode */ } diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 5483cf25e40..9bafe72d805 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -192,7 +192,7 @@ void WM_init(bContext *C, int argc, const char **argv) wm_init_reports(C); /* get the default database, plus a wm */ - wm_homefile_read(C, NULL, G.factory_startup, NULL, NULL); + wm_homefile_read(C, NULL, G.factory_startup, false, NULL, NULL); BLT_lang_set(NULL); diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index e201fa433d4..db5fc23146f 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -121,6 +121,13 @@ static void wm_keymap_item_properties_update_ot(wmKeyMapItem *kmi) if (ot->srna != kmi->ptr->type) { /* matches wm_keymap_item_properties_set but doesnt alloc new ptr */ WM_operator_properties_create_ptr(kmi->ptr, ot); + /* 'kmi->ptr->data' NULL'd above, keep using existing properties. + * Note: the operators property types may have changed, + * we will need a more comprehensive sanitize function to support this properly. + */ + if (kmi->properties) { + kmi->ptr->data = kmi->properties; + } WM_operator_properties_sanitize(kmi->ptr, 1); } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 39e06ccc3c8..d827ccafda8 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1403,20 +1403,6 @@ static void dialog_exec_cb(bContext *C, void *arg1, void *arg2) } } -static void popup_check_cb(bContext *C, void *op_ptr, void *UNUSED(arg)) -{ - wmOperator *op = op_ptr; - if (op->type->check) { - if (op->type->check(C, op)) { - /* check for popup and re-layout buttons */ - ARegion *ar_menu = CTX_wm_menu(C); - if (ar_menu) { - ED_region_tag_refresh_ui(ar_menu); - } - } - } -} - /* Dialogs are popups that require user verification (click OK) before exec */ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) { @@ -1435,8 +1421,6 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, 0, style); - UI_block_func_set(block, popup_check_cb, op, NULL); - uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE); /* clear so the OK button is left alone */ @@ -1475,8 +1459,6 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData) layout = UI_block_layout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, 0, style); - UI_block_func_set(block, popup_check_cb, op, NULL); - /* since ui is defined the auto-layout args are not used */ uiLayoutOperatorButs(C, layout, op, NULL, 'V', 0); @@ -1523,7 +1505,7 @@ int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height) data->width = width; data->height = height; data->free_op = true; /* if this runs and gets registered we may want not to free it */ - UI_popup_block_ex(C, wm_operator_ui_create, NULL, wm_operator_ui_popup_cancel, data); + UI_popup_block_ex(C, wm_operator_ui_create, NULL, wm_operator_ui_popup_cancel, data, op); return OPERATOR_RUNNING_MODAL; } @@ -1553,7 +1535,7 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, if (!do_redo || !(U.uiflag & USER_GLOBALUNDO)) return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, UI_UNIT_Y); - UI_popup_block_ex(C, wm_block_create_redo, NULL, wm_block_redo_cancel_cb, op); + UI_popup_block_ex(C, wm_block_create_redo, NULL, wm_block_redo_cancel_cb, op, op); if (do_call) wm_block_redo_cb(C, op, 0); @@ -1595,7 +1577,7 @@ int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int h data->free_op = true; /* if this runs and gets registered we may want not to free it */ /* op is not executed until popup OK but is clicked */ - UI_popup_block_ex(C, wm_block_dialog_create, wm_operator_ui_popup_ok, wm_operator_ui_popup_cancel, data); + UI_popup_block_ex(C, wm_block_dialog_create, wm_operator_ui_popup_ok, wm_operator_ui_popup_cancel, data, op); return OPERATOR_RUNNING_MODAL; } @@ -1778,7 +1760,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar (U.pixelsize == 2) ? "splash_2x.png" : "splash.png"); ibuf_template = IMB_loadiffname(splash_filepath, IB_rect, NULL); if (ibuf_template) { - const int x_expect = ibuf_template->x; + const int x_expect = ibuf->x; const int y_expect = 230 * (int)U.pixelsize; /* don't cover the header text */ if (ibuf_template->x == x_expect && ibuf_template->y == y_expect) { diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 40baab8809c..51f501e0486 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -312,7 +312,7 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) if (tmpwin == NULL) do_exit = 1; - if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved) { + if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved && !G.background) { if (do_exit) { if (!GHOST_confirmQuit(win->ghostwin)) return; diff --git a/source/blender/windowmanager/wm_files.h b/source/blender/windowmanager/wm_files.h index 15a94d2da70..9a1518e15b0 100644 --- a/source/blender/windowmanager/wm_files.h +++ b/source/blender/windowmanager/wm_files.h @@ -36,7 +36,8 @@ struct wmOperatorType; /* wm_files.c */ void wm_history_file_read(void); int wm_homefile_read( - struct bContext *C, struct ReportList *reports, bool use_factory_settings, + struct bContext *C, struct ReportList *reports, + bool use_factory_settings, bool use_empty_data, const char *filepath_startup_override, const char *app_template_override); void wm_file_read_report(bContext *C); diff --git a/tests/python/batch_import.py b/tests/python/batch_import.py index 8fc679a7c15..bbe3a70327f 100644 --- a/tests/python/batch_import.py +++ b/tests/python/batch_import.py @@ -48,29 +48,17 @@ import os import sys -def clear_scene(): - import bpy - unique_obs = set() - for scene in bpy.data.scenes: - for obj in scene.objects[:]: - scene.objects.unlink(obj) - unique_obs.add(obj) - - # remove obdata, for now only worry about the startup scene - for bpy_data_iter in (bpy.data.objects, bpy.data.meshes, bpy.data.lamps, bpy.data.cameras): - for id_data in bpy_data_iter: - bpy_data_iter.remove(id_data) - - -def batch_import(operator="", - path="", - save_path="", - match="", - start=0, - end=sys.maxsize, - ): +def batch_import( + operator="", + path="", + save_path="", + match="", + start=0, + end=sys.maxsize, +): import addon_utils _reset_all = addon_utils.reset_all # XXX, hack + _disable_all = addon_utils.disable_all # XXX, hack import fnmatch @@ -116,11 +104,12 @@ def batch_import(operator="", # hack so loading the new file doesn't undo our loaded addons addon_utils.reset_all = lambda: None # XXX, hack + addon_utils.disable_all = lambda: None # XXX, hack - bpy.ops.wm.read_factory_settings() + bpy.ops.wm.read_factory_settings(use_empty=True) addon_utils.reset_all = _reset_all # XXX, hack - clear_scene() + addon_utils.disable_all = _disable_all # XXX, hack result = op(filepath=f) diff --git a/tests/python/bl_mesh_modifiers.py b/tests/python/bl_mesh_modifiers.py index 526a54a49a2..bff2c31984c 100644 --- a/tests/python/bl_mesh_modifiers.py +++ b/tests/python/bl_mesh_modifiers.py @@ -31,7 +31,6 @@ import math USE_QUICK_RENDER = False -IS_BMESH = hasattr(__import__("bpy").types, "LoopColors") # ----------------------------------------------------------------------------- # utility functions @@ -203,13 +202,8 @@ def defaults_object(obj): mesh.show_normal_vertex = True - # lame! - if IS_BMESH: - for poly in mesh.polygons: - poly.use_smooth = True - else: - for face in mesh.faces: - face.use_smooth = True + for poly in mesh.polygons: + poly.use_smooth = True def defaults_modifier(mod): @@ -220,16 +214,14 @@ def defaults_modifier(mod): # ----------------------------------------------------------------------------- # models (utils) +def mesh_bmesh_poly_elems(poly, elems): + vert_start = poly.loop_start + vert_total = poly.loop_total + return elems[vert_start:vert_start + vert_total] -if IS_BMESH: - def mesh_bmesh_poly_elems(poly, elems): - vert_start = poly.loop_start - vert_total = poly.loop_total - return elems[vert_start:vert_start + vert_total] - - def mesh_bmesh_poly_vertices(poly): - return [loop.vertex_index - for loop in mesh_bmesh_poly_elems(poly, poly.id_data.loops)] +def mesh_bmesh_poly_vertices(poly): + return [loop.vertex_index + for loop in mesh_bmesh_poly_elems(poly, poly.id_data.loops)] def mesh_bounds(mesh): @@ -258,21 +250,14 @@ def mesh_uv_add(obj): uv_lay = obj.data.uv_textures.new() - if IS_BMESH: - # XXX, odd that we need to do this. until UV's and texface - # are separated we will need to keep it - uv_loops = obj.data.uv_layers[-1] - uv_list = uv_loops.data[:] - for poly in obj.data.polygons: - poly_uvs = mesh_bmesh_poly_elems(poly, uv_list) - for i, c in enumerate(poly_uvs): - c.uv = uvs[i % 4] - else: - for uv in uv_lay.data: - uv.uv1 = uvs[0] - uv.uv2 = uvs[1] - uv.uv3 = uvs[2] - uv.uv4 = uvs[3] + # XXX, odd that we need to do this. until UV's and texface + # are separated we will need to keep it + uv_loops = obj.data.uv_layers[-1] + uv_list = uv_loops.data[:] + for poly in obj.data.polygons: + poly_uvs = mesh_bmesh_poly_elems(poly, uv_list) + for i, c in enumerate(poly_uvs): + c.uv = uvs[i % 4] return uv_lay @@ -296,21 +281,12 @@ def mesh_vcol_add(obj, mode=0): mesh = obj.data - if IS_BMESH: - col_list = vcol_lay.data[:] - for poly in mesh.polygons: - face_verts = mesh_bmesh_poly_vertices(poly) - poly_cols = mesh_bmesh_poly_elems(poly, col_list) - for i, c in enumerate(poly_cols): - c.color = colors_get(face_verts[i]) - else: - for i, col in enumerate(vcol_lay.data): - face_verts = mesh.faces[i].vertices - col.color1 = colors_get(face_verts[0]) - col.color2 = colors_get(face_verts[1]) - col.color3 = colors_get(face_verts[2]) - if len(face_verts) == 4: - col.color4 = colors_get(face_verts[3]) + col_list = vcol_lay.data[:] + for poly in mesh.polygons: + face_verts = mesh_bmesh_poly_vertices(poly) + poly_cols = mesh_bmesh_poly_elems(poly, col_list) + for i, c in enumerate(poly_cols): + c.color = colors_get(face_verts[i]) return vcol_lay @@ -470,10 +446,7 @@ def modifier_build_add(scene, obj): defaults_modifier(mod) # ensure we display some faces - if IS_BMESH: - totface = len(obj.data.polygons) - else: - totface = len(obj.data.faces) + totface = len(obj.data.polygons) mod.frame_start = totface // 2 mod.frame_duration = totface diff --git a/tests/python/bl_run_operators.py b/tests/python/bl_run_operators.py index 7e92b424faa..7d5f4127378 100644 --- a/tests/python/bl_run_operators.py +++ b/tests/python/bl_run_operators.py @@ -65,6 +65,7 @@ op_blacklist = ( "wm.blenderplayer_start", "wm.recover_auto_save", "wm.quit_blender", + "wm.window_close", "wm.url_open", "wm.doc_view", "wm.doc_edit", @@ -308,16 +309,7 @@ def run_ops(operators, setup_func=None, reset=True): # contexts def ctx_clear_scene(): # copied from batch_import.py - unique_obs = set() - for scene in bpy.data.scenes: - for obj in scene.objects[:]: - scene.objects.unlink(obj) - unique_obs.add(obj) - - # remove obdata, for now only worry about the startup scene - for bpy_data_iter in (bpy.data.objects, bpy.data.meshes, bpy.data.lamps, bpy.data.cameras): - for id_data in bpy_data_iter: - bpy_data_iter.remove(id_data) + bpy.ops.wm.read_factory_settings(use_empty=True) def ctx_editmode_mesh(): |