summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsElement.h
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-12-15 12:58:36 -0800
committerJason Sams <rjsams@android.com>2009-12-15 12:58:36 -0800
commit0011bcf57ff711a221a3a4c73f2a79125111647d (patch)
treee2030624a41f8c6f07856841d98bc088b1cb2640 /libs/rs/rsElement.h
parent11fbdf50206abc9d21fd72ce7536648f083b9148 (diff)
downloadframeworks_base-0011bcf57ff711a221a3a4c73f2a79125111647d.zip
frameworks_base-0011bcf57ff711a221a3a4c73f2a79125111647d.tar.gz
frameworks_base-0011bcf57ff711a221a3a4c73f2a79125111647d.tar.bz2
Continue development of es2.0 user shader support for renderscript. This change cleans up ProgramVertex creation and adds support for passing input, output, and constant type info.
Diffstat (limited to 'libs/rs/rsElement.h')
-rw-r--r--libs/rs/rsElement.h50
1 files changed, 38 insertions, 12 deletions
diff --git a/libs/rs/rsElement.h b/libs/rs/rsElement.h
index b41c552..43e2820 100644
--- a/libs/rs/rsElement.h
+++ b/libs/rs/rsElement.h
@@ -17,7 +17,9 @@
#ifndef ANDROID_STRUCTURED_ELEMENT_H
#define ANDROID_STRUCTURED_ELEMENT_H
-#include "rsComponent.h"
+//#include "rsComponent.h"
+#include "rsUtils.h"
+#include "rsObjectBase.h"
// ---------------------------------------------------------------------------
namespace android {
@@ -28,11 +30,10 @@ namespace renderscript {
class Element : public ObjectBase
{
public:
- Element(Context *, uint32_t count);
~Element();
- void setComponent(uint32_t idx, Component *c);
+ //void setComponent(uint32_t idx, Component *c);
uint32_t getGLType() const;
uint32_t getGLFormat() const;
@@ -43,26 +44,50 @@ public:
return (getSizeBits() + 7) >> 3;
}
- size_t getComponentOffsetBits(uint32_t componentNumber) const;
- size_t getComponentOffsetBytes(uint32_t componentNumber) const {
- return (getComponentOffsetBits(componentNumber) + 7) >> 3;
+ size_t getFieldOffsetBits(uint32_t componentNumber) const;
+ size_t getFieldOffsetBytes(uint32_t componentNumber) const {
+ return (getFieldOffsetBits(componentNumber) + 7) >> 3;
}
- uint32_t getComponentCount() const {return mComponentCount;}
- Component * getComponent(uint32_t idx) const {return mComponents[idx].get();}
+ uint32_t getFieldCount() const {return mFieldCount;}
+ const Element * getField(uint32_t idx) const {return mFields[idx].e.get();}
+ const char * getFieldName(uint32_t idx) const {return mFields[idx].name.string();}
+ RsDataType getType() const {return mType;}
+ bool getIsNormalized() const {return mIsNormalized;}
+ RsDataKind getKind() const {return mKind;}
+ uint32_t getBits() const {return mBits;}
+ //uint32_t getGLType() const;
+ const char * getCType() const;
void dumpLOGV(const char *prefix) const;
+
+ static Element * create(Context *rsc, RsDataKind dk, RsDataType dt,
+ bool isNorm, size_t bits);
+ static Element * create(Context *rsc, Element **, const char **,
+ const size_t * lengths, size_t count);
+
protected:
// deallocate any components that are part of this element.
void clear();
- size_t mComponentCount;
- ObjectBaseRef<Component> * mComponents;
- //uint32_t *mOffsetTable;
+ typedef struct {
+ String8 name;
+ ObjectBaseRef<Element> e;
+ } ElementField_t;
+ ElementField_t *mFields;
+ size_t mFieldCount;
+
Element(Context *);
+
+
+ RsDataType mType;
+ bool mIsNormalized;
+ RsDataKind mKind;
+ uint32_t mBits;
+ //String8 mName;
};
@@ -71,7 +96,8 @@ public:
ElementState();
~ElementState();
- Vector<Component *> mComponentBuildList;
+ Vector<Element *> mBuildList;
+ Vector<String8> mNames;
};