Lines Matching refs:rsc
47 Context * rsc = tls->mContext; \
50 ScriptC::ScriptC(Context *rsc) : Script(rsc) { in ScriptC() argument
114 void ScriptC::setupScript(Context *rsc) { in setupScript() argument
125 rsc->mHal.funcs.script.setGlobalBind(rsc, this, ct, mSlots[ct].get()); in setupScript()
129 void ScriptC::setupGLState(Context *rsc) { in setupGLState() argument
132 rsc->setProgramStore(mEnviroment.mFragmentStore.get()); in setupGLState()
135 rsc->setProgramFragment(mEnviroment.mFragment.get()); in setupGLState()
138 rsc->setProgramVertex(mEnviroment.mVertex.get()); in setupGLState()
141 rsc->setProgramRaster(mEnviroment.mRaster.get()); in setupGLState()
146 uint32_t ScriptC::run(Context *rsc) { in run() argument
148 rsc->setError(RS_ERROR_BAD_SCRIPT, "Attempted to run bad script"); in run()
152 setupGLState(rsc); in run()
153 setupScript(rsc); in run()
157 if (rsc->props.mLogScripts) { in run()
158 ALOGV("%p ScriptC::run invoking root, ptr %p", rsc, mHal.info.root); in run()
161 ret = rsc->mHal.funcs.script.invokeRoot(rsc, this); in run()
163 if (rsc->props.mLogScripts) { in run()
164 ALOGV("%p ScriptC::run invoking complete, ret=%i", rsc, ret); in run()
171 void ScriptC::runForEach(Context *rsc, in runForEach() argument
180 rsc->setError(RS_ERROR_BAD_SCRIPT, in runForEach()
197 Context::PushState ps(rsc); in runForEach()
199 setupGLState(rsc); in runForEach()
200 setupScript(rsc); in runForEach()
202 if (rsc->props.mLogScripts) { in runForEach()
203 ALOGV("%p ScriptC::runForEach invoking slot %i, ptr %p", rsc, slot, this); in runForEach()
206 if (rsc->mHal.funcs.script.invokeForEachMulti != nullptr) { in runForEach()
207 rsc->mHal.funcs.script.invokeForEachMulti(rsc, this, slot, ains, inLen, in runForEach()
211 rsc->mHal.funcs.script.invokeForEach(rsc, this, slot, ains[0], aout, in runForEach()
215 rsc->setError(RS_ERROR_FATAL_DRIVER, in runForEach()
220 void ScriptC::runReduce(Context *rsc, uint32_t slot, in runReduce() argument
227 rsc->setError(RS_ERROR_BAD_SCRIPT, "The general reduce kernel index is out of bounds"); in runReduce()
232 setupScript(rsc); in runReduce()
234 if (rsc->props.mLogScripts) { in runReduce()
235 ALOGV("%p ScriptC::runReduce invoking slot %i, ptr %p", rsc, slot, this); in runReduce()
238 rsc->mHal.funcs.script.invokeReduce(rsc, this, slot, ains, inLen, aout, sc); in runReduce()
241 void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len) { in Invoke() argument
245 rsc->setError(RS_ERROR_BAD_SCRIPT, "The invokable index is out of bounds"); in Invoke()
250 setupScript(rsc); in Invoke()
252 if (rsc->props.mLogScripts) { in Invoke()
253 ALOGV("%p ScriptC::Invoke invoking slot %i, ptr %p", rsc, slot, this); in Invoke()
255 rsc->mHal.funcs.script.invokeFunction(rsc, this, slot, data, len); in Invoke()
294 bool ScriptC::runCompiler(Context *rsc, in runCompiler() argument
316 sdkVersion = rsc->getTargetSdkVersion(); in runCompiler()
341 rsc->setOptLevel(bcWrapper.getOptimizationLevel()); in runCompiler()
355 if (!rsc->mHal.funcs.script.init(rsc, this, resName, cacheDir, bitcode, bitcodeLen, 0)) { in runCompiler()
361 mEnviroment.mFragment.set(rsc->getDefaultProgramFragment()); in runCompiler()
362 mEnviroment.mVertex.set(rsc->getDefaultProgramVertex()); in runCompiler()
363 mEnviroment.mFragmentStore.set(rsc->getDefaultProgramStore()); in runCompiler()
364 mEnviroment.mRaster.set(rsc->getDefaultProgramRaster()); in runCompiler()
367 rsc->mHal.funcs.script.invokeInit(rsc, this); in runCompiler()
442 RsScript rsi_ScriptCCreate(Context *rsc, in rsi_ScriptCCreate() argument
447 ScriptC *s = new ScriptC(rsc); in rsi_ScriptCCreate()
449 if (!s->runCompiler(rsc, resName, cacheDir, (uint8_t *)text, text_length)) { in rsi_ScriptCCreate()