Commit fe107e3c authored by George Kyriazis's avatar George Kyriazis

swr/rast: jit shader lib debug work

Create shader_lib during build, link with shaders at DLL generation time
Reviewed-by: Bruce Cherniak's avatarBruce Cherniak <>
parent 0cd9ad98
......@@ -586,6 +586,11 @@ int ExecUnhookedProcess(const char* pCmdLine)
#if defined(_WIN64) && defined(ENABLE_JIT_DEBUG) && defined(JIT_BASE_DIR)
static __inline HINSTANCE GetModuleHINSTANCE() { return (HINSTANCE)&__ImageBase; }
/// notifyObjectCompiled - Provides a pointer to compiled code for Module M.
void JitCache::notifyObjectCompiled(const llvm::Module *M, llvm::MemoryBufferRef Obj)
......@@ -2890,6 +2890,10 @@ bool isComponentEnabled(ComponentEnable enableMask, uint8_t component)
// Don't want two threads compiling the same fetch shader simultaneously
// Has problems in the JIT cache implementation
// This is only a problem for fetch right now.
static std::mutex gFetchCodegenMutex;
/// @brief JITs from fetch shader IR
......@@ -2902,6 +2906,7 @@ PFN_FETCH_FUNC JitFetchFunc(HANDLE hJitMgr, const HANDLE hFunc)
JitManager* pJitMgr = reinterpret_cast<JitManager*>(hJitMgr);
pfnFetch = (PFN_FETCH_FUNC)(pJitMgr->mpExec->getFunctionAddress(func->getName().str()));
// MCJIT finalizes modules the first time you JIT code from them. After finalized, you cannot add new IR to the module
pJitMgr->mIsModuleFinalized = true;
......@@ -2916,6 +2921,7 @@ PFN_FETCH_FUNC JitFetchFunc(HANDLE hJitMgr, const HANDLE hFunc)
pJitMgr->DumpAsm(const_cast<llvm::Function*>(func), "final");
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment