clover/spirv: pass list of supported extensions to the translator
authorKarol Herbst <kherbst@redhat.com>
Sat, 15 Aug 2020 19:49:05 +0000 (21:49 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 19:48:12 +0000 (19:48 +0000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5038>

src/gallium/frontends/clover/llvm/invocation.cpp

index 04db2f90e03da111fe0d37f98df950c29d771964..f7c0313be4dc7b688b3fa08de6cbc5dca4ab8e68 100644 (file)
@@ -316,7 +316,14 @@ namespace {
          std::min(static_cast<SPIRV::VersionNumber>(supported_versions.back()),
                   SPIRV::VersionNumber::MaximumVersion);
 
-      return SPIRV::TranslatorOpts(maximum_spirv_version);
+      SPIRV::TranslatorOpts::ExtensionsStatusMap spirv_extensions;
+      for (auto &ext : spirv::supported_extensions()) {
+         #define EXT(X) if (ext == #X) spirv_extensions.insert({ SPIRV::ExtensionID::X, true });
+         #include <LLVMSPIRVLib/LLVMSPIRVExtensions.inc>
+         #undef EXT
+      }
+
+      return SPIRV::TranslatorOpts(maximum_spirv_version, spirv_extensions);
    }
 #endif
 }