Add comments to ArrayBoundsClamper about why 'clamp'

was not used to do the bounds clamping.

BUG=397

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1780 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/third_party/compiler/ArrayBoundsClamper.cpp b/src/third_party/compiler/ArrayBoundsClamper.cpp
index 33d9b23..2229cd2 100644
--- a/src/third_party/compiler/ArrayBoundsClamper.cpp
+++ b/src/third_party/compiler/ArrayBoundsClamper.cpp
@@ -25,6 +25,15 @@
 
 #include "third_party/compiler/ArrayBoundsClamper.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
+// function call.  An inline ternary operator might have been better, but since
+// the index value might be an expression itself, we'd have to make temporary
+// variables to avoid evaluating the expression multiple times.  And making
+// temporary variables was difficult because ANGLE would then need to make more
+// brutal changes to the expression tree.
+
 const char* kIntClampBegin = "// BEGIN: Generated code for array bounds clamping\n\n";
 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";