Also prototype the Lod0 function variant if needed.

TRAC #21842
Issue=374
Signed-off-by: Daniel Koch
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1307 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index bea03ae..a430695 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -1340,7 +1340,7 @@
       case EOpPrototype:
         if (visit == PreVisit)
         {
-            out << typeString(node->getType()) << " " << decorate(node->getName()) << "(";
+            out << typeString(node->getType()) << " " << decorate(node->getName()) << (mOutputLod0Function ? "Lod0(" : "(");
 
             TIntermSequence &arguments = node->getSequence();
 
@@ -1362,6 +1362,14 @@
 
             out << ");\n";
 
+            // Also prototype the Lod0 variant if needed
+            if (mContainsLoopDiscontinuity && !mOutputLod0Function)
+            {
+                mOutputLod0Function = true;
+                node->traverse(this);
+                mOutputLod0Function = false;
+            }
+
             return false;
         }
         break;