Revert "Remove dynamic indexing of matrices and vectors in HLSL"
Failing build on Clang-win:
..\..\third_party\angle\src\compiler\translator\RemoveDynamicIndexing.cpp(128,43) : error: expected '(' for function-style cast or type construction
fieldType.setPrimarySize(unsigned char(indexedType.getRows()));
~~~~~~~~ ^
BUG=angleproject:1116
This reverts commit 7535b761dd4740c8e76b888d7c58c7cbeefd2083.
Change-Id: I7b502e3dcd45e17b7ed88fec18be702614d9ac65
Reviewed-on: https://chromium-review.googlesource.com/309772
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 46dddc6..03ada06 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -153,15 +153,6 @@
{
}
-bool TCompiler::shouldRunLoopAndIndexingValidation(int compileOptions) const
-{
- // If compiling an ESSL 1.00 shader for WebGL, or if its been requested through the API,
- // validate loop and indexing as well (to verify that the shader only uses minimal functionality
- // of ESSL 1.00 as in Appendix A of the spec).
- return (IsWebGLBasedSpec(shaderSpec) && shaderVersion == 100) ||
- (compileOptions & SH_VALIDATE_LOOP_INDEXING);
-}
-
bool TCompiler::Init(const ShBuiltInResources& resources)
{
shaderVersion = 100;
@@ -239,6 +230,12 @@
success = false;
}
+ // If compiling an ESSL 1.00 shader for WebGL, or if its been requested through the API,
+ // validate loop and indexing as well (to verify that the shader only uses minimal functionality
+ // of ESSL 1.00 as in Appendix A of the spec).
+ bool validateLoopAndIndexing = (IsWebGLBasedSpec(shaderSpec) && shaderVersion == 100) ||
+ (compileOptions & SH_VALIDATE_LOOP_INDEXING);
+
TIntermNode *root = nullptr;
if (success)
@@ -284,7 +281,7 @@
if (success && shaderVersion == 300 && shaderType == GL_FRAGMENT_SHADER)
success = validateOutputs(root);
- if (success && shouldRunLoopAndIndexingValidation(compileOptions))
+ if (success && validateLoopAndIndexing)
success = validateLimitations(root);
if (success && (compileOptions & SH_TIMING_RESTRICTIONS))