Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 715333b8 authored by Jason Sams's avatar Jason Sams
Browse files

Add support for dumping RS objects to aid in debugging of white blocks bug.

parent f0166e4d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
+9 −1
Original line number Diff line number Diff line
@@ -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 },
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@ ContextSetSurface {
	param void *sur
	}

ContextDump {
	param int32_t bits
}

ContextSetPriority {
	param int32_t priority
	}
+18 −0
Original line number Diff line number Diff line
@@ -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);


}


/////////////////
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ public:
    void enableGLVertexBuffers() const;
    void setupGLIndexBuffers() const;

    virtual void dumpLOGV(const char *prefix) const;


protected:
    ObjectBaseRef<const Type> mType;
Loading