Commit d5c6abc4 by Jamie Madill Committed by Shannon Woods

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
parent 1bc1b6a3
......@@ -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);
......
......@@ -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);
}
}
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment