forked from bartvdbraak/blender
Cycles: fix opencl device bug that crashed on windows. Now shows diffuse
meshes here on windows/nvidia.
This commit is contained in:
parent
8ddef5163f
commit
1f7ac51c36
@ -140,13 +140,14 @@ public:
|
||||
/* 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);
|
||||
|
||||
|
@ -377,7 +377,7 @@ __device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd,
|
||||
#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
|
||||
|
||||
|
@ -130,7 +130,7 @@ static void clewExit(void)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user