[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39671] branches/cycles/intern/cycles: Cycles:

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Aug 24 12:44:05 CEST 2011


Revision: 39671
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39671
Author:   blendix
Date:     2011-08-24 10:44:04 +0000 (Wed, 24 Aug 2011)
Log Message:
-----------
Cycles:
* auto/fixed threads option is used now, patch by Thomas.
* remove unused CUDA_LIBRARIES, library is dynamically loaded
* fix mesh XML export operator for API update

Modified Paths:
--------------
    branches/cycles/intern/cycles/app/cycles_test.cpp
    branches/cycles/intern/cycles/blender/addon/ui.py
    branches/cycles/intern/cycles/blender/addon/xml.py
    branches/cycles/intern/cycles/blender/blender_sync.cpp
    branches/cycles/intern/cycles/cmake/external_libs.cmake
    branches/cycles/intern/cycles/device/device.cpp
    branches/cycles/intern/cycles/device/device.h
    branches/cycles/intern/cycles/device/device_cpu.cpp
    branches/cycles/intern/cycles/device/device_intern.h
    branches/cycles/intern/cycles/render/session.cpp
    branches/cycles/intern/cycles/render/session.h

Modified: branches/cycles/intern/cycles/app/cycles_test.cpp
===================================================================
--- branches/cycles/intern/cycles/app/cycles_test.cpp	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/app/cycles_test.cpp	2011-08-24 10:44:04 UTC (rev 39671)
@@ -222,6 +222,7 @@
 		"--quiet", &options.quiet, "In background mode, don't print progress messages",
 		"--passes %d", &options.session_params.passes, "Number of passes to render",
 		"--output %s", &options.session_params.output_path, "File path to write output image",
+		"--threads %d", &options.session_params.threads, "CPU Rendering Threads",
 		"--help", &help, "Print help message",
 		NULL);
 	

Modified: branches/cycles/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/cycles/intern/cycles/blender/addon/ui.py	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/blender/addon/ui.py	2011-08-24 10:44:04 UTC (rev 39671)
@@ -54,7 +54,7 @@
 		#row = col.row()
 		#row.prop(cycles, "blur_caustics")
 		#row.active = not cycles.no_caustics
-
+		
 class CyclesRender_PT_film(CyclesButtonsPanel, bpy.types.Panel):
 	bl_label = "Film"
 
@@ -69,33 +69,39 @@
 		split.prop(cycles, "exposure")
 		split.prop(cycles, "response_curve", text="")
 
-class CyclesRender_PT_debug(CyclesButtonsPanel, bpy.types.Panel):
-	bl_label = "Debug"
+class CyclesRender_PT_performance(CyclesButtonsPanel, bpy.types.Panel):
+	bl_label = "Performance"
 	bl_options = {'DEFAULT_CLOSED'}
 
 	def draw(self, context):
 		layout = self.layout
 
 		scene = context.scene
+		rd = scene.render
 		cycles = scene.cycles
 
 		split = layout.split()
 
-		col = split.column()
+		col = split.column(align=True)
 
-		sub = col.column(align=True)
-		sub.prop(cycles, "debug_bvh_type", text="")
-		sub.prop(cycles, "debug_use_spatial_splits")
+		col.label(text="Threads:")
+		col.row().prop(rd, "threads_mode", expand=True)
+		sub = col.column()
+		sub.enabled = rd.threads_mode == 'FIXED'
+		sub.prop(rd, "threads")
 
 		sub = col.column(align=True)
+		sub.label(text="Tiles:")
 		sub.prop(cycles, "debug_tile_size")
 		sub.prop(cycles, "debug_min_size")
 
-		col = split.column(align=True)
-		col.prop(cycles, "debug_cancel_timeout")
-		col.prop(cycles, "debug_reset_timeout")
-		col.prop(cycles, "debug_text_timeout")
+		col = split.column()
 
+		sub = col.column(align=True)
+		sub.label(text="Acceleration structure:")
+		sub.prop(cycles, "debug_bvh_type", text="")
+		sub.prop(cycles, "debug_use_spatial_splits")
+
 class Cycles_PT_post_processing(CyclesButtonsPanel, bpy.types.Panel):
 	bl_label = "Post Processing"
 	bl_options = {'DEFAULT_CLOSED'}

Modified: branches/cycles/intern/cycles/blender/addon/xml.py
===================================================================
--- branches/cycles/intern/cycles/blender/addon/xml.py	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/blender/addon/xml.py	2011-08-24 10:44:04 UTC (rev 39671)
@@ -61,7 +61,7 @@
 		if not object:
 			raise Exception("No active object")
 
-		mesh = object.create_mesh(scene, True, 'PREVIEW')
+		mesh = object.to_mesh(scene, True, 'PREVIEW')
 
 		if not mesh:
 			raise Exception("No mesh data in active object")

Modified: branches/cycles/intern/cycles/blender/blender_sync.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_sync.cpp	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/blender/blender_sync.cpp	2011-08-24 10:44:04 UTC (rev 39671)
@@ -192,6 +192,7 @@
 			params.device_type = dtype;
 
 	/* other parameters */
+	params.threads = b_scene.render().threads();
 	params.background = background;
 	params.passes = (background)? get_int(cscene, "passes"): INT_MAX;
 	params.tile_size = get_int(cscene, "debug_tile_size");

