aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-08-21 16:43:55 +1000
committerDave Airlie <[email protected]>2019-08-27 12:30:10 +1000
commitabfb633968d172c86d6e913d2087406893f4cc71 (patch)
treef9609cdd4ab9838e6d6af06ff7e8b0a5b2086090
parent8b7295f2815842331e9d12489bf0517b3f272334 (diff)
gallivm: add support for fences api on older llvm
Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp11
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.h5
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 5fe697346fe..347381f9b32 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -836,3 +836,14 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr,
SingleThread ? llvm::SynchronizationScope::SingleThread : llvm::SynchronizationScope::CrossThread));
}
#endif
+
+#if HAVE_LLVM < 0x305
+LLVMValueRef LLVMBuildFence(LLVMBuilderRef B,
+ LLVMAtomicOrdering ordering,
+ LLVMBool singleThread,
+ const char *Name)
+{
+ return llvm::wrap(llvm::unwrap(B)->CreateFence(mapFromLLVMOrdering(ordering),
+ singleThread ? llvm::SynchronizationScope::SingleThread : llvm::SynchronizationScope::CrossThread));
+}
+#endif
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
index 629751502e7..67c2cfd3fc4 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
@@ -85,6 +85,11 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr,
LLVMBool SingleThread);
#endif
+#if HAVE_LLVM < 0x305
+LLVMValueRef LLVMBuildFence(LLVMBuilderRef B,
+ LLVMAtomicOrdering ordering,
+ LLVMBool singleThread, const char *Name);
+#endif
#ifdef __cplusplus
}
#endif