summaryrefslogtreecommitdiff
path: root/libs/rs/rsScriptC.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2009-12-15 12:58:36 -0800
committer Jason Sams <rjsams@android.com> 2009-12-15 12:58:36 -0800
commit0011bcf57ff711a221a3a4c73f2a79125111647d (patch)
treee2030624a41f8c6f07856841d98bc088b1cb2640 /libs/rs/rsScriptC.cpp
parent11fbdf50206abc9d21fd72ce7536648f083b9148 (diff)
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/rsScriptC.cpp')
-rw-r--r--libs/rs/rsScriptC.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index f11b862af61b..3fa981316753 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -270,12 +270,12 @@ void ScriptCState::runCompiler(Context *rsc, ScriptC *s)
static void appendElementBody(String8 *s, const Element *e)
{
s->append(" {\n");
- for (size_t ct2=0; ct2 < e->getComponentCount(); ct2++) {
- const Component *c = e->getComponent(ct2);
+ for (size_t ct2=0; ct2 < e->getFieldCount(); ct2++) {
+ const Element *c = e->getField(ct2);
s->append(" ");
s->append(c->getCType());
s->append(" ");
- s->append(c->getComponentName());
+ s->append(e->getFieldName(ct2));
s->append(";\n");
}
s->append("}");
@@ -321,7 +321,7 @@ void ScriptCState::appendTypes(const Context *rsc, String8 *str)
continue;
}
const Element *e = t->getElement();
- if (e->getName() && (e->getComponentCount() > 1)) {
+ if (e->getName() && (e->getFieldCount() > 1)) {
String8 s("struct struct_");
s.append(e->getName());
appendElementBody(&s, e);
@@ -338,12 +338,12 @@ void ScriptCState::appendTypes(const Context *rsc, String8 *str)
}
if (t->getName()) {
- for (size_t ct2=0; ct2 < e->getComponentCount(); ct2++) {
- const Component *c = e->getComponent(ct2);
+ for (size_t ct2=0; ct2 < e->getFieldCount(); ct2++) {
+ const Element *c = e->getField(ct2);
tmp.setTo("#define OFFSETOF_");
tmp.append(t->getName());
tmp.append("_");
- tmp.append(c->getComponentName());
+ tmp.append(e->getFieldName(ct2));
sprintf(buf, " %i\n", ct2);
tmp.append(buf);
if (rsc->props.mLogScripts) {
@@ -355,7 +355,7 @@ void ScriptCState::appendTypes(const Context *rsc, String8 *str)
if (mSlotNames[ct].length() > 0) {
String8 s;
- if (e->getComponentCount() > 1) {
+ if (e->getFieldCount() > 1) {
if (e->getName()) {
// Use the named struct
s.setTo(e->getName());
@@ -373,7 +373,7 @@ void ScriptCState::appendTypes(const Context *rsc, String8 *str)
}
} else {
// Just make an array
- s.setTo(e->getComponent(0)->getCType());
+ s.setTo(e->getField(0)->getCType());
s.append("_t *");
}
s.append(mSlotNames[ct]);