summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-11-08 15:10:52 -0800
committerAlex Sakhartchouk <alexst@google.com>2010-11-08 15:10:52 -0800
commit9d71e2180062931416092f26276a07e55b318f62 (patch)
tree4e649a7ff122348fc2ed2961b3c280a989327242 /graphics
parent5b59e02eb542f016866985945859b033e94f9f0b (diff)
downloadframeworks_base-9d71e2180062931416092f26276a07e55b318f62.zip
frameworks_base-9d71e2180062931416092f26276a07e55b318f62.tar.gz
frameworks_base-9d71e2180062931416092f26276a07e55b318f62.tar.bz2
Moving attrib creation to Mesh. Adding arrays as shader inputs.
Removing fixed size arrays. Change-Id: I0213e403a2f1283dd43f21bea770aeb059561903
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/renderscript/Mesh.java2
-rw-r--r--graphics/java/android/renderscript/RenderScript.java4
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp9
3 files changed, 15 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index d36b2f1..bb382f2 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.java
@@ -212,6 +212,7 @@ public class Mesh extends BaseObj {
rs.nMeshBindVertex(id, alloc.getID(), ct);
newMesh.mVertexBuffers[ct] = alloc;
}
+ rs.nMeshInitVertexAttribs(id);
return newMesh;
}
@@ -294,6 +295,7 @@ public class Mesh extends BaseObj {
rs.nMeshBindVertex(id, entry.a.mID, ct);
newMesh.mVertexBuffers[ct] = entry.a;
}
+ rs.nMeshInitVertexAttribs(id);
return newMesh;
}
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 21efa39..0c9a4ed 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -486,6 +486,10 @@ public class RenderScript {
synchronized void nMeshBindIndex(int id, int alloc, int prim, int slot) {
rsnMeshBindIndex(mContext, id, alloc, prim, slot);
}
+ native void rsnMeshInitVertexAttribs(int con, int id);
+ synchronized void nMeshInitVertexAttribs(int id) {
+ rsnMeshInitVertexAttribs(mContext, id);
+ }
native int rsnMeshGetVertexBufferCount(int con, int id);
synchronized int nMeshGetVertexBufferCount(int id) {
return rsnMeshGetVertexBufferCount(mContext, id);
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 1cc6dc1..77cbc10 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -1152,6 +1152,14 @@ nMeshBindIndex(JNIEnv *_env, jobject _this, RsContext con, jint mesh, jint alloc
rsMeshBindIndex(con, (RsMesh)mesh, (RsAllocation)alloc, primID, slot);
}
+static void
+nMeshInitVertexAttribs(JNIEnv *_env, jobject _this, RsContext con, jint mesh)
+{
+ LOG_API("nMeshInitVertexAttribs, con(%p), Mesh(%p)", con, (RsMesh)mesh);
+ rsMeshInitVertexAttribs(con, (RsMesh)mesh);
+}
+
+
static jint
nMeshGetVertexBufferCount(JNIEnv *_env, jobject _this, RsContext con, jint mesh)
{
@@ -1334,6 +1342,7 @@ static JNINativeMethod methods[] = {
{"rsnMeshCreate", "(III)I", (void*)nMeshCreate },
{"rsnMeshBindVertex", "(IIII)V", (void*)nMeshBindVertex },
{"rsnMeshBindIndex", "(IIIII)V", (void*)nMeshBindIndex },
+{"rsnMeshInitVertexAttribs", "(II)V", (void*)nMeshInitVertexAttribs },
{"rsnMeshGetVertexBufferCount", "(II)I", (void*)nMeshGetVertexBufferCount },
{"rsnMeshGetIndexCount", "(II)I", (void*)nMeshGetIndexCount },