Fix vertex texture fetch.

The texture v coordinate was still being flipped.

Fixes http://code.google.com/p/chromium/issues/detail?id=136650.
Review URL: https://codereview.appspot.com/6345095

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1214 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputHLSL.cpp b/src/compiler/OutputHLSL.cpp
index c14d7f6..bea03ae 100644
--- a/src/compiler/OutputHLSL.cpp
+++ b/src/compiler/OutputHLSL.cpp
@@ -422,26 +422,12 @@
                "\n";
         out <<  uniforms;
         out << "\n";
-
-        // The texture fetch functions "flip" the Y coordinate in one way or another. This is because textures are stored
-        // according to the OpenGL convention, i.e. (0, 0) is "bottom left", rather than the D3D convention where (0, 0)
-        // is "top left". Since the HLSL texture fetch functions expect textures to be stored according to the D3D
-        // convention, the Y coordinate passed to these functions is adjusted to compensate.
-        //
-        // The simplest case is texture2D where the mapping is Y -> 1-Y, which maps [0, 1] -> [1, 0].
-        //
-        // The texture2DProj functions are more complicated because the projection divides by either Z or W. For the vec3
-        // case, the mapping is Y -> Z-Y or Y/Z -> 1-Y/Z, which again maps [0, 1] -> [1, 0].
-        //
-        // For cube textures the mapping is Y -> -Y, which maps [-1, 1] -> [1, -1]. This is not sufficient on its own for the
-        // +Y and -Y faces, which are now on the "wrong sides" of the cube. This is compensated for by exchanging the
-        // +Y and -Y faces everywhere else throughout the code.
         
         if (mUsesTexture2D)
         {
             out << "float4 gl_texture2D(sampler2D s, float2 t)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x, 1 - t.y, 0, 0));\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
                    "}\n"
                    "\n";
         }
@@ -450,7 +436,7 @@
         {
             out << "float4 gl_texture2DLod(sampler2D s, float2 t, float lod)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x, 1 - t.y, 0, lod));\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, lod));\n"
                    "}\n"
                    "\n";
         }
@@ -459,12 +445,12 @@
         {
             out << "float4 gl_texture2DProj(sampler2D s, float3 t)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.z, 1 - t.y / t.z, 0, 0));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProj(sampler2D s, float4 t)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.w, 1 - t.y / t.w, 0, 0));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
                    "}\n"
                    "\n";
         }
@@ -473,12 +459,12 @@
         {
             out << "float4 gl_texture2DProjLod(sampler2D s, float3 t, float lod)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.z, 1 - t.y / t.z, 0, lod));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, lod));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProjLod(sampler2D s, float4 t, float lod)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.w, 1 - t.y / t.w, 0, lod));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, lod));\n"
                    "}\n"
                    "\n";
         }
@@ -487,7 +473,7 @@
         {
             out << "float4 gl_textureCube(samplerCUBE s, float3 t)\n"
                    "{\n"
-                   "    return texCUBElod(s, float4(t.x, -t.y, t.z, 0));\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
                    "}\n"
                    "\n";
         }
@@ -496,7 +482,7 @@
         {
             out << "float4 gl_textureCubeLod(samplerCUBE s, float3 t, float lod)\n"
                    "{\n"
-                   "    return texCUBElod(s, float4(t.x, -t.y, t.z, lod));\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, lod));\n"
                    "}\n"
                    "\n";
         }