Re-land "D3D: Generate more shader debug info by default."

Re-land with fix for shader size query.

The debug info can be very useful to WebGL developers. Instead of
hiding the feature behind an unsupported and broken flag, always
enable it so that WebGL devs can access the useful translated info.

Change the debug info policy to build the full info (including
generated assembly) in Debug, and all info excepth the assembly
in Release.

BUG=angleproject:1179

Change-Id: I812b2c9ba98cb8c9d5ec95721441c70e8990b626
Reviewed-on: https://chromium-review.googlesource.com/313600
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index b92e06b..6cfa4b9 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -170,6 +170,17 @@
     return (static_cast<int>(mData.mTranslatedSource.length()) + 1);
 }
 
+int Shader::getTranslatedSourceWithDebugInfoLength() const
+{
+    const std::string &debugInfo = mImplementation->getDebugInfo();
+    if (debugInfo.empty())
+    {
+        return 0;
+    }
+
+    return (static_cast<int>(debugInfo.length()) + 1);
+}
+
 void Shader::getSourceImpl(const std::string &source, GLsizei bufSize, GLsizei *length, char *buffer)
 {
     int index = 0;
@@ -200,7 +211,7 @@
 
 void Shader::getTranslatedSourceWithDebugInfo(GLsizei bufSize, GLsizei *length, char *buffer) const
 {
-    std::string debugInfo(mImplementation->getDebugInfo());
+    const std::string &debugInfo = mImplementation->getDebugInfo();
     getSourceImpl(debugInfo, bufSize, length, buffer);
 }