diff options
author | Jamie Madill <jmadill@transgaming.com> | 2013-07-12 16:13:12 -0400 |
---|---|---|
committer | Shannon Woods <shannonwoods@chromium.org> | 2013-07-19 16:42:15 -0400 |
commit | d5c6abc474d0f7ec001ef2749dcaa0e958eeb4dd (patch) | |
tree | d92cee179a39f3430b7515d11a2881e16714af13 | |
parent | 1bc1b6a3cc5b3234927181514e1e2ba57423ee5c (diff) | |
download | angle_dx11-d5c6abc474d0f7ec001ef2749dcaa0e958eeb4dd.tar.gz |
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
-rw-r--r-- | src/compiler/Compiler.cpp | 2 | ||||
-rw-r--r-- | src/compiler/Initialize.cpp | 9 | ||||
-rw-r--r-- | src/compiler/Initialize.h | 3 |
3 files changed, 4 insertions, 10 deletions
diff --git a/src/compiler/Compiler.cpp b/src/compiler/Compiler.cpp index 4525cb92..263ec770 100644 --- a/src/compiler/Compiler.cpp +++ b/src/compiler/Compiler.cpp @@ -237,7 +237,7 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources) 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 0ed3b8df..027b2aab 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); @@ -415,11 +414,7 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI 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("gl_MaxDrawBuffers", maxDrawBuffers); + symbolTable.insertConstInt("gl_MaxDrawBuffers", resources.MaxDrawBuffers); } } diff --git a/src/compiler/Initialize.h b/src/compiler/Initialize.h index d08700cc..4aa13466 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, |