summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsType.cpp
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2010-09-29 09:49:13 -0700
committerAlex Sakhartchouk <alexst@google.com>2010-09-29 09:49:13 -0700
commit4378f1175546616c76ecb7f0b1159940ab22d5f4 (patch)
tree900b42e369c9cd58340c88dee93dc0139c7afe5c /libs/rs/rsType.cpp
parent5f421a56786cf7c71159280c51bd4280f5199cfb (diff)
downloadframeworks_base-4378f1175546616c76ecb7f0b1159940ab22d5f4.zip
frameworks_base-4378f1175546616c76ecb7f0b1159940ab22d5f4.tar.gz
frameworks_base-4378f1175546616c76ecb7f0b1159940ab22d5f4.tar.bz2
More robust attribute binding
Adding attribute and uniform debug logging. Checking to see if aniso filtering is available. Change-Id: I2ed9d166ed7ff3df971d7af18b7a33f4e3ade928
Diffstat (limited to 'libs/rs/rsType.cpp')
-rw-r--r--libs/rs/rsType.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp
index 478cc95..1ee07cd 100644
--- a/libs/rs/rsType.cpp
+++ b/libs/rs/rsType.cpp
@@ -145,21 +145,26 @@ uint32_t Type::getLODOffset(uint32_t lod, uint32_t x, uint32_t y, uint32_t z) co
void Type::makeGLComponents()
{
- if(getElement()->getFieldCount() >= RS_MAX_ATTRIBS) {
- return;
- }
-
uint32_t userNum = 0;
-
for (uint32_t ct=0; ct < getElement()->getFieldCount(); ct++) {
const Component &c = getElement()->getField(ct)->getComponent();
+ if(getElement()->getFieldName(ct)[0] == '#') {
+ continue;
+ }
+
mAttribs[userNum].size = c.getVectorSize();
mAttribs[userNum].offset = mElement->getFieldOffsetBytes(ct);
mAttribs[userNum].type = c.getGLType();
mAttribs[userNum].normalized = c.getType() != RS_TYPE_FLOAT_32;//c.getIsNormalized();
- mAttribs[userNum].name.setTo(getElement()->getFieldName(ct));
+ String8 tmp(RS_SHADER_ATTR);
+ tmp.append(getElement()->getFieldName(ct));
+ mAttribs[userNum].name.setTo(tmp.string());
userNum ++;
+
+ if(userNum == RS_MAX_ATTRIBS) {
+ return;
+ }
}
}