Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-04-10 16:31:21 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-04-10 16:31:21 +0300
commit9539cfacca8ca2aeda1ff48113b6db872ff38eed (patch)
treed0765327d5b58dc97f228ca964001911289331b0
parent3b4cc5dfed03d5e1d79c756349f25b6c63103991 (diff)
Cycles: Apparently board name could be an empty string
-rw-r--r--intern/cycles/device/opencl/opencl_util.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index 6dca642f3f3..fe1c65a2224 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -1058,13 +1058,16 @@ cl_device_type OpenCLInfo::get_device_type(cl_device_id device_id)
string OpenCLInfo::get_readable_device_name(cl_device_id device_id)
{
char board_name[1024];
+ size_t length = 0;
if(clGetDeviceInfo(device_id,
CL_DEVICE_BOARD_NAME_AMD,
sizeof(board_name),
&board_name,
- NULL) == CL_SUCCESS)
+ &length) == CL_SUCCESS)
{
- return board_name;
+ if(length != 0 && board_name[0] != '\0') {
+ return board_name;
+ }
}
/* Fallback to standard device name API. */
return get_device_name(device_id);