Implement most of GL_ARB_explicit_attrib_location (all but index on fragment output).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27545 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
8aa57c3c15
commit
f856599601
7 changed files with 132 additions and 96 deletions
|
|
@ -3037,7 +3037,8 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
|
|||
return;
|
||||
} else if (id == "location") {
|
||||
profileRequires(loc, EEsProfile, 300, 0, "location");
|
||||
profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, "location");
|
||||
const char* exts[2] = { GL_ARB_separate_shader_objects, GL_ARB_explicit_attrib_location };
|
||||
profileRequires(loc, ~EEsProfile, 330, 2, exts, "location");
|
||||
if ((unsigned int)value >= TQualifier::layoutLocationEnd)
|
||||
error(loc, "location is too large", id.c_str(), "");
|
||||
else
|
||||
|
|
@ -3354,9 +3355,10 @@ void TParseContext::layoutQualifierCheck(TSourceLoc loc, const TQualifier& quali
|
|||
if (profile == EEsProfile)
|
||||
requireStage(loc, EShLangVertex, feature);
|
||||
requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature);
|
||||
if (language == EShLangVertex)
|
||||
profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, feature);
|
||||
else
|
||||
if (language == EShLangVertex) {
|
||||
const char* exts[2] = { GL_ARB_separate_shader_objects, GL_ARB_explicit_attrib_location };
|
||||
profileRequires(loc, ~EEsProfile, 330, 2, exts, feature);
|
||||
} else
|
||||
profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
|
||||
break;
|
||||
}
|
||||
|
|
@ -3366,9 +3368,10 @@ void TParseContext::layoutQualifierCheck(TSourceLoc loc, const TQualifier& quali
|
|||
if (profile == EEsProfile)
|
||||
requireStage(loc, EShLangFragment, feature);
|
||||
requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature);
|
||||
if (language == EShLangFragment)
|
||||
profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, feature);
|
||||
else
|
||||
if (language == EShLangFragment) {
|
||||
const char* exts[2] = { GL_ARB_separate_shader_objects, GL_ARB_explicit_attrib_location };
|
||||
profileRequires(loc, ~EEsProfile, 330, 2, exts, feature);
|
||||
} else
|
||||
profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ void TParseContext::initializeExtensionBehavior()
|
|||
extensionBehavior[GL_EXT_frag_depth] = EBhDisable;
|
||||
extensionBehavior[GL_OES_EGL_image_external] = EBhDisable;
|
||||
extensionBehavior[GL_EXT_shader_texture_lod] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_shader_texture_lod] = EBhDisable;
|
||||
|
||||
extensionBehavior[GL_ARB_texture_rectangle] = EBhDisable;
|
||||
extensionBehavior[GL_3DL_array_objects] = EBhDisable;
|
||||
|
|
@ -165,6 +164,8 @@ void TParseContext::initializeExtensionBehavior()
|
|||
extensionBehavior[GL_ARB_tessellation_shader] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_enhanced_layouts] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_texture_cube_map_array] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_shader_texture_lod] = EBhDisable;
|
||||
extensionBehavior[GL_ARB_explicit_attrib_location] = EBhDisablePartial; // "index" for fragment outputs is missing
|
||||
}
|
||||
|
||||
// Get code that is not part of a shared symbol table, is specific to this shader,
|
||||
|
|
@ -201,7 +202,8 @@ const char* TParseContext::getPreamble()
|
|||
"#define GL_ARB_tessellation_shader 1\n"
|
||||
"#define GL_ARB_enhanced_layouts 1\n"
|
||||
"#define GL_ARB_texture_cube_map_array 1\n"
|
||||
"#define GL_ARB_shader_texture_lod 1\n";
|
||||
"#define GL_ARB_shader_texture_lod 1\n"
|
||||
"#define GL_ARB_explicit_attrib_location 1\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ const char* const GL_ARB_tessellation_shader = "GL_ARB_tessellation_shader"
|
|||
const char* const GL_ARB_enhanced_layouts = "GL_ARB_enhanced_layouts";
|
||||
const char* const GL_ARB_texture_cube_map_array = "GL_ARB_texture_cube_map_array";
|
||||
const char* const GL_ARB_shader_texture_lod = "GL_ARB_shader_texture_lod";
|
||||
const char* const GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attrib_location";
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue