summaryrefslogtreecommitdiff
path: root/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp')
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp b/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
index cab8056bc..db5f7290f 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
@@ -4,6 +4,7 @@
// found in the LICENSE file.
//
+#include "compiler/ArrayBoundsClamper.h"
#include "compiler/BuiltInFunctionEmulator.h"
#include "compiler/DetectRecursion.h"
#include "compiler/ForLoopUnroll.h"
@@ -186,6 +187,10 @@ bool TCompiler::compile(const char* const shaderStrings[],
if (success && (compileOptions & SH_EMULATE_BUILT_IN_FUNCTIONS))
builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(root);
+ // Clamping uniform array bounds needs to happen after validateLimitations pass.
+ if (success && (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS))
+ arrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root);
+
// Call mapLongVariableNames() before collectAttribsUniforms() so in
// collectAttribsUniforms() we already have the mapped symbol names and
// we could composite mapped and original variable names.
@@ -231,6 +236,7 @@ void TCompiler::clearResults()
uniforms.clear();
builtInFunctionEmulator.Cleanup();
+ arrayBoundsClamper.Cleanup();
}
bool TCompiler::detectRecursion(TIntermNode* root)
@@ -331,3 +337,9 @@ const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
{
return builtInFunctionEmulator;
}
+
+const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const
+{
+ return arrayBoundsClamper;
+}
+