Add support for the unsigned integer scalar type to the shader translator.
TRAC #23080
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Jamie Madill
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2403 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/ValidateLimitations.cpp b/src/compiler/ValidateLimitations.cpp
index aeb0d8f..164c187 100644
--- a/src/compiler/ValidateLimitations.cpp
+++ b/src/compiler/ValidateLimitations.cpp
@@ -79,6 +79,10 @@
case EbtFloat:
mUsesFloatLoopIndex = true;
break;
+ case EbtUInt:
+ mUsesIntLoopIndex = true;
+ MarkLoopForUnroll(symbol, mLoopStack);
+ break;
case EbtInt:
mUsesIntLoopIndex = true;
MarkLoopForUnroll(symbol, mLoopStack);
@@ -269,7 +273,7 @@
}
// The loop index has type int or float.
TBasicType type = symbol->getBasicType();
- if ((type != EbtInt) && (type != EbtFloat)) {
+ if ((type != EbtInt) && (type != EbtUInt) && (type != EbtFloat)) {
error(symbol->getLine(),
"Invalid type for loop index", getBasicString(type));
return false;
@@ -492,7 +496,7 @@
bool valid = true;
TIntermTyped* index = node->getRight();
// The index expression must have integral type.
- if (!index->isScalar() || (index->getBasicType() != EbtInt)) {
+ if (!index->isScalarInt()) {
error(index->getLine(),
"Index expression must have integral type",
index->getCompleteString().c_str());