From e29f3e74f71ea730519ff8ae1d8dd4c1630bbaf9 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Tue, 8 Jun 2010 15:40:48 -0700 Subject: [PATCH] Begin using reflected files. Change-Id: I5307a0eac9c206b85c0cf7451d3f8300134bf8e3 --- .../java/android/renderscript/Element.java | 31 +++---- .../android/renderscript/RenderScript.java | 1 - .../java/android/renderscript/SimpleMesh.java | 2 +- libs/rs/RenderScript.h | 9 +- libs/rs/java/Fountain/res/raw/fountain.rs | 17 +--- libs/rs/java/Fountain/res/raw/fountain_bc.bc | Bin 2384 -> 2632 bytes .../src/com/android/fountain/FountainRS.java | 4 +- .../android/fountain/ScriptC_Fountain.java | 81 ++++++++++++------ .../android/fountain/ScriptField_Point.java | 67 --------------- .../android/fountain/ScriptField_Point_s.java | 79 +++++++++++++++++ libs/rs/rsScriptC.cpp | 29 +------ libs/rs/scriptc/rs_core.rsh | 13 ++- 12 files changed, 163 insertions(+), 170 deletions(-) delete mode 100644 libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java create mode 100644 libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point_s.java diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java index 974a36e5b470d..22291e61c6e57 100644 --- a/graphics/java/android/renderscript/Element.java +++ b/graphics/java/android/renderscript/Element.java @@ -72,12 +72,6 @@ public class Element extends BaseObj { public enum DataKind { USER (0), - COLOR (1), - POSITION (2), - TEXTURE (3), - NORMAL (4), - INDEX (5), - POINT_SIZE(6), PIXEL_L (7), PIXEL_A (8), @@ -105,6 +99,20 @@ public class Element extends BaseObj { return rs.mElement_I8; } + public static Element U16(RenderScript rs) { + if(rs.mElement_U16 == null) { + rs.mElement_U16 = createUser(rs, DataType.UNSIGNED_16); + } + return rs.mElement_U16; + } + + public static Element I16(RenderScript rs) { + if(rs.mElement_I16 == null) { + rs.mElement_I16 = createUser(rs, DataType.SIGNED_16); + } + return rs.mElement_I16; + } + public static Element U32(RenderScript rs) { if(rs.mElement_U32 == null) { rs.mElement_U32 = createUser(rs, DataType.UNSIGNED_32); @@ -239,13 +247,6 @@ public class Element extends BaseObj { return rs.mElement_RGBA_8888; } - public static Element INDEX_16(RenderScript rs) { - if(rs.mElement_INDEX_16 == null) { - rs.mElement_INDEX_16 = createIndex(rs); - } - return rs.mElement_INDEX_16; - } - public static Element F32_2(RenderScript rs) { if(rs.mElement_FLOAT_2 == null) { rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2); @@ -314,10 +315,6 @@ public class Element extends BaseObj { return new Element(rs, dt, DataKind.USER, false, size); } - public static Element createIndex(RenderScript rs) { - return new Element(rs, DataType.UNSIGNED_16, DataKind.INDEX, false, 1); - } - public static Element createPixel(RenderScript rs, DataType dt, DataKind dk) { if (!(dk == DataKind.PIXEL_L || dk == DataKind.PIXEL_A || diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index d35cf8bc90de9..9dd8d1e778435 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -223,7 +223,6 @@ public class RenderScript { Element mElement_RGBA_4444; Element mElement_RGBA_8888; - Element mElement_INDEX_16; Element mElement_FLOAT_2; Element mElement_FLOAT_3; Element mElement_FLOAT_4; diff --git a/graphics/java/android/renderscript/SimpleMesh.java b/graphics/java/android/renderscript/SimpleMesh.java index fc011b5cdf792..38d073680c7fe 100644 --- a/graphics/java/android/renderscript/SimpleMesh.java +++ b/graphics/java/android/renderscript/SimpleMesh.java @@ -332,7 +332,7 @@ public class SimpleMesh extends BaseObj { Builder smb = new Builder(mRS); smb.addVertexType(mElement, mVtxCount / floatCount); - smb.setIndexType(Element.createIndex(mRS), mIndexCount); + smb.setIndexType(Element.U16(mRS), mIndexCount); smb.setPrimitive(Primitive.TRIANGLE); SimpleMesh sm = smb.create(); diff --git a/libs/rs/RenderScript.h b/libs/rs/RenderScript.h index e7c02749ae6c7..f01eadd46d5c2 100644 --- a/libs/rs/RenderScript.h +++ b/libs/rs/RenderScript.h @@ -103,19 +103,12 @@ enum RsDataType { enum RsDataKind { RS_KIND_USER, - RS_KIND_COLOR, - RS_KIND_POSITION, - RS_KIND_TEXTURE, - RS_KIND_NORMAL, - RS_KIND_INDEX, - RS_KIND_POINT_SIZE, - RS_KIND_PIXEL_L, + RS_KIND_PIXEL_L = 7, RS_KIND_PIXEL_A, RS_KIND_PIXEL_LA, RS_KIND_PIXEL_RGB, RS_KIND_PIXEL_RGBA, - }; enum RsSamplerParam { diff --git a/libs/rs/java/Fountain/res/raw/fountain.rs b/libs/rs/java/Fountain/res/raw/fountain.rs index fe2ca33d01ccf..7573398770160 100644 --- a/libs/rs/java/Fountain/res/raw/fountain.rs +++ b/libs/rs/java/Fountain/res/raw/fountain.rs @@ -40,17 +40,7 @@ int root() { return 1; } -// Putting the overloadable attribute on this function breaks rendering -// appears to be a bug. -static uchar4 /*__attribute__((overloadable))*/ pack(float r, float g, float b) -{ - uchar4 c; - c.x = (uchar)(r * 255.f); - c.y = (uchar)(g * 255.f); - c.z = (uchar)(b * 255.f); - c.w = 255; - return c; -} +#pragma rs export_func(addParticles) void addParticles(int rate, int x, int y) { @@ -63,10 +53,7 @@ void addParticles(int rate, int x, int y) float rMax = ((float)rate) * 0.005f; int size = rsAllocationGetDimX(rsGetAllocation(point)); - //uchar4 c = rsPackColorTo8888(partColor.x, partColor.y, partColor.z); - uchar4 c = pack(partColor.x, partColor.y, partColor.z); - c.x = 255; - c.w = 255; + uchar4 c = rsPackColorTo8888(partColor.x, partColor.y, partColor.z); //rsDebug("color ", ((int *)&c)[0]); Point_t * np = &point[newPart]; diff --git a/libs/rs/java/Fountain/res/raw/fountain_bc.bc b/libs/rs/java/Fountain/res/raw/fountain_bc.bc index d22346080390f9c7daac78616fd9ba91b90712dd..b01098bbf216e0dbe5c09a12398aab6c6b5b26a2 100644 GIT binary patch delta 2192 zcmY*aeN+=y7JtbM$pnUB0s{_`#0f@Z*Jvj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aTgQ^F83?uBwlwcs=SKp4LO73*;oZzgFQZq3bMY13h&JRcNQ|sG_x! zZN}e8VD<`kObw$4*_a#?L54Erjzj_+uz~yHUjxwyGRX*m@DB`LDL+gM@->^J=L;_N z!t&3x*Gl~*x)#futSIv?Eg}lq!7BMUBJuh$eOLfUPRx+=1LrHmq=23Zi+;<-6h$0K zz}Fs7G7D@l=_&*vC&X)sDYEA!01)HL^Yi^|kctBIMcO7>IOI(0;w6MK2|+qugcI;b z&>-$|ocO)mQ%1Zd$sn6_ZZY1Vh~mZ5N(@xNO0-tcw~l=*YuSD@Wd#ZHa{F z<}_uZ^LRY5gh8g7QsBhL4tdAT%JH`e*~XKz9JCKMRhmKr_ZJM9x#EJoMm3%Hy(5cV z?J$`my6$7uWpJbUov>Xy`9GEyPr|Gn%R6edr%E48C{(leZysaF!bAHC?dMK#EH8gr z14G%CCfo#6;NhzGu(bvr`qmDPHrT8b0NY?MLk!O$MWO$HNT+ZhtVJm7Uu`5D2HA~A z&Sy5`KNrQ1&b;+mNYl=;yGLh^JK&g=MsF(xin^+^1|1Ox*RC4i)2N0=z0pMN`$QSyIZoiCPd?Sa%l>ciWrn&GSozV$tz7*j1FwpcZ4KAY zzx2mb-@LT8^V`d|ufbsofEQto1@Dg|n@e5{y#>hbX~%pZ(8r&1 zVbSV+23ZL@PB6jTZkh2M1NU&=QsB{z@rco#UiI(&5Buv{r0f-JBg0i<6xB$kUi~s| eUhbg_Pmg7s1g5T=_TVkG=^!2yU{O#k*Zu>TL!!d~ diff --git a/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java b/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java index 6f601344c55fb..5433597a371be 100644 --- a/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java +++ b/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java @@ -34,7 +34,7 @@ public class FountainRS { mRS = rs; mRes = res; - ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT); + ScriptField_Point_s points = new ScriptField_Point_s(mRS, PART_COUNT); SimpleMesh.Builder smb = new SimpleMesh.Builder(mRS); int vtxSlot = smb.addVertexType(points.getType()); @@ -59,7 +59,7 @@ public class FountainRS { tmpColor.z = mRand.nextFloat(); mScript.set_partColor(tmpColor); } - mScript.invokable_addParticles(rate, x, y); + mScript.invoke_addParticles(rate, x, y); holdingColor = true; } else { holdingColor = false; diff --git a/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java b/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java index cace1ecbb4562..f6bef2737592e 100644 --- a/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java +++ b/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java @@ -1,46 +1,77 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.android.fountain; -import android.content.res.Resources; import android.renderscript.*; +import android.content.res.Resources; import android.util.Log; -public class ScriptC_Fountain - extends android.renderscript.ScriptC -{ - public ScriptC_Fountain(RenderScript rs, Resources resources, boolean isRoot) { +public class ScriptC_Fountain extends ScriptC { + // Constructor + public ScriptC_Fountain(RenderScript rs, Resources resources, boolean isRoot) { super(rs, resources, R.raw.fountain_bc, isRoot); } + private final static int mExportVarIdx_partColor = 0; + private Float4 mExportVar_partColor; public void set_partColor(Float4 v) { + mExportVar_partColor = v; FieldPacker fp = new FieldPacker(16); fp.addF32(v); - setVar(0, fp); + setVar(mExportVarIdx_partColor, fp); } + + public Float4 get_partColor() { + return mExportVar_partColor; + } + + private final static int mExportVarIdx_partMesh = 1; + private SimpleMesh mExportVar_partMesh; public void set_partMesh(SimpleMesh v) { - setVar(1, v.getID()); + mExportVar_partMesh = v; + int id = 0; + if (v != null) id = v.getID(); + setVar(mExportVarIdx_partMesh, id); } - private ScriptField_Point mField_point; - public void bind_point(ScriptField_Point f) { - mField_point = f; - if (f == null) { - bindAllocation(null, 2); - } else { - bindAllocation(f.getAllocation(), 2); - } - } - public ScriptField_Point get_point() { - return mField_point; + public SimpleMesh get_partMesh() { + return mExportVar_partMesh; } - - public void invokable_addParticles(int count, int x, int y) { - FieldPacker fp = new FieldPacker(12); - fp.addI32(count); - fp.addI32(x); - fp.addI32(y); - invokeV(0, fp); + private final static int mExportVarIdx_point = 2; + private ScriptField_Point_s mExportVar_point; + public void bind_point(ScriptField_Point_s v) { + mExportVar_point = v; + if(v == null) bindAllocation(null, mExportVarIdx_point); + else bindAllocation(v.getAllocation(), mExportVarIdx_point); } + + public ScriptField_Point_s get_point() { + return mExportVar_point; + } + + private final static int mExportFuncIdx_addParticles = 0; + public void invoke_addParticles(int rate, int x, int y) { + FieldPacker addParticles_fp = new FieldPacker(12); + addParticles_fp.addI32(rate); + addParticles_fp.addI32(x); + addParticles_fp.addI32(y); + invokeV(mExportFuncIdx_addParticles, addParticles_fp); + } + } diff --git a/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java b/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java deleted file mode 100644 index 91db2c63d5ef8..0000000000000 --- a/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java +++ /dev/null @@ -1,67 +0,0 @@ - -package com.android.fountain; - -import android.content.res.Resources; -import android.renderscript.*; -import android.util.Log; - -public class ScriptField_Point - extends android.renderscript.Script.FieldBase -{ - - static public class Item { - Item() { - delta = new Float2(); - pos = new Float2(); - color = new Short4(); - } - - public static final int sizeof = (5*4); - Float2 delta; - Float2 pos; - Short4 color; - } - private Item mItemArray[]; - - - public ScriptField_Point(RenderScript rs, int count) { - // Allocate a pack/unpack buffer - mIOBuffer = new FieldPacker(Item.sizeof * count); - mItemArray = new Item[count]; - - Element.Builder eb = new Element.Builder(rs); - eb.add(Element.F32_2(rs), "delta"); - eb.add(Element.F32_2(rs), "position"); - eb.add(Element.U8_4(rs), "color"); - mElement = eb.create(); - - init(rs, count); - } - - private void copyToArray(Item i, int index) { - mIOBuffer.reset(index * Item.sizeof); - mIOBuffer.addF32(i.delta); - mIOBuffer.addF32(i.pos); - mIOBuffer.addU8(i.color); - } - - public void set(Item i, int index, boolean copyNow) { - mItemArray[index] = i; - if (copyNow) { - copyToArray(i, index); - mAllocation.subData1D(index * Item.sizeof, Item.sizeof, mIOBuffer.getData()); - } - } - - public void copyAll() { - for (int ct=0; ct < mItemArray.length; ct++) { - copyToArray(mItemArray[ct], ct); - } - mAllocation.data(mIOBuffer.getData()); - } - - - private FieldPacker mIOBuffer; - - -} diff --git a/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point_s.java b/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point_s.java new file mode 100644 index 0000000000000..9697a4d615c94 --- /dev/null +++ b/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point_s.java @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.fountain; + +import android.renderscript.*; +import android.content.res.Resources; +import android.util.Log; + +public class ScriptField_Point_s extends android.renderscript.Script.FieldBase { + static public class Item { + public static final int sizeof = 20; + + Float2 delta; + Float2 position; + Short4 color; + + Item() { + delta = new Float2(); + position = new Float2(); + color = new Short4(); + } + + } + + private Item mItemArray[]; + private FieldPacker mIOBuffer; + public ScriptField_Point_s(RenderScript rs, int count) { + mItemArray = null; + mIOBuffer = null; + { + Element.Builder eb = new Element.Builder(rs); + eb.add(Element.createVector(rs, Element.DataType.FLOAT_32, 2), "delta"); + eb.add(Element.createVector(rs, Element.DataType.FLOAT_32, 2), "position"); + eb.add(Element.createVector(rs, Element.DataType.UNSIGNED_8, 4), "color"); + mElement = eb.create(); + } + + init(rs, count); + } + + private void copyToArray(Item i, int index) { + if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * mType.getX() /* count */); + mIOBuffer.reset(index * Item.sizeof); + mIOBuffer.addF32(i.delta); + mIOBuffer.addF32(i.position); + mIOBuffer.addU8(i.color); + } + + public void set(Item i, int index, boolean copyNow) { + if (mItemArray == null) mItemArray = new Item[mType.getX() /* count */]; + mItemArray[index] = i; + if (copyNow) { + copyToArray(i, index); + mAllocation.subData1D(index * Item.sizeof, Item.sizeof, mIOBuffer.getData()); + } + + } + + public void copyAll() { + for (int ct=0; ct < mItemArray.length; ct++) copyToArray(mItemArray[ct], ct); + mAllocation.data(mIOBuffer.getData()); + } + +} + diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 374a07f923abc..ef372860a9e6e 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -196,32 +196,9 @@ void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, uint32_t len setupScript(rsc); Script * oldTLS = setTLS(this); - const uint32_t * dPtr = (const uint32_t *)data; - switch(len) { - case 0: - mEnviroment.mInvokeFunctions[slot](); - break; - case 4: - ((void (*)(uint32_t)) - mEnviroment.mInvokeFunctions[slot])(dPtr[0]); - break; - case 8: - ((void (*)(uint32_t, uint32_t)) - mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1]); - break; - case 12: - ((void (*)(uint32_t, uint32_t, uint32_t)) - mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1], dPtr[2]); - break; - case 16: - ((void (*)(uint32_t, uint32_t, uint32_t, uint32_t)) - mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1], dPtr[2], dPtr[3]); - break; - case 20: - ((void (*)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)) - mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1], dPtr[2], dPtr[3], dPtr[4]); - break; - } + ((void (*)(const void *, uint32_t)) + mEnviroment.mInvokeFunctions[slot])(data, len); + setTLS(oldTLS); } diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh index c0ba4afafdaae..8005a7023561f 100644 --- a/libs/rs/scriptc/rs_core.rsh +++ b/libs/rs/scriptc/rs_core.rsh @@ -1,8 +1,6 @@ #ifndef __RS_CORE_RSH__ #define __RS_CORE_RSH__ -//uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b); -//uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b, float a); static uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b) { @@ -24,8 +22,6 @@ static uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, return c; } - -/* static uchar4 __attribute__((overloadable)) rsPackColorTo8888(float3 color) { color *= 255.f; @@ -51,10 +47,11 @@ static float4 rsUnpackColor8888(uchar4 c) return ret; } -extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float r, float g, float b); -extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float3); -extern float4 rsUnpackColor565(uchar4); -*/ +//extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float r, float g, float b); +//extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float3); +//extern float4 rsUnpackColor565(uchar4); + + #endif