diff options
| author | Jason Sams <rjsams@android.com> | 2009-11-25 13:22:07 -0800 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2009-11-25 13:22:07 -0800 |
| commit | bb51c40d89c7dbdee7d7507fdfe0a64e8f4f87a9 (patch) | |
| tree | 55de9e729267eb463e07599b6b809fb4635c9472 /libs/rs/rsProgram.h | |
| parent | 3fdee335fe95ab94ef1ee619ad37f9369447fde5 (diff) | |
| download | frameworks_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.h | 20 |
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;} |
