[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42800] branches/soc-2011-tomato: Merging r42770 through r42799 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Wed Dec 21 15:50:10 CET 2011
Revision: 42800
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42800
Author: nazgul
Date: 2011-12-21 14:50:05 +0000 (Wed, 21 Dec 2011)
Log Message:
-----------
Merging r42770 through r42799 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42770
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42799
Modified Paths:
--------------
branches/soc-2011-tomato/intern/cycles/device/device.cpp
branches/soc-2011-tomato/intern/cycles/device/device.h
branches/soc-2011-tomato/intern/cycles/device/device_cuda.cpp
branches/soc-2011-tomato/intern/cycles/device/device_opencl.cpp
branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt
branches/soc-2011-tomato/intern/cycles/kernel/kernel_compat_opencl.h
branches/soc-2011-tomato/intern/cycles/render/buffers.h
branches/soc-2011-tomato/intern/cycles/render/session.cpp
branches/soc-2011-tomato/intern/cycles/render/tile.cpp
branches/soc-2011-tomato/intern/cycles/render/tile.h
branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_view3d.py
branches/soc-2011-tomato/source/blender/blenfont/intern/blf_lang.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
branches/soc-2011-tomato/source/blender/blenlib/CMakeLists.txt
branches/soc-2011-tomato/source/blender/blenloader/CMakeLists.txt
branches/soc-2011-tomato/source/blender/blenloader/SConscript
branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
branches/soc-2011-tomato/source/blender/editors/include/ED_mesh.h
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/interface/interface_handlers.c
branches/soc-2011-tomato/source/blender/editors/interface/interface_widgets.c
branches/soc-2011-tomato/source/blender/editors/mesh/editface.c
branches/soc-2011-tomato/source/blender/editors/mesh/meshtools.c
branches/soc-2011-tomato/source/blender/editors/object/object_edit.c
branches/soc-2011-tomato/source/blender/editors/object/object_intern.h
branches/soc-2011-tomato/source/blender/editors/object/object_modifier.c
branches/soc-2011-tomato/source/blender/editors/object/object_ops.c
branches/soc-2011-tomato/source/blender/imbuf/CMakeLists.txt
branches/soc-2011-tomato/source/blender/imbuf/intern/thumbs.c
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_movieclip.c
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Vector.c
branches/soc-2011-tomato/source/creator/CMakeLists.txt
Added Paths:
-----------
branches/soc-2011-tomato/source/blender/blenlib/BLI_md5.h
branches/soc-2011-tomato/source/blender/blenlib/intern/md5.c
Removed Paths:
-------------
branches/soc-2011-tomato/source/blender/imbuf/intern/md5.c
branches/soc-2011-tomato/source/blender/imbuf/intern/md5.h
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/source/blender/editors/space_outliner/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2011-cucumber:37517
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-42769
+ /branches/soc-2011-cucumber:37517
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-42799
Modified: branches/soc-2011-tomato/intern/cycles/device/device.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/device/device.cpp 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/device/device.cpp 2011-12-21 14:50:05 UTC (rev 42800)
@@ -24,6 +24,7 @@
#include "util_cuda.h"
#include "util_debug.h"
+#include "util_foreach.h"
#include "util_math.h"
#include "util_opencl.h"
#include "util_opengl.h"
@@ -41,9 +42,33 @@
{
}
-void DeviceTask::split(ThreadQueue<DeviceTask>& tasks, int num)
+void DeviceTask::split_max_size(list<DeviceTask>& tasks, int max_size)
{
+ int num;
+
if(type == DISPLACE) {
+ num = (displace_w + max_size - 1)/max_size;
+ }
+ else {
+ max_size = max(1, max_size/w);
+ num = (h + max_size - 1)/max_size;
+ }
+
+ split(tasks, num);
+}
+
+void DeviceTask::split(ThreadQueue<DeviceTask>& queue, int num)
+{
+ list<DeviceTask> tasks;
+ split(tasks, num);
+
+ foreach(DeviceTask& task, tasks)
+ queue.push(task);
+}
+
+void DeviceTask::split(list<DeviceTask>& tasks, int num)
+{
+ if(type == DISPLACE) {
num = min(displace_w, num);
for(int i = 0; i < num; i++) {
@@ -55,7 +80,7 @@
task.displace_x = tx;
task.displace_w = tw;
- tasks.push(task);
+ tasks.push_back(task);
}
}
else {
@@ -70,7 +95,7 @@
task.y = ty;
task.h = th;
- tasks.push(task);
+ tasks.push_back(task);
}
}
}
Modified: branches/soc-2011-tomato/intern/cycles/device/device.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/device/device.h 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/device/device.h 2011-12-21 14:50:05 UTC (rev 42800)
@@ -23,6 +23,7 @@
#include "device_memory.h"
+#include "util_list.h"
#include "util_string.h"
#include "util_thread.h"
#include "util_types.h"
@@ -67,7 +68,10 @@
int displace_x, displace_w;
DeviceTask(Type type = PATH_TRACE);
+
+ void split(list<DeviceTask>& tasks, int num);
void split(ThreadQueue<DeviceTask>& tasks, int num);
+ void split_max_size(list<DeviceTask>& tasks, int max_size);
};
/* Device */
Modified: branches/soc-2011-tomato/intern/cycles/device/device_cuda.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/device/device_cuda.cpp 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/device/device_cuda.cpp 2011-12-21 14:50:05 UTC (rev 42800)
@@ -221,7 +221,7 @@
cuDeviceComputeCapability(&major, &minor, cuDevId);
if(major <= 1 && minor <= 2) {
- cuda_error(string_printf("CUDA device supported only with shader model 1.3 or up, found %d.%d.", major, minor));
+ cuda_error(string_printf("CUDA device supported only with compute capability 1.3 or up, found %d.%d.", major, minor));
return false;
}
}
@@ -253,9 +253,9 @@
#if defined(WITH_CUDA_BINARIES) && defined(_WIN32)
if(major <= 1 && minor <= 2)
- cuda_error(string_printf("CUDA device supported only with shader model 1.3 or up, found %d.%d.", major, minor));
+ cuda_error(string_printf("CUDA device supported only compute capability 1.3 or up, found %d.%d.", major, minor));
else
- cuda_error(string_printf("CUDA binary kernel for this graphics card shader model (%d.%d) not found.", major, minor));
+ cuda_error(string_printf("CUDA binary kernel for this graphics card compute capability (%d.%d) not found.", major, minor));
return "";
#else
/* if not, find CUDA compiler */
Modified: branches/soc-2011-tomato/intern/cycles/device/device_opencl.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/device/device_opencl.cpp 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/device/device_opencl.cpp 2011-12-21 14:50:05 UTC (rev 42800)
@@ -25,6 +25,7 @@
#include "device.h"
#include "device_intern.h"
+#include "util_foreach.h"
#include "util_map.h"
#include "util_math.h"
#include "util_md5.h"
@@ -52,6 +53,7 @@
map<string, device_memory*> mem_map;
device_ptr null_mem;
bool device_initialized;
+ string platform_name;
const char *opencl_error_string(cl_int err)
{
@@ -175,6 +177,10 @@
if(opencl_error(ciErr))
return;
+ char name[256];
+ clGetPlatformInfo(cpPlatform, CL_PLATFORM_NAME, sizeof(name), &name, NULL);
+ platform_name = name;
+
cxContext = clCreateContext(0, 1, &cdDevice, NULL, NULL, &ciErr);
if(opencl_error(ciErr))
return;
@@ -191,7 +197,7 @@
{
char version[256];
- int major, minor, req_major = 1, req_minor = 0;
+ int major, minor, req_major = 1, req_minor = 1;
clGetPlatformInfo(cpPlatform, CL_PLATFORM_VERSION, sizeof(version), &version, NULL);
@@ -277,15 +283,12 @@
{
string build_options = " -cl-fast-relaxed-math ";
- /* Full Shading only on NVIDIA cards at the moment */
- char vendor[256];
+ /* full shading only on NVIDIA cards at the moment */
+ if(platform_name == "NVIDIA CUDA")
+ build_options += "-D__KERNEL_SHADING__ -D__MULTI_CLOSURE__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
+ if(platform_name == "Apple")
+ build_options += " -D__CL_NO_FLOAT3__ ";
- clGetPlatformInfo(cpPlatform, CL_PLATFORM_NAME, sizeof(vendor), &vendor, NULL);
- string name = vendor;
-
- if(name == "NVIDIA CUDA")
- build_options += "-D__KERNEL_SHADING__ -D__MULTI_CLOSURE__ ";
-
return build_options;
}
@@ -657,12 +660,24 @@
opencl_assert(clFinish(cqCommandQueue));
}
- void task_add(DeviceTask& task)
+ void task_add(DeviceTask& maintask)
{
- if(task.type == DeviceTask::TONEMAP)
- tonemap(task);
- else if(task.type == DeviceTask::PATH_TRACE)
- path_trace(task);
+ list<DeviceTask> tasks;
+
+ /* arbitrary limit to work around apple ATI opencl issue */
+ if(platform_name == "Apple")
+ maintask.split_max_size(tasks, 76800);
+ else
+ tasks.push_back(maintask);
+
+ DeviceTask task;
+
+ foreach(DeviceTask& task, tasks) {
+ if(task.type == DeviceTask::TONEMAP)
+ tonemap(task);
+ else if(task.type == DeviceTask::PATH_TRACE)
+ path_trace(task);
+ }
}
void task_wait()
Modified: branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt 2011-12-21 14:50:05 UTC (rev 42800)
@@ -143,7 +143,7 @@
#set(KERNEL_PREPROCESSED ${CMAKE_CURRENT_BINARY_DIR}/kernel_preprocessed.cl)
#add_custom_command(
# OUTPUT ${KERNEL_PREPROCESSED}
-# COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DWITH_OPENCL -o ${KERNEL_PREPROCESSED}
+# COMMAND gcc -x c++ -E ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cl -I ${CMAKE_CURRENT_SOURCE_DIR}/../util/ -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -o ${KERNEL_PREPROCESSED}
# DEPENDS ${SRC_KERNEL} ${SRC_UTIL_HEADERS})
#add_custom_target(cycles_kernel_preprocess ALL DEPENDS ${KERNEL_PREPROCESSED})
#delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${KERNEL_PREPROCESSED}" ${CYCLES_INSTALL_PATH}/kernel)
Modified: branches/soc-2011-tomato/intern/cycles/kernel/kernel_compat_opencl.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/kernel_compat_opencl.h 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/kernel/kernel_compat_opencl.h 2011-12-21 14:50:05 UTC (rev 42800)
@@ -25,12 +25,21 @@
/* no namespaces in opencl */
#define CCL_NAMESPACE_BEGIN
#define CCL_NAMESPACE_END
-#define WITH_OPENCL
+#ifdef __CL_NO_FLOAT3__
+#define float3 float4
+#endif
+
+#ifdef __CL_NOINLINE__
+#define __noinline __attribute__((noinline))
+#else
+#define __noinline
+#endif
+
/* in opencl all functions are device functions, so leave this empty */
#define __device
-#define __device_inline
-#define __device_noinline
+#define __device_inline __device
+#define __device_noinline __device __noinline
/* no assert in opencl */
#define kernel_assert(cond)
@@ -68,7 +77,11 @@
#endif
#define make_float2(x, y) ((float2)(x, y))
+#ifdef __CL_NO_FLOAT3__
+#define make_float3(x, y, z) ((float4)(x, y, z, 0.0))
+#else
#define make_float3(x, y, z) ((float3)(x, y, z))
+#endif
#define make_float4(x, y, z, w) ((float4)(x, y, z, w))
#define make_int2(x, y) ((int2)(x, y))
#define make_int3(x, y, z) ((int3)(x, y, z))
Modified: branches/soc-2011-tomato/intern/cycles/render/buffers.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/buffers.h 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/render/buffers.h 2011-12-21 14:50:05 UTC (rev 42800)
@@ -56,6 +56,12 @@
full_height = 0;
}
+ void get_offset_stride(int& offset, int& stride)
+ {
+ offset = -(full_x + full_y*width);
+ stride = width;
+ }
+
bool modified(const BufferParams& params)
{
return !(full_x == params.full_x
Modified: branches/soc-2011-tomato/intern/cycles/render/session.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/session.cpp 2011-12-21 14:35:48 UTC (rev 42799)
+++ branches/soc-2011-tomato/intern/cycles/render/session.cpp 2011-12-21 14:50:05 UTC (rev 42800)
@@ -515,10 +515,8 @@
knows nothing about progressive or cropped rendering, it just gets the
image dimensions passed in */
Camera *cam = scene->camera;
- float progressive_x = tile_manager.state.width/(float)tile_manager.params.width;
- float progressive_y = tile_manager.state.height/(float)tile_manager.params.height;
- int width = tile_manager.params.full_width*progressive_x;
- int height = tile_manager.params.full_height*progressive_y;
+ int width = tile_manager.state.buffer.full_width;
+ int height = tile_manager.state.buffer.full_height;
if(width != cam->width || height != cam->height) {
cam->width = width;
@@ -574,16 +572,15 @@
/* add path trace task */
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list