Mesa (main): compiler/clc: Preserve OCL kernel arg type metadata on LLVM13
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Oct 4 18:43:26 UTC 2021
Module: Mesa
Branch: main
Commit: 82c69c9a9dc0c4976b43fb6057cde89ee2f01588
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=82c69c9a9dc0c4976b43fb6057cde89ee2f01588
Author: Jesse Natalie <jenatali at microsoft.com>
Date: Mon Oct 4 09:32:02 2021 -0700
compiler/clc: Preserve OCL kernel arg type metadata on LLVM13
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13177>
---
src/compiler/clc/clc_helpers.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp
index fc481467194..c5b0f29eaab 100644
--- a/src/compiler/clc/clc_helpers.cpp
+++ b/src/compiler/clc/clc_helpers.cpp
@@ -914,6 +914,11 @@ llvm_mod_to_spirv(std::unique_ptr<::llvm::Module> mod,
}
SPIRV::TranslatorOpts spirv_opts = SPIRV::TranslatorOpts(version, ext_map);
+#if LLVM_VERSION_MAJOR >= 13
+ /* This was the default in 12.0 and older, but currently we'll fail to parse without this */
+ spirv_opts.setPreserveOCLKernelArgTypeMetadataThroughString(true);
+#endif
+
std::ostringstream spv_stream;
if (!::llvm::writeSpirv(mod.get(), spirv_opts, spv_stream, log)) {
clc_error(logger, "%sTranslation from LLVM IR to SPIR-V failed.\n",
More information about the mesa-commit
mailing list