diff options
Diffstat (limited to 'src/3rdparty/angle/src/third_party/compiler')
-rw-r--r-- | src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.cpp | 10 | ||||
-rw-r--r-- | src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.h | 10 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.cpp index fa6c8b8d79..17e272301a 100644 --- a/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.cpp +++ b/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.cpp @@ -25,6 +25,8 @@ #include "third_party/compiler/ArrayBoundsClamper.h" +#include "compiler/translator/IntermTraverse.h" + // The built-in 'clamp' instruction only accepts floats and returns a float. I // iterated a few times with our driver team who examined the output from our // compiler - they said the multiple casts generates more code than a single @@ -38,7 +40,11 @@ const char* kIntClampBegin = "// BEGIN: Generated code for array bounds clamping const char* kIntClampEnd = "// END: Generated code for array bounds clamping\n\n"; const char* kIntClampDefinition = "int webgl_int_clamp(int value, int minValue, int maxValue) { return ((value < minValue) ? minValue : ((value > maxValue) ? maxValue : value)); }\n\n"; -namespace { +namespace sh +{ + +namespace +{ class ArrayBoundsClamperMarker : public TIntermTraverser { public: @@ -105,3 +111,5 @@ void ArrayBoundsClamper::OutputClampingFunctionDefinition(TInfoSinkBase& out) co } out << kIntClampBegin << kIntClampDefinition << kIntClampEnd; } + +} // namespace sh diff --git a/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.h b/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.h index 27917e6eec..a4c407f760 100644 --- a/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.h +++ b/src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.h @@ -29,8 +29,12 @@ #include "compiler/translator/InfoSink.h" #include "compiler/translator/IntermNode.h" -class ArrayBoundsClamper { -public: +namespace sh +{ + +class ArrayBoundsClamper +{ + public: ArrayBoundsClamper(); // Must be set before compiling any shaders to ensure consistency @@ -57,4 +61,6 @@ private: bool mArrayBoundsClampDefinitionNeeded; }; +} // namespace sh + #endif // THIRD_PARTY_COMPILER_ARRAYBOUNDSCLAMPER_H_ |