Merge changes I683078ff,I426fba9f,I2fcc57ac
* changes:
Optimisations to 3DLUT assembly.
Make Blur AArch64 assembly position-independent.
Add AArch64 assembly for ColorMatrix.
diff --git a/rsContext.h b/rsContext.h
index d21227e..e6c94ec 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -116,7 +116,6 @@
TypeState mStateType;
SamplerState mStateSampler;
- ScriptCState mScriptC;
bool isSynchronous() {return mSynchronous;}
bool setupCheck();
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index f84c4b4..3a22b16 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -17,14 +17,10 @@
#include "rsContext.h"
#include "rsScriptC.h"
-#ifndef FAKE_ARM64_BUILD
-#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
+#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
#include <bcinfo/BitcodeTranslator.h>
#include <bcinfo/BitcodeWrapper.h>
#endif
-#endif
-#endif
#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
#include "utils/Timers.h"
@@ -42,26 +38,18 @@
ScriptC * sc = (ScriptC *) tls->mScript
ScriptC::ScriptC(Context *rsc) : Script(rsc) {
-#ifndef FAKE_ARM64_BUILD
-#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
+#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
BT = NULL;
#endif
-#endif
-#endif
}
ScriptC::~ScriptC() {
-#ifndef FAKE_ARM64_BUILD
-#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
+#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
if (BT) {
delete BT;
BT = NULL;
}
#endif
-#endif
-#endif
if (mInitialized) {
mRSC->mHal.funcs.script.invokeFreeChildren(mRSC, this);
mRSC->mHal.funcs.script.destroy(mRSC, this);
@@ -213,43 +201,6 @@
rsc->mHal.funcs.script.invokeFunction(rsc, this, slot, data, len);
}
-ScriptCState::ScriptCState() {
-}
-
-ScriptCState::~ScriptCState() {
-}
-
-/*
-static void* symbolLookup(void* pContext, char const* name) {
- const ScriptCState::SymbolTable_t *sym;
- ScriptC *s = (ScriptC *)pContext;
- if (!strcmp(name, "__isThreadable")) {
- return (void*) s->mHal.info.isThreadable;
- } else if (!strcmp(name, "__clearThreadable")) {
- s->mHal.info.isThreadable = false;
- return NULL;
- }
- sym = ScriptCState::lookupSymbol(name);
- if (!sym) {
- sym = ScriptCState::lookupSymbolCL(name);
- }
- if (!sym) {
- sym = ScriptCState::lookupSymbolGL(name);
- }
- if (sym) {
- s->mHal.info.isThreadable &= sym->threadable;
- return sym->mPtr;
- }
- ALOGE("ScriptC sym lookup failed for %s", name);
- return NULL;
-}
-*/
-
-#if 0
-extern const char rs_runtime_lib_bc[];
-extern unsigned rs_runtime_lib_bc_size;
-#endif
-
bool ScriptC::runCompiler(Context *rsc,
const char *resName,
const char *cacheDir,
diff --git a/rsScriptC.h b/rsScriptC.h
index fdf678d..4a033f1 100644
--- a/rsScriptC.h
+++ b/rsScriptC.h
@@ -17,23 +17,19 @@
#ifndef ANDROID_RS_SCRIPT_C_H
#define ANDROID_RS_SCRIPT_C_H
+#include "rsEnv.h"
#include "rsScript.h"
-#include "rsEnv.h"
-
-#ifndef FAKE_ARM64_BUILD
-#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
+#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
#include "bcinfo/BitcodeTranslator.h"
#endif
-#endif
-#endif
// ---------------------------------------------------------------------------
namespace android {
namespace renderscript {
+/** This class represents a script compiled from an .rs file. */
class ScriptC : public Script {
public:
typedef int (*RunScript_t)();
@@ -65,36 +61,15 @@
void setupScript(Context *);
void setupGLState(Context *);
private:
-#ifndef FAKE_ARM64_BUILD
-#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
+#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
bcinfo::BitcodeTranslator *BT;
#endif
+#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB)
bool createCacheDir(const char *cacheDir);
#endif
-#endif
};
-class ScriptCState {
-public:
- ScriptCState();
- ~ScriptCState();
-
- char * mScriptText;
- size_t mScriptLen;
-
- struct SymbolTable_t {
- const char * mName;
- void * mPtr;
- bool threadable;
- };
- static const SymbolTable_t * lookupSymbol(const char *);
- static const SymbolTable_t * lookupSymbolCL(const char *);
- static const SymbolTable_t * lookupSymbolGL(const char *);
-};
-
-
}
}
#endif