Mesa (main): radv: Support shader compilation without LLVM dependencies

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 1 09:05:43 UTC 2021


Module: Mesa
Branch: main
Commit: d0ec3582af7ecd32669985cec8de77fc0c93148c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0ec3582af7ecd32669985cec8de77fc0c93148c

Author: Emmanuel Gil Peyrot <linkmauve at linkmauve.fr>
Date:   Thu Aug  6 14:16:35 2020 +0200

radv: Support shader compilation without LLVM dependencies

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11319>

---

 src/amd/vulkan/radv_shader.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 427df7f209f..f98154108b0 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -33,20 +33,22 @@
 #include "util/mesa-sha1.h"
 #include "util/u_atomic.h"
 #include "radv_debug.h"
-#include "radv_llvm_helper.h"
 #include "radv_private.h"
 #include "radv_shader_args.h"
 
 #include "util/debug.h"
 #include "ac_binary.h"
 #include "ac_exp_param.h"
-#include "ac_llvm_util.h"
 #include "ac_nir.h"
 #include "ac_rtld.h"
 #include "aco_interface.h"
 #include "sid.h"
 #include "vk_format.h"
 
+#ifdef LLVM_AVAILABLE
+#include "ac_llvm_util.h"
+#endif
+
 void
 radv_get_nir_options(struct radv_physical_device *device)
 {
@@ -1587,11 +1589,15 @@ shader_variant_compile(struct radv_device *device, struct vk_shader_module *modu
       shader_count >= 2,
       shader_count >= 2 ? shaders[shader_count - 2]->info.stage : MESA_SHADER_VERTEX);
 
+#ifdef LLVM_AVAILABLE
    if (radv_use_llvm_for_stage(device, stage) || options->dump_shader || options->record_ir)
       ac_init_llvm_once();
 
    if (radv_use_llvm_for_stage(device, stage)) {
       llvm_compile_shader(device, shader_count, shaders, &binary, &args);
+#else
+   if (false) {
+#endif
    } else {
       aco_compile_shader(shader_count, shaders, &binary, &args);
    }



More information about the mesa-commit mailing list