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

Commit 225ef52b authored by Jason Sams's avatar Jason Sams Committed by Android (Google) Code Review
Browse files

Merge "Add RS support for generic attribs as input to vertex programs."

parents d9328513 e17964e1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -76,8 +76,6 @@ public class RenderScript {
    native void nContextBindProgramFragment(int pf);
    native void nContextBindProgramVertex(int pf);
    native void nContextBindProgramRaster(int pr);
    native void nContextAddDefineI32(String name, int value);
    native void nContextAddDefineF(String name, float value);
    native void nContextPause();
    native void nContextResume();
    native int nContextGetMessage(int[] data, boolean wait);
+3 −0
Original line number Diff line number Diff line
@@ -34,6 +34,9 @@ public class Type extends BaseObj {
    private int mNativeCache;
    Class mJavaClass;

    public Element getElement() {
        return mElement;
    }

    public int getX() {
        return mDimX;
+0 −20
Original line number Diff line number Diff line
@@ -1212,26 +1212,6 @@ nContextBindProgramRaster(JNIEnv *_env, jobject _this, jint pf)
    rsContextBindProgramRaster(con, (RsProgramRaster)pf);
}

static void
nContextAddDefineI32(JNIEnv *_env, jobject _this, jstring name, jint value)
{
    RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
    const char* n = _env->GetStringUTFChars(name, NULL);
    LOG_API("nScriptCAddDefineI32, con(%p) name(%s) value(%d)", con, n, value);
    rsContextSetDefineI32(con, n, value);
    _env->ReleaseStringUTFChars(name, n);
}

static void
nContextAddDefineF(JNIEnv *_env, jobject _this, jstring name, jfloat value)
{
    RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
    const char* n = _env->GetStringUTFChars(name, NULL);
    LOG_API("nScriptCAddDefineF, con(%p) name(%s) value(%f)", con, n, value);
    rsContextSetDefineF(con, n, value);
    _env->ReleaseStringUTFChars(name, n);
}


// ---------------------------------------------------------------------------

+0 −10
Original line number Diff line number Diff line
@@ -20,16 +20,6 @@ ContextBindProgramRaster {
	param RsProgramRaster pgm
	}

ContextSetDefineF {
    param const char* name
    param float value
    }

ContextSetDefineI32 {
    param const char* name
    param int32_t value
    }

ContextPause {
	}

+21 −0
Original line number Diff line number Diff line
@@ -264,6 +264,27 @@ String8 Component::getCType() const
    return s;
}

String8 Component::getGLSLType() const
{
    if (mType == RS_TYPE_SIGNED_32) {
        switch(mVectorSize) {
        case 1: return String8("int");
        case 2: return String8("ivec2");
        case 3: return String8("ivec3");
        case 4: return String8("ivec4");
        }
    }
    if (mType == RS_TYPE_FLOAT_32) {
        switch(mVectorSize) {
        case 1: return String8("float");
        case 2: return String8("vec2");
        case 3: return String8("vec3");
        case 4: return String8("vec4");
        }
    }
    return String8();
}

static const char * gTypeStrings[] = {
    "NONE",
    "F16",
Loading