diff options
author | George Kyriazis <[email protected]> | 2018-01-29 12:41:20 -0600 |
---|---|---|
committer | George Kyriazis <[email protected]> | 2018-02-16 10:53:58 -0600 |
commit | 8bce71622ed37352244ead51a72f6e98587bbee2 (patch) | |
tree | 7d0c04499d7f879fa040556c689a657a18c87751 /src/gallium/drivers/swr | |
parent | 5697dc3e2354107271e1a541c32e43be435ddda8 (diff) |
swr/rast: Cleanup of mpPrivateContext in Builder
Provide access functions for mpPrivateContext in Builder.
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/jitter/builder.cpp | 3 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/jitter/builder.h | 10 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp index 1b03d1c0709..9f9438de1d8 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/builder.cpp @@ -39,7 +39,8 @@ namespace SwrJit /// @brief Contructor for Builder. /// @param pJitMgr - JitManager which contains modules, function passes, etc. Builder::Builder(JitManager *pJitMgr) - : mpJitMgr(pJitMgr) + : mpJitMgr(pJitMgr), + mpPrivateContext(nullptr) { SWR_ASSERT(pJitMgr->mVWidth == 8); diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder.h b/src/gallium/drivers/swr/rasterizer/jitter/builder.h index 788c5b23aa6..763d29fdf65 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/builder.h +++ b/src/gallium/drivers/swr/rasterizer/jitter/builder.h @@ -97,6 +97,16 @@ namespace SwrJit #include "builder_mem.h" protected: + + void SetPrivateContext(Value* pPrivateContext) + { + mpPrivateContext = pPrivateContext; + NotifyPrivateContextSet(); + } + virtual void NotifyPrivateContextSet() {} + inline Value* GetPrivateContext() { return mpPrivateContext; } + + private: Value* mpPrivateContext; }; diff --git a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp index 4f56bda83df..9bb62976f60 100644 --- a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp +++ b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp @@ -148,8 +148,9 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState) auto argitr = fetch->arg_begin(); // Fetch shader arguments - mpPrivateContext = &*argitr; ++argitr; - mpPrivateContext->setName("privateContext"); + Value* privateContext = &*argitr; ++argitr; + privateContext->setName("privateContext"); + SetPrivateContext(privateContext); mpFetchInfo = &*argitr; ++argitr; mpFetchInfo->setName("fetchInfo"); |