diff options
Diffstat (limited to 'libs/rs/rsAllocation.h')
-rw-r--r-- | libs/rs/rsAllocation.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libs/rs/rsAllocation.h b/libs/rs/rsAllocation.h index f54284a..f0b2122 100644 --- a/libs/rs/rsAllocation.h +++ b/libs/rs/rsAllocation.h @@ -23,7 +23,7 @@ namespace android { namespace renderscript { - +class Program; class Allocation : public ObjectBase { @@ -46,10 +46,12 @@ public: void * getPtr() const {return mPtr;} const Type * getType() const {return mType.get();} - void uploadToTexture(Context *rsc, uint32_t lodOffset = 0); + void deferedUploadToTexture(const Context *rsc, uint32_t lodOffset); + void uploadToTexture(const Context *rsc); uint32_t getTextureID() const {return mTextureID;} - void uploadToBufferObject(); + void deferedUploadToBufferObject(const Context *rsc); + void uploadToBufferObject(const Context *rsc); uint32_t getBufferObjectID() const {return mBufferID;} @@ -65,13 +67,21 @@ public: void enableGLVertexBuffers() const; void setupGLIndexBuffers() const; + void addProgramToDirty(const Program *); + void removeProgramToDirty(const Program *); + virtual void dumpLOGV(const char *prefix) const; + virtual void uploadCheck(const Context *rsc); protected: + void sendDirty() const; + ObjectBaseRef<const Type> mType; void * mPtr; + Vector<const Program *> mToDirtyList; + // Usage restrictions bool mCpuWrite; bool mCpuRead; @@ -88,6 +98,7 @@ protected: // Is this a legal structure to be used as a texture source. // Initially this will require 1D or 2D and color data bool mIsTexture; + uint32_t mTextureLOD; uint32_t mTextureID; // Is this a legal structure to be used as a vertex source. @@ -95,6 +106,8 @@ protected: // is allowed. bool mIsVertexBuffer; uint32_t mBufferID; + + bool mUploadDefered; }; } |