mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
radeon/llvm: Don't use the global context when parsing LLVM IR
This leads to crashes when multiple threads try to compile compute shaders in the same time. Fixes a crash in bfgminer when using more than one thread.
This commit is contained in:
parent
bd850cb4f2
commit
7cc98ea88f
1 changed files with 3 additions and 2 deletions
|
|
@ -34,11 +34,12 @@ LLVMModuleRef radeon_llvm_parse_bitcode(const unsigned char * bitcode,
|
|||
unsigned bitcode_len)
|
||||
{
|
||||
LLVMMemoryBufferRef buf;
|
||||
LLVMModuleRef module = LLVMModuleCreateWithName("radeon");
|
||||
LLVMContextRef ctx = LLVMContextCreate();
|
||||
LLVMModuleRef module;
|
||||
|
||||
buf = LLVMCreateMemoryBufferWithMemoryRangeCopy((const char*)bitcode,
|
||||
bitcode_len, "radeon");
|
||||
LLVMParseBitcode(buf, &module, NULL);
|
||||
LLVMParseBitcodeInContext(ctx, buf, &module, NULL);
|
||||
return module;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue