Allow tessellation shaders to work on versions back to 150. Also combined all the tessellation tests into a single run.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24569 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -9,5 +9,5 @@
|
||||
// source have to figure out how to create revision.h just to get a build
|
||||
// going. However, if it is not updated, it can be a version behind.
|
||||
|
||||
#define GLSLANG_REVISION "24530"
|
||||
#define GLSLANG_DATE "2013/12/16 16:58:15"
|
||||
#define GLSLANG_REVISION "24551"
|
||||
#define GLSLANG_DATE "2013/12/17 20:06:24"
|
||||
|
||||
@@ -811,7 +811,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
if (version >= 400)
|
||||
if (version >= 150)
|
||||
stageBuiltins[EShLangTessControl].append(
|
||||
"void barrier();"
|
||||
);
|
||||
@@ -1255,7 +1255,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
if (version >= 400) {
|
||||
if (version >= 150) {
|
||||
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
|
||||
// as it depends on the resource sizing of gl_MaxPatchVertices.
|
||||
|
||||
@@ -1293,7 +1293,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
if (version >= 400) {
|
||||
if (version >= 150) {
|
||||
// Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below,
|
||||
// as it depends on the resource sizing of gl_MaxPatchVertices.
|
||||
|
||||
@@ -2001,7 +2001,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
||||
}
|
||||
|
||||
// tessellation
|
||||
if (version >= 400) {
|
||||
if (version >= 150) {
|
||||
snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlInputComponents = %d;", resources.maxTessControlInputComponents);
|
||||
s.append(builtInConstant);
|
||||
snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlOutputComponents = %d;", resources.maxTessControlOutputComponents);
|
||||
|
||||
@@ -654,6 +654,11 @@ int TScanContext::tokenizeIdentifier()
|
||||
return keyword;
|
||||
|
||||
case PATCH:
|
||||
if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionsTurnedOn(1, &GL_ARB_tessellation_shader))
|
||||
return es30ReservedFromGLSL(150);
|
||||
else
|
||||
return es30ReservedFromGLSL(400);
|
||||
|
||||
case SAMPLE:
|
||||
case SUBROUTINE:
|
||||
return es30ReservedFromGLSL(400);
|
||||
|
||||
@@ -191,7 +191,7 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
|
||||
// do the per-stage tables
|
||||
InitializeStageSymbolTable(builtIns, version, profile, EShLangVertex, infoSink, commonTable, symbolTables);
|
||||
InitializeStageSymbolTable(builtIns, version, profile, EShLangFragment, infoSink, commonTable, symbolTables);
|
||||
if (profile != EEsProfile && version >= 400) {
|
||||
if (profile != EEsProfile && version >= 150) {
|
||||
InitializeStageSymbolTable(builtIns, version, profile, EShLangTessControl, infoSink, commonTable, symbolTables);
|
||||
InitializeStageSymbolTable(builtIns, version, profile, EShLangTessEvaluation, infoSink, commonTable, symbolTables);
|
||||
}
|
||||
@@ -353,10 +353,10 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
break;
|
||||
case EShLangTessControl:
|
||||
case EShLangTessEvaluation:
|
||||
if (version < 400 || (profile != ECoreProfile && profile != ECompatibilityProfile)) {
|
||||
if (version < 150 || (profile != ECoreProfile && profile != ECompatibilityProfile)) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: tessellation shaders require non-es profile and version 400 or above");
|
||||
version = 400;
|
||||
infoSink.info.message(EPrefixError, "#version: tessellation shaders require non-es profile and version 150 or above");
|
||||
version = 150;
|
||||
profile = ECoreProfile;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -85,7 +85,7 @@ const char* const GL_ARB_shading_language_420pack = "GL_ARB_shading_language_420
|
||||
const char* const GL_ARB_texture_gather = "GL_ARB_texture_gather";
|
||||
const char* const GL_ARB_gpu_shader5 = "GL_ARB_gpu_shader5";
|
||||
const char* const GL_ARB_separate_shader_objects = "GL_ARB_separate_shader_objects";
|
||||
const char* const GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"; // TODO: tessellation: make this extension work on version 150 and above shaders
|
||||
const char* const GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader";
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
|
||||
@@ -1227,7 +1227,6 @@ storage_qualifier
|
||||
| PATCH {
|
||||
parseContext.globalCheck($1.loc, "patch");
|
||||
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch");
|
||||
parseContext.profileRequires($1.loc, ~EEsProfile, 400, 1, &GL_ARB_tessellation_shader, "patch");
|
||||
$$.init($1.loc);
|
||||
$$.qualifier.patch = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user