diff options
author | Marek Olšák <[email protected]> | 2016-12-13 18:42:08 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-01-06 21:05:48 +0100 |
commit | 42920c0fb98eee586000eee3b122c57d8374e42f (patch) | |
tree | 7e37ec10fd0699c3ef9bf014e888db9011d7e4c8 | |
parent | a8374c3d22d6ca110c6418373ee1e2e54ff918a1 (diff) |
radeonsi: clean up more HAVE_LLVM #ifdefs
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeon/r600_pipe_common.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 19 |
2 files changed, 20 insertions, 13 deletions
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 5e3fcb95c9e..28bb791707e 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -43,6 +43,10 @@ #define HAVE_LLVM 0 #endif +#ifndef MESA_LLVM_VERSION_PATCH +#define MESA_LLVM_VERSION_PATCH 0 +#endif + struct r600_multi_fence { struct pipe_reference reference; struct pipe_fence_handle *gfx; @@ -1213,11 +1217,11 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen, snprintf(kernel_version, sizeof(kernel_version), " / %s", uname_data.release); -#if HAVE_LLVM - snprintf(llvm_string, sizeof(llvm_string), - ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff, - HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH); -#endif + if (HAVE_LLVM > 0) { + snprintf(llvm_string, sizeof(llvm_string), + ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff, + HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH); + } snprintf(rscreen->renderer_string, sizeof(rscreen->renderer_string), "%s (DRM %i.%i.%i%s%s)", diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 72cf8270c78..f18aa82987b 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -1771,16 +1771,19 @@ static void declare_system_value( value = LLVMGetParam(radeon_bld->main_fn, SI_PARAM_THREAD_ID); break; -#if HAVE_LLVM >= 0x0309 case TGSI_SEMANTIC_HELPER_INVOCATION: - value = lp_build_intrinsic(gallivm->builder, - "llvm.amdgcn.ps.live", - ctx->i1, NULL, 0, - LP_FUNC_ATTR_READNONE); - value = LLVMBuildNot(gallivm->builder, value, ""); - value = LLVMBuildSExt(gallivm->builder, value, ctx->i32, ""); + if (HAVE_LLVM >= 0x0309) { + value = lp_build_intrinsic(gallivm->builder, + "llvm.amdgcn.ps.live", + ctx->i1, NULL, 0, + LP_FUNC_ATTR_READNONE); + value = LLVMBuildNot(gallivm->builder, value, ""); + value = LLVMBuildSExt(gallivm->builder, value, ctx->i32, ""); + } else { + assert(!"TGSI_SEMANTIC_HELPER_INVOCATION unsupported"); + return; + } break; -#endif default: assert(!"unknown system value"); |