summaryrefslogtreecommitdiff
path: root/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
commitc460e55d78cbe8bee95c5c947dfe541218142a5b (patch)
treec4044e0961621e61c5fb3be0411a073a688caf2c /rsProgram.h
parente6c6078f301a197f310b0ae0c12031188e7c1b6b (diff)
downloadrs-c460e55d78cbe8bee95c5c947dfe541218142a5b.tar.gz
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 'rsProgram.h')
-rw-r--r--rsProgram.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/rsProgram.h b/rsProgram.h
index 86a46e24..06c72f93 100644
--- a/rsProgram.h
+++ b/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;}