clover: Add an helper for checking if an IR is supported
authorPierre Moreau <pierre.morrow@free.fr>
Tue, 3 Oct 2017 19:07:45 +0000 (21:07 +0200)
committerKarol Herbst <kherbst@redhat.com>
Tue, 26 Feb 2019 20:02:07 +0000 (21:02 +0100)
Reviewed-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/device.cpp
src/gallium/state_trackers/clover/core/device.hpp

index 1fae465dae49f53fc884f92ac74e1bcc097a7318..010bae81403213798e790bdc0635ee113534ba73 100644 (file)
@@ -272,3 +272,9 @@ device::device_clc_version() const {
          debug_get_option("CLOVER_DEVICE_CLC_VERSION_OVERRIDE", "1.1");
    return device_clc_version;
 }
+
+bool
+device::supports_ir(enum pipe_shader_ir ir) const {
+   return pipe->get_shader_param(pipe, PIPE_SHADER_COMPUTE,
+                                 PIPE_SHADER_CAP_SUPPORTED_IRS) & (1 << ir);
+}
index 85cd031676d4b5ce0d7557108a99f3f472e55bb2..ebe15f28e93acbffdcb76856787d785f6419fc73 100644 (file)
@@ -82,6 +82,7 @@ namespace clover {
       enum pipe_shader_ir ir_format() const;
       std::string ir_target() const;
       enum pipe_endian endianness() const;
+      bool supports_ir(enum pipe_shader_ir ir) const;
 
       friend class command_queue;
       friend class root_resource;