Fix the reported shader gl_MaxDrawBuffers to be compliant with the new EXT_draw_buffers spec.

From the extension spec:

"8) What value should gl_MaxDrawBuffers in the shading language report?"

"RESOLVE: It should match MAX_DRAW_BUFFERS_EXT from the API. None of the API or
GLSL specifications explicitly state the linkage between API and SL constants,
but it seems logical that one would expect them to match, regardless of whether
or not an extension directive is used in the shading language."

TRAC #23509

Signed-off-by: Shannon Woods
Signed-off-by: Nicolas Capens
Authored-by: Jamie Madill
diff --git a/src/compiler/Compiler.cpp b/src/compiler/Compiler.cpp
index c7c792c..529c30a 100644
--- a/src/compiler/Compiler.cpp
+++ b/src/compiler/Compiler.cpp
@@ -247,7 +247,7 @@
       default: assert(false && "Language not supported");
     }
 
-    InsertBuiltInFunctions(shaderType, shaderSpec, resources, extensionBehavior, symbolTable);
+    InsertBuiltInFunctions(shaderType, shaderSpec, resources, symbolTable);
 
     IdentifyBuiltIns(shaderType, shaderSpec, resources, symbolTable);
 
diff --git a/src/compiler/Initialize.cpp b/src/compiler/Initialize.cpp
index 345ecac..998a89c 100644
--- a/src/compiler/Initialize.cpp
+++ b/src/compiler/Initialize.cpp
@@ -14,8 +14,7 @@
 
 #include "compiler/intermediate.h"
 
-void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltInResources &resources,
-                            const TExtensionBehavior &extensionBehavior, TSymbolTable &symbolTable)
+void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltInResources &resources, TSymbolTable &symbolTable)
 {
     TType *float1 = new TType(EbtFloat, EbpUndefined, EvqGlobal, 1);
     TType *float2 = new TType(EbtFloat, EbpUndefined, EvqGlobal, 2);
@@ -523,11 +522,7 @@
 
     if (spec != SH_CSS_SHADERS_SPEC)
     {
-        TExtensionBehavior::const_iterator iter = extensionBehavior.find("GL_EXT_draw_buffers");
-        const bool usingMRTExtension = (iter != extensionBehavior.end() && (iter->second == EBhEnable || iter->second == EBhRequire));
-        const int maxDrawBuffers = (usingMRTExtension ? resources.MaxDrawBuffers : 1);
-
-        symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxDrawBuffers", maxDrawBuffers);
+        symbolTable.insertConstInt(ESSL1_BUILTINS, "gl_MaxDrawBuffers", resources.MaxDrawBuffers);
     }
 
     symbolTable.insertConstInt(ESSL3_BUILTINS, "gl_MaxVertexOutputVectors", resources.MaxVertexOutputVectors);
diff --git a/src/compiler/Initialize.h b/src/compiler/Initialize.h
index d08700c..4aa1346 100644
--- a/src/compiler/Initialize.h
+++ b/src/compiler/Initialize.h
@@ -11,8 +11,7 @@
 #include "compiler/ShHandle.h"
 #include "compiler/SymbolTable.h"
 
-void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltInResources &resources,
-                            const TExtensionBehavior &extensionBehavior, TSymbolTable &table);
+void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltInResources &resources, TSymbolTable &table);
 
 void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
                       const ShBuiltInResources& resources,