From: George Kyriazis Date: Mon, 29 Jan 2018 18:41:20 +0000 (-0600) Subject: swr/rast: Cleanup of mpPrivateContext in Builder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bce71622ed37352244ead51a72f6e98587bbee2;p=mesa.git swr/rast: Cleanup of mpPrivateContext in Builder Provide access functions for mpPrivateContext in Builder. Reviewed-by: Bruce Cherniak --- 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");