Modified: branches/cycles/intern/cycles/cmake/external_libs.cmake
===================================================================
--- branches/cycles/intern/cycles/cmake/external_libs.cmake	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/cmake/external_libs.cmake	2011-08-24 10:44:04 UTC (rev 39671)
@@ -94,13 +94,11 @@
 	set(CYCLES_CUDA_ARCH sm_10 sm_11 sm_12 sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build for")
 	set(CYCLES_CUDA_MAXREG 24 CACHE STRING "CUDA maximum number of register to use")
 
-	find_library(CUDA_LIBRARIES NAMES cuda PATHS ${CYCLES_CUDA}/lib ${CYCLES_CUDA}/lib/Win32 NO_DEFAULT_PATH)
 	find_path(CUDA_INCLUDES cuda.h ${CYCLES_CUDA}/include NO_DEFAULT_PATH)
 	find_program(CUDA_NVCC NAMES nvcc PATHS ${CYCLES_CUDA}/bin NO_DEFAULT_PATH)
 
-	if(CUDA_INCLUDES AND CUDA_LIBRARIES AND CUDA_NVCC)
+	if(CUDA_INCLUDES AND CUDA_NVCC)
 		message(STATUS "CUDA includes = ${CUDA_INCLUDES}")
-		message(STATUS "CUDA library = ${CUDA_LIBRARIES}")
 		message(STATUS "CUDA nvcc = ${CUDA_NVCC}")
 	else()
 		message(STATUS "CUDA not found")

Modified: branches/cycles/intern/cycles/device/device.cpp
===================================================================
--- branches/cycles/intern/cycles/device/device.cpp	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/device/device.cpp	2011-08-24 10:44:04 UTC (rev 39671)
@@ -99,13 +99,13 @@
 	glPixelZoom(1.0f, 1.0f);
 }
 
-Device *Device::create(DeviceType type, bool background)
+Device *Device::create(DeviceType type, bool background, int threads)
 {
 	Device *device;
 
 	switch(type) {
 		case DEVICE_CPU:
-			device = device_cpu_create();
+			device = device_cpu_create(threads);
 			break;
 #ifdef WITH_CUDA
 		case DEVICE_CUDA:

Modified: branches/cycles/intern/cycles/device/device.h
===================================================================
--- branches/cycles/intern/cycles/device/device.h	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/device/device.h	2011-08-24 10:44:04 UTC (rev 39671)
@@ -123,7 +123,7 @@
 #endif
 
 	/* static */
-	static Device *create(DeviceType type, bool background = true);
+	static Device *create(DeviceType type, bool background = true, int threads = 0);
 
 	static DeviceType type_from_string(const char *name);
 	static string string_from_type(DeviceType type);

Modified: branches/cycles/intern/cycles/device/device_cpu.cpp
===================================================================
--- branches/cycles/intern/cycles/device/device_cpu.cpp	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/device/device_cpu.cpp	2011-08-24 10:44:04 UTC (rev 39671)
@@ -44,11 +44,15 @@
 	ThreadQueue<DeviceTask> tasks;
 	KernelGlobals *kg;
 	
-	CPUDevice()
+	CPUDevice(int threads_num)
 	{
 		kg = kernel_globals_create();
-		threads.resize(system_cpu_thread_count());
 
+		if(threads_num == 0)
+			threads_num = system_cpu_thread_count();
+
+		threads.resize(threads_num);
+
 		for(size_t i = 0; i < threads.size(); i++)
 			threads[i] = new thread(function_bind(&CPUDevice::thread_run, this, i));
 	}
@@ -207,9 +211,9 @@
 	}
 };
 
-Device *device_cpu_create()
+Device *device_cpu_create(int threads)
 {
-	return new CPUDevice();
+	return new CPUDevice(threads);
 }
 
 CCL_NAMESPACE_END

Modified: branches/cycles/intern/cycles/device/device_intern.h
===================================================================
--- branches/cycles/intern/cycles/device/device_intern.h	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/device/device_intern.h	2011-08-24 10:44:04 UTC (rev 39671)
@@ -23,7 +23,7 @@
 
 class Device;
 
-Device *device_cpu_create();
+Device *device_cpu_create(int threads);
 Device *device_opencl_create(bool background);
 Device *device_cuda_create(bool background);
 Device *device_network_create(const char *address);

Modified: branches/cycles/intern/cycles/render/session.cpp
===================================================================
--- branches/cycles/intern/cycles/render/session.cpp	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/render/session.cpp	2011-08-24 10:44:04 UTC (rev 39671)
@@ -37,7 +37,7 @@
 {
 	device_use_gl = (params.device_type == DEVICE_CUDA && !params.background);
 
-	device = Device::create(params.device_type, params.background);
+	device = Device::create(params.device_type, params.background, params.threads);
 	buffers = new RenderBuffers(device);
 	display = new DisplayBuffer(device);
 

Modified: branches/cycles/intern/cycles/render/session.h
===================================================================
--- branches/cycles/intern/cycles/render/session.h	2011-08-24 09:44:08 UTC (rev 39670)
+++ branches/cycles/intern/cycles/render/session.h	2011-08-24 10:44:04 UTC (rev 39671)
@@ -46,6 +46,7 @@
 	int passes;
 	int tile_size;
 	int min_size;
+	int threads;
 
 	double cancel_timeout;
 	double reset_timeout;
@@ -61,6 +62,7 @@
 		passes = INT_MAX;
 		tile_size = 64;
 		min_size = 64;
+		threads = 0;
 
 		cancel_timeout = 0.1;
 		reset_timeout = 0.1;
@@ -75,6 +77,7 @@
 		&& progressive == params.progressive
 		&& tile_size == params.tile_size
 		&& min_size == params.min_size
+		&& threads == params.threads
 		&& cancel_timeout == params.cancel_timeout
 		&& reset_timeout == params.reset_timeout
 		&& text_timeout == params.text_timeout); }




More information about the Bf-blender-cvs mailing list