diff options
Diffstat (limited to 'src/gallium/drivers/radeon')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_llvm_emit.cpp | 12 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_llvm_emit.h | 11 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp index a23532bee5f..9c5fd78f1e1 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp @@ -96,9 +96,8 @@ radeon_llvm_shader_type(LLVMValueRef F, unsigned type) * caller's responsibility to free it. */ extern "C" unsigned -radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes, - unsigned * byte_count, const char * gpu_family, - unsigned dump) { +radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary, + const char * gpu_family, unsigned dump) { Triple AMDGPUTriple(sys::getDefaultTargetTriple()); @@ -155,9 +154,10 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes, out.flush(); std::string &data = oStream.str(); - *bytes = (unsigned char*)malloc(data.length() * sizeof(unsigned char)); - memcpy(*bytes, data.c_str(), data.length() * sizeof(unsigned char)); - *byte_count = data.length(); + + binary->code = (unsigned char*)malloc(data.length() * sizeof(unsigned char)); + memcpy(binary->code, data.c_str(), data.length() * sizeof(unsigned char)); + binary->code_size = data.length(); return 0; } diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.h b/src/gallium/drivers/radeon/radeon_llvm_emit.h index b68100f372f..f78fc19faf7 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.h +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.h @@ -29,6 +29,14 @@ #include <llvm-c/Core.h> +struct radeon_llvm_binary { + unsigned char *code; + unsigned code_size; + unsigned char *config; + unsigned config_size; +}; + + #ifdef __cplusplus extern "C" { #endif @@ -42,8 +50,7 @@ unsigned radeon_llvm_bitcode_compile( unsigned radeon_llvm_compile( LLVMModuleRef M, - unsigned char ** bytes, - unsigned * byte_count, + struct radeon_llvm_binary *binary, const char * gpu_family, unsigned dump); |