[Bf-blender-cvs] [f01ff46828c] cycles_embree: Merge branch 'master' of git.blender.org:blender into cycles_embree

Stefan Werner noreply at git.blender.org
Thu Aug 30 09:12:34 CEST 2018


Commit: f01ff46828cb68bc91a408a03138099f40992f7f
Author: Stefan Werner
Date:   Thu Aug 30 09:12:30 2018 +0200
Branches: cycles_embree
https://developer.blender.org/rBf01ff46828cb68bc91a408a03138099f40992f7f

Merge branch 'master' of git.blender.org:blender into cycles_embree

# Conflicts:
#	intern/cycles/blender/blender_sync.cpp
#	intern/cycles/bvh/bvh.cpp
#	intern/cycles/device/device_cpu.cpp
#	intern/cycles/kernel/kernel_types.h

===================================================================



===================================================================

diff --cc build_files/cmake/platform/platform_unix.cmake
index 1ee98a8e600,bc6ebeab97c..f86fd1db0e4
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@@ -352,17 -359,9 +359,13 @@@ if(WITH_OPENCOLORIO
  	endif()
  endif()
  
 +if(WITH_CYCLES_EMBREE)
 +	find_package(embree 3.2 REQUIRED)
 +endif()
 +
  if(WITH_LLVM)
- 	# Symbol conflicts with same UTF library used by OpenCollada
  	if(EXISTS ${LIBDIR})
  		set(LLVM_STATIC ON)
- 		if(WITH_OPENCOLLADA)
- 			list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
- 		endif()
  	endif()
  
  	find_package_wrapper(LLVM)
diff --cc intern/cycles/blender/blender_sync.cpp
index 8a6fe464774,fcdadf0ad6e..8c2fcece1ae
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@@ -662,10 -679,16 +679,19 @@@ SceneParams BlenderSync::get_scene_para
  		params.texture_limit = 0;
  	}
  
- 	params.bvh_layout = DebugFlags().cpu.bvh_layout;
+ 	/* TODO(sergey): Once OSL supports per-microarchitecture optimization get
+ 	 * rid of this.
+ 	 */
+ 	if (params.shadingsystem == SHADINGSYSTEM_OSL) {
+ 		params.bvh_layout = BVH_LAYOUT_BVH4;
+ 	}
+ 	else {
+ 		params.bvh_layout = DebugFlags().cpu.bvh_layout;
+ 	}
+ 
 +#ifdef WITH_EMBREE
 +	params.bvh_layout = RNA_boolean_get(&cscene, "use_bvh_embree") ? BVH_LAYOUT_EMBREE : params.bvh_layout;
 +#endif
  	return params;
  }
  
diff --cc intern/cycles/bvh/CMakeLists.txt
index 54c19f6e97e,fcd28572fdf..6014624f395
--- a/intern/cycles/bvh/CMakeLists.txt
+++ b/intern/cycles/bvh/CMakeLists.txt
@@@ -10,9 -10,9 +10,10 @@@ set(SR
  	bvh.cpp
  	bvh2.cpp
  	bvh4.cpp
+ 	bvh8.cpp
  	bvh_binning.cpp
  	bvh_build.cpp
 +	bvh_embree.cpp
  	bvh_node.cpp
  	bvh_sort.cpp
  	bvh_split.cpp
@@@ -23,9 -23,9 +24,10 @@@ set(SRC_HEADER
  	bvh.h
  	bvh2.h
  	bvh4.h
+ 	bvh8.h
  	bvh_binning.h
  	bvh_build.h
 +	bvh_embree.h
  	bvh_node.h
  	bvh_params.h
  	bvh_sort.h
diff --cc intern/cycles/bvh/bvh.cpp
index 357d9de28fd,bc73a3ad264..4cfd769533e
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@@ -42,9 -39,9 +43,10 @@@ const char *bvh_layout_name(BVHLayout l
  	switch(layout) {
  		case BVH_LAYOUT_BVH2: return "BVH2";
  		case BVH_LAYOUT_BVH4: return "BVH4";
+ 		case BVH_LAYOUT_BVH8: return "BVH8";
  		case BVH_LAYOUT_NONE: return "NONE";
  		case BVH_LAYOUT_ALL:  return "ALL";
 +		case BVH_LAYOUT_EMBREE: return "EMBREE";
  	}
  	LOG(DFATAL) << "Unsupported BVH layout was passed.";
  	return "";
@@@ -97,8 -94,8 +99,10 @@@ BVH *BVH::create(const BVHParams& param
  			return new BVH2(params, objects);
  		case BVH_LAYOUT_BVH4:
  			return new BVH4(params, objects);
+ 		case BVH_LAYOUT_BVH8:
+ 			return new BVH8(params, objects);
 +		case BVH_LAYOUT_EMBREE:
 +			return new BVHEmbree(params, objects);
  		case BVH_LAYOUT_NONE:
  		case BVH_LAYOUT_ALL:
  			break;
diff --cc intern/cycles/device/device_cpu.cpp
index 9cb2ff6daff,5b3761f8353..563062028f3
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@@ -1028,12 -1028,12 +1031,15 @@@ void device_cpu_info(vector<DeviceInfo>
  	info.num = 0;
  	info.advanced_shading = true;
  	info.bvh_layout_mask = BVH_LAYOUT_BVH2;
- 	if (system_cpu_support_sse2()) {
+ 	if(system_cpu_support_sse2()) {
  		info.bvh_layout_mask |= BVH_LAYOUT_BVH4;
  	}
+ 	if (system_cpu_support_avx2()) {
+ 		info.bvh_layout_mask |= BVH_LAYOUT_BVH8;
+ 	}
 +#ifdef WITH_EMBREE
 +	info.bvh_layout_mask |= BVH_LAYOUT_EMBREE;
 +#endif /* WITH_EMBREE */
  	info.has_volume_decoupled = true;
  	info.has_osl = true;
  	info.has_half_images = true;
diff --cc intern/cycles/kernel/kernel_types.h
index 76b740a50be,e93100a6442..b8d2dffca91
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@@ -1394,9 -1384,9 +1395,9 @@@ typedef enum KernelBVHLayout 
  
  	BVH_LAYOUT_BVH2 = (1 << 0),
  	BVH_LAYOUT_BVH4 = (1 << 1),
- 	BVH_LAYOUT_EMBREE = (1 << 2),
- 
- 	BVH_LAYOUT_DEFAULT = BVH_LAYOUT_BVH4,
+ 	BVH_LAYOUT_BVH8 = (1 << 2),
 -
++	BVH_LAYOUT_EMBREE = (1 << 3),
+ 	BVH_LAYOUT_DEFAULT = BVH_LAYOUT_BVH8,
  	BVH_LAYOUT_ALL = (unsigned int)(-1),
  } KernelBVHLayout;



More information about the Bf-blender-cvs mailing list