From d0ec3582af7ecd32669985cec8de77fc0c93148c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 6 Aug 2020 14:16:35 +0200 Subject: [PATCH] radv: Support shader compilation without LLVM dependencies Reviewed-by: Samuel Pitoiset Part-of: --- 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); }