Provide access functions for mpPrivateContext in Builder.
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
/// @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);
#include "builder_mem.h"
protected:
+
+ void SetPrivateContext(Value* pPrivateContext)
+ {
+ mpPrivateContext = pPrivateContext;
+ NotifyPrivateContextSet();
+ }
+ virtual void NotifyPrivateContextSet() {}
+ inline Value* GetPrivateContext() { return mpPrivateContext; }
+
+ private:
Value* mpPrivateContext;
};
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");