DO NOT MERGE. Merge Froyo renderscript to Eclair to support live wallpapers on droid. This gives the necessary CPU reduction to allow the wallpapers to work on the slower CPU.
Committer: Jason Sams <rjsams@android.com> On branch droid Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: libs/rs/rsAllocation.cpp modified: libs/rs/rsAllocation.h modified: libs/rs/rsContext.cpp modified: libs/rs/rsContext.h modified: libs/rs/rsProgram.cpp modified: libs/rs/rsProgram.h Delete the old rollo sample which is obsolete. Fix film init Begin gl2 support. Renderscript still uses GL1.1 by default. However, 2.0 can be enabled and will render most tests correctly. Fix film Beging GL2 user shaders. Switch master to using GL2 by default. Implement RS tracked defered texture and buffer object uploads. Committer: Jason Sams <rjsams@android.com> On branch droid Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: libs/rs/rsAllocation.cpp modified: libs/rs/rsAllocation.h modified: libs/rs/rsContext.h modified: libs/rs/rsProgramFragment.cpp modified: libs/rs/rsSimpleMesh.cpp Remove check for surface valid that is no longer valid. Continue development of es2.0 user shader support for renderscript. This change cleans up ProgramVertex creation and adds support for passing input, output, and constant type info. Continue es2 shader dev Conflicts: graphics/java/android/renderscript/Program.java graphics/java/android/renderscript/ProgramVertex.java Place shader logging behind prop to declutter logs. Fix emulated glColor in es2 mode. Fix live wallpaper many. Z coordinate was being ignored for draw quad call. Add argument checking to sampler builder to disallow illegal modes. Move texture bindings to base program object. Change ProgramFragment creation to require a texture format in 1.0 mode. Element restructuring. Add support for new basic Element types including the RS objects and vectors(2-4). In theory this paves the way for maintaining type info for RS objects, passing elements for GLSL uiforms/attribs/varyings, and supporting nested structures. This will break some apps, checkings for other projects will follow to unbreak them. Disable excessive RS logging. Add RS support for generic attribs as input to vertex programs. More complete support for named attribs. Adds user typed attribs as available to programVertex. Non user attribs are not treated like user for GL2 for simplicity. Support npot on es 2.0 HW. Change user attribs to look for empty slot rather than using them in order. Prevents conflict with numbered legacy slots. Fix npot but where mipmap level sizes were rounding in the wrong direction. Should always be floor. Implement type generation for user uniforms in vertex shader. Remove excessive logging, fix error in GLSL uniform generation. Fix RS mipmap generation for 8 bit alpha textures. Cleanup seperation of Legacy and user attribs. All user programs now use the new names. Legacy vertex attribs are given default names. Fix some minor bugs with GL state setup that were exposed by Droids driver. Implement drawSpriteCropped on es2.0
This commit is contained in:
@@ -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);
|
||||
@@ -89,9 +87,9 @@ public class RenderScript {
|
||||
native void nObjDestroyOOB(int id);
|
||||
native int nFileOpen(byte[] name);
|
||||
|
||||
native void nElementBegin();
|
||||
native void nElementAdd(int kind, int type, boolean norm, int bits, String s);
|
||||
native int nElementCreate();
|
||||
|
||||
native int nElementCreate(int type, int kind, boolean norm, int vecSize);
|
||||
native int nElementCreate2(int[] elements, String[] names);
|
||||
|
||||
native void nTypeBegin(int elementID);
|
||||
native void nTypeAdd(int dim, int val);
|
||||
@@ -167,17 +165,15 @@ public class RenderScript {
|
||||
native void nProgramRasterSetLineWidth(int pr, float v);
|
||||
native void nProgramRasterSetPointSize(int pr, float v);
|
||||
|
||||
native void nProgramFragmentBegin(int in, int out, boolean pointSpriteEnable);
|
||||
native void nProgramFragmentBindTexture(int vpf, int slot, int a);
|
||||
native void nProgramFragmentBindSampler(int vpf, int slot, int s);
|
||||
native void nProgramFragmentSetSlot(int slot, boolean enable, int env, int vt);
|
||||
native int nProgramFragmentCreate();
|
||||
native void nProgramBindConstants(int pv, int slot, int mID);
|
||||
native void nProgramBindTexture(int vpf, int slot, int a);
|
||||
native void nProgramBindSampler(int vpf, int slot, int s);
|
||||
|
||||
native void nProgramVertexBindAllocation(int pv, int mID);
|
||||
native void nProgramVertexBegin(int inID, int outID);
|
||||
native void nProgramVertexSetTextureMatrixEnable(boolean enable);
|
||||
native void nProgramVertexAddLight(int id);
|
||||
native int nProgramVertexCreate();
|
||||
native int nProgramFragmentCreate(int[] params);
|
||||
native int nProgramFragmentCreate2(String shader, int[] params);
|
||||
|
||||
native int nProgramVertexCreate(boolean texMat);
|
||||
native int nProgramVertexCreate2(String shader, int[] params);
|
||||
|
||||
native void nLightBegin();
|
||||
native void nLightSetIsMono(boolean isMono);
|
||||
@@ -200,14 +196,13 @@ public class RenderScript {
|
||||
private Surface mSurface;
|
||||
private MessageThread mMessageThread;
|
||||
|
||||
|
||||
Element mElement_USER_U8;
|
||||
Element mElement_USER_I8;
|
||||
Element mElement_USER_U16;
|
||||
Element mElement_USER_I16;
|
||||
Element mElement_USER_U32;
|
||||
Element mElement_USER_I32;
|
||||
Element mElement_USER_FLOAT;
|
||||
Element mElement_USER_F32;
|
||||
|
||||
Element mElement_A_8;
|
||||
Element mElement_RGB_565;
|
||||
@@ -217,9 +212,12 @@ public class RenderScript {
|
||||
Element mElement_RGBA_8888;
|
||||
|
||||
Element mElement_INDEX_16;
|
||||
Element mElement_XY_F32;
|
||||
Element mElement_XYZ_F32;
|
||||
|
||||
Element mElement_POSITION_2;
|
||||
Element mElement_POSITION_3;
|
||||
Element mElement_TEXTURE_2;
|
||||
Element mElement_NORMAL_3;
|
||||
Element mElement_COLOR_U8_4;
|
||||
Element mElement_COLOR_F32_4;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -248,13 +246,8 @@ public class RenderScript {
|
||||
}
|
||||
}
|
||||
|
||||
void validateSurface() {
|
||||
if (mSurface == null) {
|
||||
throw new IllegalStateException("Uploading data to GL with no surface.");
|
||||
}
|
||||
}
|
||||
|
||||
public void contextSetPriority(Priority p) {
|
||||
validate();
|
||||
nContextSetPriority(p.mID);
|
||||
}
|
||||
|
||||
@@ -305,23 +298,26 @@ public class RenderScript {
|
||||
nDeviceSetConfig(mDev, 0, 1);
|
||||
}
|
||||
mContext = nContextCreate(mDev, 0, useDepth);
|
||||
Element.initPredefined(this);
|
||||
mMessageThread = new MessageThread(this);
|
||||
mMessageThread.start();
|
||||
Element.initPredefined(this);
|
||||
}
|
||||
|
||||
public void contextSetSurface(int w, int h, Surface sur) {
|
||||
mSurface = sur;
|
||||
mWidth = w;
|
||||
mHeight = h;
|
||||
validate();
|
||||
nContextSetSurface(w, h, mSurface);
|
||||
}
|
||||
|
||||
public void contextDump(int bits) {
|
||||
validate();
|
||||
nContextDump(bits);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
validate();
|
||||
nContextDeinitToClient();
|
||||
mMessageThread.mRun = false;
|
||||
|
||||
@@ -337,10 +333,12 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
void pause() {
|
||||
validate();
|
||||
nContextPause();
|
||||
}
|
||||
|
||||
void resume() {
|
||||
validate();
|
||||
nContextResume();
|
||||
}
|
||||
|
||||
@@ -381,22 +379,27 @@ public class RenderScript {
|
||||
}
|
||||
|
||||
public void contextBindRootScript(Script s) {
|
||||
validate();
|
||||
nContextBindRootScript(safeID(s));
|
||||
}
|
||||
|
||||
public void contextBindProgramFragmentStore(ProgramStore p) {
|
||||
validate();
|
||||
nContextBindProgramFragmentStore(safeID(p));
|
||||
}
|
||||
|
||||
public void contextBindProgramFragment(ProgramFragment p) {
|
||||
validate();
|
||||
nContextBindProgramFragment(safeID(p));
|
||||
}
|
||||
|
||||
public void contextBindProgramRaster(ProgramRaster p) {
|
||||
validate();
|
||||
nContextBindProgramRaster(safeID(p));
|
||||
}
|
||||
|
||||
public void contextBindProgramVertex(ProgramVertex p) {
|
||||
validate();
|
||||
nContextBindProgramVertex(safeID(p));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user