Implement shader compiler support for uint scalars.
Bug 19331817
Change-Id: Ie901756ef4fdbab1dfa6ae01c77104fc84de247f
Reviewed-on: https://swiftshader-review.googlesource.com/2312
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/ValidateLimitations.cpp b/src/OpenGL/compiler/ValidateLimitations.cpp
index ffb8a17..701abc5 100644
--- a/src/OpenGL/compiler/ValidateLimitations.cpp
+++ b/src/OpenGL/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());