summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsProgram.h
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-12-17 16:55:08 -0800
committerJason Sams <rjsams@android.com>2009-12-17 16:55:08 -0800
commit68afd01ec9fd37774d8291192952a25e5605b6fb (patch)
treeb75c5b23b57446285d9c14a5d789722b916ea1e8 /libs/rs/rsProgram.h
parent8bb41dd61474e977aa61048ba8f733a984a3b22d (diff)
downloadframeworks_base-68afd01ec9fd37774d8291192952a25e5605b6fb.zip
frameworks_base-68afd01ec9fd37774d8291192952a25e5605b6fb.tar.gz
frameworks_base-68afd01ec9fd37774d8291192952a25e5605b6fb.tar.bz2
Move texture bindings to base program object. Change ProgramFragment creation to require a texture format in 1.0 mode.
Diffstat (limited to 'libs/rs/rsProgram.h')
-rw-r--r--libs/rs/rsProgram.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/rs/rsProgram.h b/libs/rs/rsProgram.h
index 003498e..25a5434 100644
--- a/libs/rs/rsProgram.h
+++ b/libs/rs/rsProgram.h
@@ -32,6 +32,7 @@ class Program : public ObjectBase
public:
const static uint32_t MAX_ATTRIBS = 8;
const static uint32_t MAX_UNIFORMS = 16;
+ const static uint32_t MAX_TEXTURE = 2;
Program(Context *);
Program(Context *, const char * shaderText, uint32_t shaderLength,
@@ -41,6 +42,9 @@ public:
void bindAllocation(Allocation *);
virtual void createShader();
+ void bindTexture(uint32_t slot, Allocation *);
+ void bindSampler(uint32_t slot, Sampler *);
+
uint32_t getShaderID() const {return mShaderID;}
void setShader(const char *, uint32_t len);
@@ -72,6 +76,15 @@ protected:
String8 mAttribNames[MAX_ATTRIBS];
String8 mUniformNames[MAX_UNIFORMS];
+ // The difference between Textures and Constants is how they are accessed
+ // Texture lookups go though a sampler which in effect converts normalized
+ // coordinates into type specific. Multiple samples may also be taken
+ // and filtered.
+ //
+ // Constants are strictly accessed by programetic loads.
+ ObjectBaseRef<Allocation> mTextures[MAX_TEXTURE];
+ ObjectBaseRef<Sampler> mSamplers[MAX_TEXTURE];
+
bool loadShader(Context *, uint32_t type);
public: