clover: Only use devices supporting IR_NATIVE
authorPierre Moreau <pierre.morrow@free.fr>
Wed, 30 Jan 2019 17:38:18 +0000 (18:38 +0100)
committerKarol Herbst <kherbst@redhat.com>
Tue, 26 Feb 2019 20:02:07 +0000 (21:02 +0100)
Currently clover will advertise any device that advertises
PIPE_CAP_COMPUTE, even if they do not support PIPE_SHADER_IR_NATIVE,
which is the IR used internally by clover.
This avoids clover advertising devices as available even though they
actually are not supported.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/device.cpp

index 0c02039eba7695c1cceb6ad07d9eeac48334caac..de635454857941f2804a6256ff0f9f8999a3c5ec 100644 (file)
@@ -45,7 +45,8 @@ namespace {
 device::device(clover::platform &platform, pipe_loader_device *ldev) :
    platform(platform), ldev(ldev) {
    pipe = pipe_loader_create_screen(ldev);
-   if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) {
+   if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE) ||
+       !supports_ir(PIPE_SHADER_IR_NATIVE)) {
       if (pipe)
          pipe->destroy(pipe);
       throw error(CL_INVALID_DEVICE);