Signed-off-by: Pierre Moreau <pierre.mor...@free.fr>
---

Notes:
    Changes in v4: do not advertise SPIR-V support if CLOVER_ALLOW_SPIRV is not 
defined

    v3: Advertise cl_khr_il_program if if the device support NATIVE as IR

 src/gallium/state_trackers/clover/api/platform.cpp | 2 ++
 src/gallium/state_trackers/clover/core/device.cpp  | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/api/platform.cpp 
b/src/gallium/state_trackers/clover/api/platform.cpp
index 94d883c1f0..54a35c5dc5 100644
--- a/src/gallium/state_trackers/clover/api/platform.cpp
+++ b/src/gallium/state_trackers/clover/api/platform.cpp
@@ -111,6 +111,8 @@ clover::GetExtensionFunctionAddress(const char *p_name) {
 
    if (name == "clIcdGetPlatformIDsKHR")
       return reinterpret_cast<void *>(IcdGetPlatformIDsKHR);
+   else if (name == "clCreateProgramWithILKHR")
+      return reinterpret_cast<void *>(CreateProgramWithILKHR);
    else
       return NULL;
 }
diff --git a/src/gallium/state_trackers/clover/core/device.cpp 
b/src/gallium/state_trackers/clover/core/device.cpp
index 21de0e3d61..b9a26e4eec 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -285,6 +285,11 @@ device::supports_ir(enum pipe_shader_ir ir) const {
 
 std::string
 device::supported_extensions() const {
+#ifdef CLOVER_ALLOW_SPIRV
+   const bool supports_il_program = supports_ir(PIPE_SHADER_IR_NATIVE);
+#else
+   const bool supports_il_program = false;
+#endif
    return
       "cl_khr_byte_addressable_store"
       " cl_khr_global_int32_base_atomics"
@@ -294,5 +299,6 @@ device::supported_extensions() const {
       + std::string(has_int64_atomics() ? " cl_khr_int64_base_atomics" : "")
       + std::string(has_int64_atomics() ? " cl_khr_int64_extended_atomics" : 
"")
       + std::string(has_doubles() ? " cl_khr_fp64" : "")
-      + std::string(has_halves() ? " cl_khr_fp16" : "");
+      + std::string(has_halves() ? " cl_khr_fp16" : "")
+      + std::string(supports_il_program ? " cl_khr_il_program" : "");
 }
-- 
2.16.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to