[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39854] branches/cycles/intern/cycles: Cycles: fix opencl device bug that crashed on windows.
Brecht Van Lommel
brechtvanlommel at pandora.be
Fri Sep 2 00:40:53 CEST 2011
Revision: 39854
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39854
Author: blendix
Date: 2011-09-01 22:40:52 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
Cycles: fix opencl device bug that crashed on windows. Now shows diffuse
meshes here on windows/nvidia.
Modified Paths:
--------------
branches/cycles/intern/cycles/device/device_opencl.cpp
branches/cycles/intern/cycles/kernel/kernel_shader.h
branches/cycles/intern/cycles/util/util_opencl.c
Modified: branches/cycles/intern/cycles/device/device_opencl.cpp
===================================================================
--- branches/cycles/intern/cycles/device/device_opencl.cpp 2011-09-01 21:47:46 UTC (rev 39853)
+++ branches/cycles/intern/cycles/device/device_opencl.cpp 2011-09-01 22:40:52 UTC (rev 39854)
@@ -140,13 +140,14 @@
/* compile kernel */
string source = string_printf("#include \"kernel.cl\" // %lf\n", time_dt());
size_t source_len = source.size();
+ const char *source_str = source.c_str();
string build_options = "";
build_options += "-I " + path_get("kernel") + " -I " + path_get("util"); /* todo: escape path */
build_options += " -Werror -cl-fast-relaxed-math -cl-strict-aliasing";
- cpProgram = clCreateProgramWithSource(cxContext, 1, (const char **)&source, &source_len, &ciErr);
+ cpProgram = clCreateProgramWithSource(cxContext, 1, (const char **)&source_str, &source_len, &ciErr);
opencl_assert(ciErr);
Modified: branches/cycles/intern/cycles/kernel/kernel_shader.h
===================================================================
--- branches/cycles/intern/cycles/kernel/kernel_shader.h 2011-09-01 21:47:46 UTC (rev 39853)
+++ branches/cycles/intern/cycles/kernel/kernel_shader.h 2011-09-01 22:40:52 UTC (rev 39854)
@@ -377,7 +377,7 @@
#ifdef __SVM__
svm_eval_nodes(kg, sd, SHADER_TYPE_SURFACE, randb, path_flag);
#else
- sd->svm_closure = CLOSURE_BSDF_DIFFUSE_ID;
+ bsdf_diffuse_setup(sd, sd->N);
sd->svm_closure_weight = make_float3(0.8f, 0.8f, 0.8f);
#endif
Modified: branches/cycles/intern/cycles/util/util_opencl.c
===================================================================
--- branches/cycles/intern/cycles/util/util_opencl.c 2011-09-01 21:47:46 UTC (rev 39853)
+++ branches/cycles/intern/cycles/util/util_opencl.c 2011-09-01 22:40:52 UTC (rev 39854)
@@ -130,7 +130,7 @@
int clLibraryInit()
{
#ifdef _WIN32
- const char *path = "opencl.dll";
+ const char *path = "OpenCL.dll";
#elif defined(__APPLE__)
const char *path = "/Library/Frameworks/OpenCL.framework/OpenCL";
#else
More information about the Bf-blender-cvs
mailing list