Merge commit 'f56f317fb941c354c3a10e9fbf36d194656fa7d4' into eclair-mr2-plus-aosp * commit 'f56f317fb941c354c3a10e9fbf36d194656fa7d4': Add support for dumping RS objects to aid in debugging of white blocks bug.
This commit is contained in:
@ -68,6 +68,7 @@ public class RenderScript {
|
||||
native void nContextDestroy(int con);
|
||||
native void nContextSetSurface(int w, int h, Surface sur);
|
||||
native void nContextSetPriority(int p);
|
||||
native void nContextDump(int bits);
|
||||
|
||||
native void nContextBindRootScript(int script);
|
||||
native void nContextBindSampler(int sampler, int slot);
|
||||
@ -304,6 +305,10 @@ public class RenderScript {
|
||||
nContextSetSurface(w, h, mSurface);
|
||||
}
|
||||
|
||||
public void contextDump(int bits) {
|
||||
nContextDump(bits);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
nContextDeinitToClient();
|
||||
mMessageThread.mRun = false;
|
||||
|
@ -189,9 +189,16 @@ static void
|
||||
nContextDestroy(JNIEnv *_env, jobject _this, jint con)
|
||||
{
|
||||
LOG_API("nContextDestroy, con(%p)", (RsContext)con);
|
||||
return rsContextDestroy((RsContext)con);
|
||||
rsContextDestroy((RsContext)con);
|
||||
}
|
||||
|
||||
static void
|
||||
nContextDump(JNIEnv *_env, jobject _this, jint bits)
|
||||
{
|
||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
||||
LOG_API("nContextDump, con(%p) bits(%i)", (RsContext)con, bits);
|
||||
rsContextDump((RsContext)con, bits);
|
||||
}
|
||||
|
||||
static void
|
||||
nContextPause(JNIEnv *_env, jobject _this)
|
||||
@ -1346,6 +1353,7 @@ static JNINativeMethod methods[] = {
|
||||
{"nContextSetPriority", "(I)V", (void*)nContextSetPriority },
|
||||
{"nContextSetSurface", "(IILandroid/view/Surface;)V", (void*)nContextSetSurface },
|
||||
{"nContextDestroy", "(I)V", (void*)nContextDestroy },
|
||||
{"nContextDump", "(I)V", (void*)nContextDump },
|
||||
{"nContextPause", "()V", (void*)nContextPause },
|
||||
{"nContextResume", "()V", (void*)nContextResume },
|
||||
{"nAssignName", "(I[B)V", (void*)nAssignName },
|
||||
|
@ -42,6 +42,10 @@ ContextSetSurface {
|
||||
param void *sur
|
||||
}
|
||||
|
||||
ContextDump {
|
||||
param int32_t bits
|
||||
}
|
||||
|
||||
ContextSetPriority {
|
||||
param int32_t priority
|
||||
}
|
||||
|
@ -190,6 +190,24 @@ void Allocation::subData(uint32_t xoff, uint32_t yoff, uint32_t zoff,
|
||||
{
|
||||
}
|
||||
|
||||
void Allocation::dumpLOGV(const char *prefix) const
|
||||
{
|
||||
ObjectBase::dumpLOGV(prefix);
|
||||
|
||||
String8 s(prefix);
|
||||
s.append(" type ");
|
||||
if (mType.get()) {
|
||||
mType->dumpLOGV(s.string());
|
||||
}
|
||||
|
||||
LOGV("%s allocation ptr=%p mCpuWrite=%i, mCpuRead=%i, mGpuWrite=%i, mGpuRead=%i",
|
||||
prefix, mPtr, mCpuWrite, mCpuRead, mGpuWrite, mGpuRead);
|
||||
|
||||
LOGV("%s allocation mIsTexture=%i mIsTextureID=%i, mIsVertexBuffer=%i, mBufferID=%i",
|
||||
prefix, mIsTexture, mTextureID, mIsVertexBuffer, mBufferID);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////
|
||||
|
@ -65,6 +65,8 @@ public:
|
||||
void enableGLVertexBuffers() const;
|
||||
void setupGLIndexBuffers() const;
|
||||
|
||||
virtual void dumpLOGV(const char *prefix) const;
|
||||
|
||||
|
||||
protected:
|
||||
ObjectBaseRef<const Type> mType;
|
||||
|
@ -819,6 +819,11 @@ void rsi_ContextSetPriority(Context *rsc, int32_t p)
|
||||
rsc->setPriority(p);
|
||||
}
|
||||
|
||||
void rsi_ContextDump(Context *rsc, int32_t bits)
|
||||
{
|
||||
ObjectBase::dumpAll(rsc);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,3 +190,15 @@ void ObjectBase::zeroAllUserRef(Context *rsc)
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectBase::dumpAll(Context *rsc)
|
||||
{
|
||||
if (rsc->props.mLogObjects) {
|
||||
LOGV("Dumping all objects");
|
||||
const ObjectBase * o = rsc->mObjHead;
|
||||
while (o) {
|
||||
o->dumpLOGV(" ");
|
||||
o = o->mNext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
void setContext(Context *);
|
||||
|
||||
static void zeroAllUserRef(Context *rsc);
|
||||
static void dumpAll(Context *rsc);
|
||||
|
||||
virtual void dumpLOGV(const char *prefix) const;
|
||||
|
||||
|
Reference in New Issue
Block a user