Skip to content

Commit

Permalink
Now LuxCore works even if OpenCL is available but not a valid OpenCL …
Browse files Browse the repository at this point in the history
…ICD platform has been found (issue #422)
  • Loading branch information
Dade916 committed Aug 2, 2020
1 parent 3e143b6 commit 7a5724a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions release-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
### Fixed Bugs

* Added the support for pixel filtering to light tracing (issue #413)
* Now LuxCore will work even if OpenCL is available but not a valid OpenCL ICD platform has been found (issue #422)

Check https://wiki.luxcorerender.org/LuxCoreRender_Release_Notes for the full list
of release notes.
Expand Down
10 changes: 8 additions & 2 deletions src/luxrays/devices/ocldevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,14 @@ DeviceType OpenCLDeviceDescription::GetOCLDeviceType(const cl_device_id oclDevic

void OpenCLDeviceDescription::GetPlatformsList(std::vector<cl_platform_id> &platformsList) {
cl_uint platformsCount;
CHECK_OCL_ERROR(clGetPlatformIDs(0, nullptr, &platformsCount));

const cl_int err = clGetPlatformIDs(0, nullptr, &platformsCount);
// -1001 is CL_PLATFORM_NOT_FOUND_KHR and it means not a valid OpenCL ICD has been
// found so I just return an empty list.
if (err == -1001)
return;
else
CHECK_OCL_ERROR(err);

platformsList.resize(platformsCount);
CHECK_OCL_ERROR(clGetPlatformIDs(platformsCount, &platformsList[0], nullptr));
}
Expand Down

0 comments on commit 7a5724a

Please sign in to comment.