diff options
author | Stephen Hines <srhines@google.com> | 2013-03-29 22:08:49 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2013-04-01 17:35:28 -0700 |
commit | 1d476620399d54774e4fd386c1d23cc583d49522 (patch) | |
tree | 9442a79dd215d008158b76e063cb03163b0f177b /cpu_ref/rsCpuScript.cpp | |
parent | b93cb42b4b8511d244ec8df4559fdc5c0b2de1bf (diff) | |
download | android_frameworks_rs-1d476620399d54774e4fd386c1d23cc583d49522.tar.gz android_frameworks_rs-1d476620399d54774e4fd386c1d23cc583d49522.tar.bz2 android_frameworks_rs-1d476620399d54774e4fd386c1d23cc583d49522.zip |
Add callback to allow replacement of runtime support library.
Change-Id: I84ec56dfb29a0158015ebf31b3a73ac5bf34ef98
Diffstat (limited to 'cpu_ref/rsCpuScript.cpp')
-rw-r--r-- | cpu_ref/rsCpuScript.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp index 78874747..ff1fd142 100644 --- a/cpu_ref/rsCpuScript.cpp +++ b/cpu_ref/rsCpuScript.cpp @@ -122,7 +122,6 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir, #ifndef RS_COMPATIBILITY_LIB bcc::RSExecutable *exec; - const bcc::RSInfo *info; mCompilerContext = NULL; mCompilerDriver = NULL; @@ -145,8 +144,13 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir, mCompilerDriver->setRSRuntimeLookupFunction(lookupRuntimeStub); mCompilerDriver->setRSRuntimeLookupContext(this); + const char *core_lib = NULL; + RSSelectRTCallback selectRTCallback = mCtx->getSelectRTCallback(); + if (selectRTCallback != NULL) { + core_lib = selectRTCallback((const char *)bitcode, bitcodeSize); + } exec = mCompilerDriver->build(*mCompilerContext, cacheDir, resName, - (const char *)bitcode, bitcodeSize, NULL, + (const char *)bitcode, bitcodeSize, core_lib, mCtx->getLinkRuntimeCallback()); if (exec == NULL) { @@ -170,7 +174,7 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir, reinterpret_cast<void (*)()>(exec->getSymbolAddress(".rs.dtor")); - info = &mExecutable->getInfo(); + const bcc::RSInfo *info = &mExecutable->getInfo(); if (info->getExportVarNames().size()) { mBoundAllocs = new Allocation *[info->getExportVarNames().size()]; memset(mBoundAllocs, 0, sizeof(void *) * info->getExportVarNames().size()); |