From 9cd3c70b02f85e617f4abc37afc79b4668a2d0ca Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Sun, 30 May 2010 08:08:26 +0000 Subject: [PATCH] The rendering codepath doesn't currently quite recover from an OpenCL initialization failure, so help it along a little by also considering the CPU as an OpenCL device. Use CL_DEVICE_TYPE_DEFAULT rather than CL_DEVICE_TYPE_ALL as that will give preference to the spiffy GPU if one is present. Implementations of OpenCL are likely to put a GPU as the first device in the list, but there is no guarantee of this and this code currently only picks the first device in the list. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5547 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/OpenCL.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Core/Common/Src/OpenCL.cpp b/Source/Core/Common/Src/OpenCL.cpp index f89c5f4131..f2713257fb 100644 --- a/Source/Core/Common/Src/OpenCL.cpp +++ b/Source/Core/Common/Src/OpenCL.cpp @@ -86,9 +86,7 @@ bool Initialize() cl_context_properties* cprops = (NULL == platform) ? NULL : cps; - int gpu = 1; // I think we should use CL_DEVICE_TYPE_ALL - - err = clGetDeviceIDs(platform, gpu ? CL_DEVICE_TYPE_GPU : CL_DEVICE_TYPE_CPU, 1, &device_id, NULL); + err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_DEFAULT, 1, &device_id, NULL); if (err != CL_SUCCESS) { HandleCLError(err, "Failed to create a device group!");