diff options
author | Jason Sams <rjsams@android.com> | 2009-12-17 16:55:08 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-12-17 16:55:08 -0800 |
commit | 7dad9c30a59c99b57269e1b498807b6f034d56e9 (patch) | |
tree | 3652e03385699cd42e0bf1c427224aa3b6601682 /rsProgramFragment.h | |
parent | b2a219b87c56c85d26eab0b702f272a06e912dc5 (diff) | |
download | rs-7dad9c30a59c99b57269e1b498807b6f034d56e9.tar.gz |
Move texture bindings to base program object. Change ProgramFragment creation to require a texture format in 1.0 mode.
Diffstat (limited to 'rsProgramFragment.h')
-rw-r--r-- | rsProgramFragment.h | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/rsProgramFragment.h b/rsProgramFragment.h index 14b4ec31..9fa565d4 100644 --- a/rsProgramFragment.h +++ b/rsProgramFragment.h @@ -28,11 +28,7 @@ class ProgramFragmentState; class ProgramFragment : public Program { public: - const static uint32_t MAX_TEXTURE = 2; - - - - ProgramFragment(Context *, Element *in, Element *out, bool pointSpriteEnable); + ProgramFragment(Context *, const uint32_t * params, uint32_t paramLength); ProgramFragment(Context *rsc, const char * shaderText, uint32_t shaderLength, const uint32_t * params, uint32_t paramLength); @@ -41,33 +37,14 @@ public: virtual void setupGL(const Context *, ProgramFragmentState *); virtual void setupGL2(const Context *, ProgramFragmentState *, ShaderCache *sc); - - void bindTexture(uint32_t slot, Allocation *); - void bindSampler(uint32_t slot, Sampler *); - void setType(uint32_t slot, const Element *, uint32_t dim); - - void setEnvMode(uint32_t slot, RsTexEnvMode); - void setTexEnable(uint32_t slot, bool); - virtual void createShader(); virtual void loadShader(Context *rsc); virtual void init(Context *rsc); - protected: - // 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]; - ObjectBaseRef<const Element> mTextureFormats[MAX_TEXTURE]; - uint32_t mTextureDimensions[MAX_TEXTURE]; - - // Hacks to create a program for now + uint32_t mTextureFormats[MAX_TEXTURE]; + uint32_t mTextureDimensions[MAX_TEXTURE]; RsTexEnvMode mEnvModes[MAX_TEXTURE]; uint32_t mTextureEnableMask; bool mPointSpriteEnable; |