diff options
author | Romain Guy <romainguy@android.com> | 2009-08-04 17:19:48 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-08-04 18:50:24 -0700 |
commit | a2136d6b18a26ff34f2e5cd3f6c9413f0c96a5ba (patch) | |
tree | 631c877639776d069542af05afebe7ba99b5e544 /libs/rs/rsScriptC_Lib.cpp | |
parent | ead2758ce2103ab7b7c95c6aff91b239bb566099 (diff) |
Add ability to load arrays in RenderScript.
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index 561cde6ca880..8a29be34481e 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -59,6 +59,22 @@ static int32_t SC_loadI32(uint32_t bank, uint32_t offset) return i[offset]; } +static float* SC_loadArrayF(uint32_t bank) +{ + GET_TLS(); + void *vp = sc->mSlots[bank]->getPtr(); + float *f = static_cast<float *>(vp); + return f; +} + +static int32_t* SC_loadArrayI32(uint32_t bank) +{ + GET_TLS(); + void *vp = sc->mSlots[bank]->getPtr(); + int32_t *i = static_cast<int32_t *>(vp); + return i; +} + static uint32_t SC_loadU32(uint32_t bank, uint32_t offset) { GET_TLS(); @@ -678,6 +694,10 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { //{ "loadU32", (void *)&SC_loadU32, "unsigned int", "(int, int)" }, { "loadF", (void *)&SC_loadF, "float", "(int, int)" }, + { "loadArrayF", (void *)&SC_loadArrayF, + "float*", "(int)" }, + { "loadArrayI32", (void *)&SC_loadArrayI32, + "int*", "(int)" }, { "loadVec4", (void *)&SC_loadVec4, "void", "(int, int, float *)" }, { "loadMatrix", (void *)&SC_loadMatrix, |