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
This commit is contained in:
Soren Jorvang 2010-05-30 08:08:26 +00:00
parent 2245b1040f
commit 9cd3c70b02

View File

@ -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!");