summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsProgram.h
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-11-25 13:22:07 -0800
committerJason Sams <rjsams@android.com>2009-11-25 13:22:07 -0800
commitbb51c40d89c7dbdee7d7507fdfe0a64e8f4f87a9 (patch)
tree55de9e729267eb463e07599b6b809fb4635c9472 /libs/rs/rsProgram.h
parent3fdee335fe95ab94ef1ee619ad37f9369447fde5 (diff)
downloadframeworks_base-bb51c40d89c7dbdee7d7507fdfe0a64e8f4f87a9.zip
frameworks_base-bb51c40d89c7dbdee7d7507fdfe0a64e8f4f87a9.tar.gz
frameworks_base-bb51c40d89c7dbdee7d7507fdfe0a64e8f4f87a9.tar.bz2
Begin gl2 support. Renderscript still uses GL1.1 by default. However, 2.0 can be enabled and will render most tests correctly.
Diffstat (limited to 'libs/rs/rsProgram.h')
-rw-r--r--libs/rs/rsProgram.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/rs/rsProgram.h b/libs/rs/rsProgram.h
index 86a46e2..06c72f9 100644
--- a/libs/rs/rsProgram.h
+++ b/libs/rs/rsProgram.h
@@ -25,14 +25,26 @@ namespace android {
namespace renderscript {
+class ShaderCache;
class Program : public ObjectBase
{
public:
+ const static uint32_t MAX_ATTRIBS = 8;
+ const static uint32_t MAX_UNIFORMS = 16;
+
Program(Context *, Element *in, Element *out);
virtual ~Program();
void bindAllocation(Allocation *);
+ virtual void createShader();
+
+ uint32_t getShaderID() const {return mShaderID;}
+
+ uint32_t getAttribCount() const {return mAttribCount;}
+ uint32_t getUniformCount() const {return mUniformCount;}
+ const String8 & getAttribName(uint32_t i) const {return mAttribNames[i];}
+ const String8 & getUniformName(uint32_t i) const {return mUniformNames[i];}
protected:
// Components not listed in "in" will be passed though
@@ -43,7 +55,15 @@ protected:
ObjectBaseRef<Allocation> mConstants;
mutable bool mDirty;
+ String8 mShader;
+ uint32_t mShaderID;
+
+ uint32_t mAttribCount;
+ uint32_t mUniformCount;
+ String8 mAttribNames[MAX_ATTRIBS];
+ String8 mUniformNames[MAX_UNIFORMS];
+ bool loadShader(uint32_t type);
public:
void forceDirty() const {mDirty = true;}