diff options
author | Tim Rowley <[email protected]> | 2017-05-24 21:54:43 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-06-16 16:20:16 -0500 |
commit | a25093de7188d553dfd832626a4181bd36898604 (patch) | |
tree | c805707c5f313c79a63c3e5d4ee9693f1e9c3a81 /src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp | |
parent | 1c33dc77f7523134d17908e21bfa53e8d14cc67d (diff) |
swr/rast: Implement JIT shader caching to disk
Disabled by default; currently doesn't cache shaders (fs,gs,vs).
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp index 5daeea95d19..427884004f5 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/blend_jit.cpp @@ -514,10 +514,8 @@ struct BlendJit : public Builder Function* Create(const BLEND_COMPILE_STATE& state) { - static std::size_t jitNum = 0; - - std::stringstream fnName("BlendShader", std::ios_base::in | std::ios_base::out | std::ios_base::ate); - fnName << jitNum++; + std::stringstream fnName("BlendShader_", std::ios_base::in | std::ios_base::out | std::ios_base::ate); + fnName << ComputeCRC(0, &state, sizeof(state)); // blend function signature //typedef void(*PFN_BLEND_JIT_FUNC)(const SWR_BLEND_STATE*, simdvector&, simdvector&, uint32_t, BYTE*, simdvector&, simdscalari*, simdscalari*); @@ -536,6 +534,7 @@ struct BlendJit : public Builder FunctionType* fTy = FunctionType::get(IRB()->getVoidTy(), args, false); Function* blendFunc = Function::Create(fTy, GlobalValue::ExternalLinkage, fnName.str(), JM()->mpCurrentModule); + blendFunc->getParent()->setModuleIdentifier(blendFunc->getName()); BasicBlock* entry = BasicBlock::Create(JM()->mContext, "entry", blendFunc); |