Cycles: fix opencl device bug that crashed on windows. Now shows diffuse
meshes here on windows/nvidia.
This commit is contained in:
@@ -140,13 +140,14 @@ public:
|
|||||||
/* compile kernel */
|
/* compile kernel */
|
||||||
string source = string_printf("#include \"kernel.cl\" // %lf\n", time_dt());
|
string source = string_printf("#include \"kernel.cl\" // %lf\n", time_dt());
|
||||||
size_t source_len = source.size();
|
size_t source_len = source.size();
|
||||||
|
const char *source_str = source.c_str();
|
||||||
|
|
||||||
string build_options = "";
|
string build_options = "";
|
||||||
|
|
||||||
build_options += "-I " + path_get("kernel") + " -I " + path_get("util"); /* todo: escape path */
|
build_options += "-I " + path_get("kernel") + " -I " + path_get("util"); /* todo: escape path */
|
||||||
build_options += " -Werror -cl-fast-relaxed-math -cl-strict-aliasing";
|
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);
|
opencl_assert(ciErr);
|
||||||
|
|
||||||
|
@@ -377,7 +377,7 @@ __device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd,
|
|||||||
#ifdef __SVM__
|
#ifdef __SVM__
|
||||||
svm_eval_nodes(kg, sd, SHADER_TYPE_SURFACE, randb, path_flag);
|
svm_eval_nodes(kg, sd, SHADER_TYPE_SURFACE, randb, path_flag);
|
||||||
#else
|
#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);
|
sd->svm_closure_weight = make_float3(0.8f, 0.8f, 0.8f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -130,7 +130,7 @@ static void clewExit(void)
|
|||||||
int clLibraryInit()
|
int clLibraryInit()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const char *path = "opencl.dll";
|
const char *path = "OpenCL.dll";
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
const char *path = "/Library/Frameworks/OpenCL.framework/OpenCL";
|
const char *path = "/Library/Frameworks/OpenCL.framework/OpenCL";
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user