[Mesa-dev] [PATCH v3 04/21] clover: Add an helper for checking if an IR is supported

Pierre Moreau pierre.morrow at free.fr
Wed Feb 21 22:50:29 UTC 2018


Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
---

Notes:
    v3:
    * Dropped supported_irs() (Francisco Jerez)
    * Changed supports_ir() argument type to `enum pipe_shader_ir` (Francisco Jerez)

 src/gallium/state_trackers/clover/core/device.cpp | 6 ++++++
 src/gallium/state_trackers/clover/core/device.hpp | 1 +
 2 files changed, 7 insertions(+)

diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 71cf4bf60a..dac03fccb9 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -275,3 +275,9 @@ std::string
 device::device_clc_version() const {
     return "1.1";
 }
+
+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);
+}
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index 85cd031676..ebe15f28e9 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -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;
-- 
2.16.2



More information about the mesa-dev mailing list