summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2017-01-31 17:05:19 -0600
committerTim Rowley <[email protected]>2017-02-08 13:58:13 -0600
commitc1aa444a3edb4347fb475b1ee4e2dccdb99272fe (patch)
tree3361e49d5b87c3486005f1ffc95d2664a8912350 /src/gallium/drivers/swr
parente0a829d320d7af1c543f722b540dd142c672ffc9 (diff)
swr: [rasterizer jitter] Pass LLVM-IR size into jitter
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp4
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/JitManager.h2
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/jit_api.h1
3 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 5bd21a1cf02..64147960a89 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -190,9 +190,9 @@ void JitManager::SetupNewModule()
//////////////////////////////////////////////////////////////////////////
/// @brief Create new LLVM module from IR.
-bool JitManager::SetupModuleFromIR(const uint8_t *pIR)
+bool JitManager::SetupModuleFromIR(const uint8_t *pIR, size_t length)
{
- std::unique_ptr<MemoryBuffer> pMem = MemoryBuffer::getMemBuffer(StringRef((const char*)pIR), "");
+ std::unique_ptr<MemoryBuffer> pMem = MemoryBuffer::getMemBuffer(StringRef((const char*)pIR, length), "");
SMDiagnostic Err;
std::unique_ptr<Module> newModule = parseIR(pMem.get()->getMemBufferRef(), Err, mContext);
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
index e45ad142b32..170bdde81a8 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.h
@@ -178,7 +178,7 @@ struct JitManager
std::string mCore;
void SetupNewModule();
- bool SetupModuleFromIR(const uint8_t *pIR);
+ bool SetupModuleFromIR(const uint8_t *pIR, size_t length);
void DumpAsm(llvm::Function* pFunction, const char* fileName);
static void DumpToFile(llvm::Function *f, const char *fileName);
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h b/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
index 8a08031f253..b072eb33e95 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/jit_api.h
@@ -59,6 +59,7 @@ struct JIT_COMPILE_INPUT
SWR_SHADER_TYPE type;
const void* pIR; ///< Pointer to LLVM IR text.
+ size_t irLength;
bool enableJitSampler;
};