Add-support-for-SPV_NV_fragment_shader_barycentric

This commit is contained in:
Chao Chen 2018-09-19 11:39:56 -07:00
parent 6dd4757f0f
commit 9eada4b971
19 changed files with 4369 additions and 4061 deletions

View File

@ -33,7 +33,7 @@ enum Op;
enum Capability;
static const int GLSLextNVVersion = 100;
static const int GLSLextNVRevision = 5;
static const int GLSLextNVRevision = 6;
//SPV_NV_sample_mask_override_coverage
const char* const E_SPV_NV_sample_mask_override_coverage = "SPV_NV_sample_mask_override_coverage";
@ -54,4 +54,7 @@ const char* const E_SPV_NVX_multiview_per_view_attributes = "SPV_NVX_multiview_p
//SPV_NV_shader_subgroup_partitioned
const char* const E_SPV_NV_shader_subgroup_partitioned = "SPV_NV_shader_subgroup_partitioned";
//SPV_NV_fragment_shader_barycentric
const char* const E_SPV_NV_fragment_shader_barycentric = "SPV_NV_fragment_shader_barycentric";
#endif // #ifndef GLSLextNV_H

View File

@ -827,6 +827,14 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addExtension(spv::E_SPV_EXT_fragment_fully_covered);
builder.addCapability(spv::CapabilityFragmentFullyCoveredEXT);
return spv::BuiltInFullyCoveredEXT;
case glslang::EbvBaryCoordNV:
builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric);
builder.addCapability(spv::CapabilityFragmentBarycentricNV);
return spv::BuiltInBaryCoordNV;
case glslang::EbvBaryCoordNoPerspNV:
builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric);
builder.addCapability(spv::CapabilityFragmentBarycentricNV);
return spv::BuiltInBaryCoordNoPerspNV;
#endif
default:
return spv::BuiltInMax;
@ -6858,6 +6866,11 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV);
builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough);
}
if (symbol->getQualifier().pervertexNV) {
builder.addDecoration(id, spv::DecorationPerVertexNV);
builder.addCapability(spv::CapabilityFragmentBarycentricNV);
builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric);
}
#endif
if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) {

View File

@ -510,7 +510,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
}else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 ||
strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 ||
strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 ||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0) {
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0) {
extInstSet = GLSLextNVInst;
#endif
}
@ -691,7 +692,8 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
strcmp(name, spv::E_SPV_NV_geometry_shader_passthrough) == 0 ||
strcmp(name, spv::E_ARB_shader_viewport_layer_array) == 0 ||
strcmp(name, spv::E_SPV_NV_viewport_array2) == 0 ||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0) {
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0) {
switch (entrypoint) {
case DecorationOverrideCoverageNV: return "OverrideCoverageNV";
case DecorationPassthroughNV: return "PassthroughNV";
@ -706,6 +708,10 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
case BuiltInPositionPerViewNV: return "PositionPerViewNV";
case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
case DecorationPerVertexNV: return "PerVertexNV";
case BuiltInBaryCoordNV: return "BaryCoordNV";
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
default: return "Bad";
}
}

View File

@ -254,6 +254,7 @@ const char* DecorationString(int decoration)
case DecorationPassthroughNV: return "PassthroughNV";
case DecorationViewportRelativeNV: return "ViewportRelativeNV";
case DecorationSecondaryViewportRelativeNV: return "SecondaryViewportRelativeNV";
case DecorationPerVertexNV: return "PerVertexNV";
#endif
case DecorationNonUniformEXT: return "DecorationNonUniformEXT";
@ -338,6 +339,8 @@ const char* BuiltInString(int builtIn)
case 5258: return "SecondaryViewportMaskNV";
case 5261: return "PositionPerViewNV";
case 5262: return "ViewportMaskPerViewNV";
case BuiltInBaryCoordNV: return "BaryCoordNV";
case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
#endif
case 5264: return "FullyCoveredEXT";
@ -826,6 +829,7 @@ const char* CapabilityString(int info)
case CapabilityShaderStereoViewNV: return "ShaderStereoViewNV";
case CapabilityPerViewAttributesNV: return "PerViewAttributesNV";
case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV";
case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
#endif
case CapabilityFragmentFullyCoveredEXT: return "FragmentFullyCoveredEXT";

View File

@ -0,0 +1,69 @@
spv.fragmentShaderBarycentric.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 43
Capability Shader
Capability FragmentBarycentricNV
Extension "SPV_NV_fragment_shader_barycentric"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 8 11 21
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_NV_fragment_shader_barycentric"
Name 4 "main"
Name 8 "value"
Name 11 "gl_BaryCoordNV"
Name 17 "vertices"
MemberName 17(vertices) 0 "attrib"
Name 21 "v"
Decorate 8(value) Location 1
Decorate 11(gl_BaryCoordNV) BuiltIn BaryCoordNV
Decorate 17(vertices) Block
Decorate 21(v) Location 0
Decorate 21(v) PerVertexNV
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(value): 7(ptr) Variable Output
9: TypeVector 6(float) 3
10: TypePointer Input 9(fvec3)
11(gl_BaryCoordNV): 10(ptr) Variable Input
12: TypeInt 32 0
13: 12(int) Constant 0
14: TypePointer Input 6(float)
17(vertices): TypeStruct 6(float)
18: 12(int) Constant 3
19: TypeArray 17(vertices) 18
20: TypePointer Input 19
21(v): 20(ptr) Variable Input
22: TypeInt 32 1
23: 22(int) Constant 0
27: 12(int) Constant 1
30: 22(int) Constant 1
35: 12(int) Constant 2
38: 22(int) Constant 2
4(main): 2 Function None 3
5: Label
15: 14(ptr) AccessChain 11(gl_BaryCoordNV) 13
16: 6(float) Load 15
24: 14(ptr) AccessChain 21(v) 23 23
25: 6(float) Load 24
26: 6(float) FMul 16 25
28: 14(ptr) AccessChain 11(gl_BaryCoordNV) 27
29: 6(float) Load 28
31: 14(ptr) AccessChain 21(v) 30 23
32: 6(float) Load 31
33: 6(float) FMul 29 32
34: 6(float) FAdd 26 33
36: 14(ptr) AccessChain 11(gl_BaryCoordNV) 35
37: 6(float) Load 36
39: 14(ptr) AccessChain 21(v) 38 23
40: 6(float) Load 39
41: 6(float) FMul 37 40
42: 6(float) FAdd 34 41
Store 8(value) 42
Return
FunctionEnd

View File

@ -0,0 +1,65 @@
spv.fragmentShaderBarycentric2.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 42
Capability Shader
Capability FragmentBarycentricNV
Extension "SPV_NV_fragment_shader_barycentric"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 8 11 20
ExecutionMode 4 OriginUpperLeft
Source ESSL 320
SourceExtension "GL_NV_fragment_shader_barycentric"
Name 4 "main"
Name 8 "value"
Name 11 "gl_BaryCoordNoPerspNV"
Name 20 "vertexIDs"
Decorate 8(value) Location 1
Decorate 11(gl_BaryCoordNoPerspNV) BuiltIn BaryCoordNoPerspNV
Decorate 20(vertexIDs) Location 0
Decorate 20(vertexIDs) PerVertexNV
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(value): 7(ptr) Variable Output
9: TypeVector 6(float) 3
10: TypePointer Input 9(fvec3)
11(gl_BaryCoordNoPerspNV): 10(ptr) Variable Input
12: TypeInt 32 0
13: 12(int) Constant 0
14: TypePointer Input 6(float)
17: 12(int) Constant 3
18: TypeArray 6(float) 17
19: TypePointer Input 18
20(vertexIDs): 19(ptr) Variable Input
21: TypeInt 32 1
22: 21(int) Constant 0
26: 12(int) Constant 1
29: 21(int) Constant 1
34: 12(int) Constant 2
37: 21(int) Constant 2
4(main): 2 Function None 3
5: Label
15: 14(ptr) AccessChain 11(gl_BaryCoordNoPerspNV) 13
16: 6(float) Load 15
23: 14(ptr) AccessChain 20(vertexIDs) 22
24: 6(float) Load 23
25: 6(float) FMul 16 24
27: 14(ptr) AccessChain 11(gl_BaryCoordNoPerspNV) 26
28: 6(float) Load 27
30: 14(ptr) AccessChain 20(vertexIDs) 29
31: 6(float) Load 30
32: 6(float) FMul 28 31
33: 6(float) FAdd 25 32
35: 14(ptr) AccessChain 11(gl_BaryCoordNoPerspNV) 34
36: 6(float) Load 35
38: 14(ptr) AccessChain 20(vertexIDs) 37
39: 6(float) Load 38
40: 6(float) FMul 36 39
41: 6(float) FAdd 33 40
Store 8(value) 41
Return
FunctionEnd

View File

@ -0,0 +1,15 @@
#version 450
#extension GL_NV_fragment_shader_barycentric : require
layout(location = 0) pervertexNV in vertices {
float attrib;
} v[];
layout(location = 1) out float value;
void main () {
value = (gl_BaryCoordNV.x * v[0].attrib +
gl_BaryCoordNV.y * v[1].attrib +
gl_BaryCoordNV.z * v[2].attrib);
}

View File

@ -0,0 +1,15 @@
#version 320 es
#extension GL_NV_fragment_shader_barycentric : require
precision highp float;
layout(location = 0) pervertexNV in float vertexIDs[3];
layout(location = 1) out float value;
void main () {
value = (gl_BaryCoordNoPerspNV.x * vertexIDs[0] +
gl_BaryCoordNoPerspNV.y * vertexIDs[1] +
gl_BaryCoordNoPerspNV.z * vertexIDs[2]);
}

View File

@ -227,6 +227,8 @@ enum TBuiltInVariable {
EbvPositionPerViewNV,
EbvViewportMaskPerViewNV,
EbvFragFullyCoveredNV,
EbvBaryCoordNV,
EbvBaryCoordNoPerspNV,
#endif
// HLSL built-ins that live only temporarily, until they get remapped
@ -365,6 +367,8 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvPositionPerViewNV: return "PositionPerViewNV";
case EbvViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
case EbvFragFullyCoveredNV: return "FragFullyCoveredNV";
case EbvBaryCoordNV: return "BaryCoordNV";
case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
#endif
default: return "unknown built-in variable";
}

View File

@ -456,6 +456,9 @@ public:
nopersp = false;
#ifdef AMD_EXTENSIONS
explicitInterp = false;
#endif
#ifdef NV_EXTENSIONS
pervertexNV = false;
#endif
}
@ -500,6 +503,9 @@ public:
bool nopersp : 1;
#ifdef AMD_EXTENSIONS
bool explicitInterp : 1;
#endif
#ifdef NV_EXTENSIONS
bool pervertexNV : 1;
#endif
bool patch : 1;
bool sample : 1;
@ -524,6 +530,7 @@ public:
{
return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly;
}
bool isInterpolation() const
{
#ifdef AMD_EXTENSIONS
@ -532,15 +539,21 @@ public:
return flat || smooth || nopersp;
#endif
}
#ifdef AMD_EXTENSIONS
bool isExplicitInterpolation() const
{
return explicitInterp;
}
#endif
bool isAuxiliary() const
{
#ifdef NV_EXTENSIONS
return centroid || patch || sample || pervertexNV;
#else
return centroid || patch || sample;
#endif
}
bool isPipeInput() const
@ -656,6 +669,11 @@ public:
return ! patch && (isPipeInput() || isPipeOutput());
case EShLangTessEvaluation:
return ! patch && isPipeInput();
#ifdef NV_EXTENSIONS
case EShLangFragment:
return pervertexNV && isPipeInput();
#endif
default:
return false;
}
@ -1720,6 +1738,10 @@ public:
#ifdef AMD_EXTENSIONS
if (qualifier.explicitInterp)
appendStr(" __explicitInterpAMD");
#endif
#ifdef NV_EXTENSIONS
if (qualifier.pervertexNV)
appendStr(" pervertexNV");
#endif
if (qualifier.patch)
appendStr(" patch");

View File

@ -5734,6 +5734,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangFragment].append(
"in bool gl_FragFullyCoveredNV;"
);
if (version >= 450)
stageBuiltins[EShLangFragment].append(
"in vec3 gl_BaryCoordNV;"
"in vec3 gl_BaryCoordNoPerspNV;"
);
#endif
} else {
// ES profile
@ -5775,6 +5780,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangFragment].append(
"highp float gl_FragDepthEXT;" // GL_EXT_frag_depth
);
#ifdef NV_EXTENSIONS
if (version >= 320)
stageBuiltins[EShLangFragment].append(
"in vec3 gl_BaryCoordNV;"
"in vec3 gl_BaryCoordNoPerspNV;"
);
#endif
}
stageBuiltins[EShLangFragment].append("\n");
@ -7904,6 +7916,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation);
BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable);
}
if ((profile != EEsProfile && version >= 450) ||
(profile == EEsProfile && version >= 320)) {
symbolTable.setVariableExtensions("gl_BaryCoordNV", 1, &E_GL_NV_fragment_shader_barycentric);
symbolTable.setVariableExtensions("gl_BaryCoordNoPerspNV", 1, &E_GL_NV_fragment_shader_barycentric);
BuiltInVariable("gl_BaryCoordNV", EbvBaryCoordNV, symbolTable);
BuiltInVariable("gl_BaryCoordNoPerspNV", EbvBaryCoordNoPerspNV, symbolTable);
}
#endif
symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth);

View File

@ -496,7 +496,12 @@ bool TParseContext::isIoResizeArray(const TType& type) const
{
return type.isArray() &&
((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) ||
(language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && ! type.getQualifier().patch));
(language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && ! type.getQualifier().patch)
#ifdef NV_EXTENSIONS
||
(language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn && type.getQualifier().pervertexNV)
#endif
);
}
// If an array is not isIoResizeArray() but is an io array, make sure it has the right size
@ -569,7 +574,12 @@ void TParseContext::checkIoArraysConsistency(const TSourceLoc& loc, bool tailOnl
const char* feature;
if (language == EShLangGeometry)
feature = TQualifier::getGeometryString(intermediate.getInputPrimitive());
else if (language == EShLangTessControl)
else if (language == EShLangTessControl
#ifdef NV_EXTENSIONS
|| language == EShLangFragment
#endif
)
feature = "vertices";
else
feature = "unknown";
@ -589,6 +599,11 @@ int TParseContext::getIoArrayImplicitSize() const
return TQualifier::mapGeometryToSize(intermediate.getInputPrimitive());
else if (language == EShLangTessControl)
return intermediate.getVertices() != TQualifier::layoutNotSet ? intermediate.getVertices() : 0;
#ifdef NV_EXTENSIONS
else if (language == EShLangFragment)
return 3; //Number of vertices for Fragment shader is always three.
#endif
else
return 0;
}
@ -602,6 +617,12 @@ void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredS
error(loc, "inconsistent input primitive for array size of", feature, name.c_str());
else if (language == EShLangTessControl)
error(loc, "inconsistent output number of vertices for array size of", feature, name.c_str());
#ifdef NV_EXTENSIONS
else if (language == EShLangFragment) {
if (type.getOuterArraySize() > requiredSize)
error(loc, " cannot be greater than 3 for pervertexNV", feature, name.c_str());
}
#endif
else
assert(0);
}
@ -3020,11 +3041,14 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble)
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
if (!qualifier.flat
#ifdef AMD_EXTENSIONS
if (! qualifier.flat && ! qualifier.explicitInterp) {
#else
if (!qualifier.flat) {
&& !qualifier.explicitInterp
#endif
#ifdef NV_EXTENSIONS
&& !qualifier.pervertexNV
#endif
) {
if (isTypeInt(publicType.basicType) ||
publicType.basicType == EbtDouble ||
(publicType.userDef && (publicType.userDef->containsBasicType(EbtInt8) ||
@ -4939,6 +4963,8 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
dst.layoutViewportRelative = true;
if (src.layoutSecondaryViewportRelativeOffset != -2048)
dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset;
if (src.pervertexNV)
dst.pervertexNV = true;
#endif
}
}

View File

@ -691,6 +691,9 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["__explicitInterpAMD"] = EXPLICITINTERPAMD;
#endif
(*KeywordMap)["centroid"] = CENTROID;
#ifdef NV_EXTENSIONS
(*KeywordMap)["pervertexNV"] = PERVERTEXNV;
#endif
(*KeywordMap)["precise"] = PRECISE;
(*KeywordMap)["invariant"] = INVARIANT;
(*KeywordMap)["packed"] = PACKED;
@ -1507,6 +1510,15 @@ int TScanContext::tokenizeIdentifier()
return identifierOrType();
#endif
#ifdef NV_EXTENSIONS
case PERVERTEXNV:
if (((parseContext.profile != EEsProfile && parseContext.version >= 450) ||
(parseContext.profile == EEsProfile && parseContext.version >= 320)) &&
parseContext.extensionTurnedOn(E_GL_NV_fragment_shader_barycentric))
return keyword;
return identifierOrType();
#endif
case FLAT:
if (parseContext.profile == EEsProfile && parseContext.version < 300)
reservedWord();

View File

@ -235,6 +235,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_NV_conservative_raster_underestimation] = EBhDisable;
extensionBehavior[E_GL_NV_shader_noperspective_interpolation] = EBhDisable;
extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable;
extensionBehavior[E_GL_NV_fragment_shader_barycentric] = EBhDisable;
#endif
// AEP
@ -405,6 +406,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_NV_shader_atomic_int64 1\n"
"#define GL_NV_conservative_raster_underestimation 1\n"
"#define GL_NV_shader_subgroup_partitioned 1\n"
"#define GL_NV_fragment_shader_barycentric 1\n"
#endif
"#define GL_KHX_shader_explicit_arithmetic_types 1\n"
"#define GL_KHX_shader_explicit_arithmetic_types_int8 1\n"

View File

@ -207,7 +207,7 @@ const char* const E_GL_NV_shader_atomic_int64 = "GL_NV_shader_
const char* const E_GL_NV_conservative_raster_underestimation = "GL_NV_conservative_raster_underestimation";
const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_noperspective_interpolation";
const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned";
const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric";
// Arrays of extensions for the above viewportEXTs duplications
const char* const viewportEXTs[] = { E_GL_ARB_shader_viewport_layer_array, E_GL_NV_viewport_array2 };

View File

@ -146,7 +146,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
%token <lex> F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4
%token <lex> F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT EXPLICITINTERPAMD
%token <lex> NOPERSPECTIVE FLAT SMOOTH LAYOUT EXPLICITINTERPAMD PERVERTEXNV
%token <lex> MAT2X2 MAT2X3 MAT2X4
%token <lex> MAT3X2 MAT3X3 MAT3X4
@ -1142,6 +1142,16 @@ interpolation_qualifier
parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
$$.init($1.loc);
$$.qualifier.explicitInterp = true;
#endif
}
| PERVERTEXNV {
#ifdef NV_EXTENSIONS
parseContext.globalCheck($1.loc, "pervertexNV");
parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
$$.init($1.loc);
$$.qualifier.pervertexNV = true;
#endif
}
;

File diff suppressed because it is too large Load Diff

View File

@ -164,280 +164,281 @@ extern int yydebug;
SMOOTH = 374,
LAYOUT = 375,
EXPLICITINTERPAMD = 376,
MAT2X2 = 377,
MAT2X3 = 378,
MAT2X4 = 379,
MAT3X2 = 380,
MAT3X3 = 381,
MAT3X4 = 382,
MAT4X2 = 383,
MAT4X3 = 384,
MAT4X4 = 385,
DMAT2X2 = 386,
DMAT2X3 = 387,
DMAT2X4 = 388,
DMAT3X2 = 389,
DMAT3X3 = 390,
DMAT3X4 = 391,
DMAT4X2 = 392,
DMAT4X3 = 393,
DMAT4X4 = 394,
F16MAT2X2 = 395,
F16MAT2X3 = 396,
F16MAT2X4 = 397,
F16MAT3X2 = 398,
F16MAT3X3 = 399,
F16MAT3X4 = 400,
F16MAT4X2 = 401,
F16MAT4X3 = 402,
F16MAT4X4 = 403,
F32MAT2X2 = 404,
F32MAT2X3 = 405,
F32MAT2X4 = 406,
F32MAT3X2 = 407,
F32MAT3X3 = 408,
F32MAT3X4 = 409,
F32MAT4X2 = 410,
F32MAT4X3 = 411,
F32MAT4X4 = 412,
F64MAT2X2 = 413,
F64MAT2X3 = 414,
F64MAT2X4 = 415,
F64MAT3X2 = 416,
F64MAT3X3 = 417,
F64MAT3X4 = 418,
F64MAT4X2 = 419,
F64MAT4X3 = 420,
F64MAT4X4 = 421,
ATOMIC_UINT = 422,
SAMPLER1D = 423,
SAMPLER2D = 424,
SAMPLER3D = 425,
SAMPLERCUBE = 426,
SAMPLER1DSHADOW = 427,
SAMPLER2DSHADOW = 428,
SAMPLERCUBESHADOW = 429,
SAMPLER1DARRAY = 430,
SAMPLER2DARRAY = 431,
SAMPLER1DARRAYSHADOW = 432,
SAMPLER2DARRAYSHADOW = 433,
ISAMPLER1D = 434,
ISAMPLER2D = 435,
ISAMPLER3D = 436,
ISAMPLERCUBE = 437,
ISAMPLER1DARRAY = 438,
ISAMPLER2DARRAY = 439,
USAMPLER1D = 440,
USAMPLER2D = 441,
USAMPLER3D = 442,
USAMPLERCUBE = 443,
USAMPLER1DARRAY = 444,
USAMPLER2DARRAY = 445,
SAMPLER2DRECT = 446,
SAMPLER2DRECTSHADOW = 447,
ISAMPLER2DRECT = 448,
USAMPLER2DRECT = 449,
SAMPLERBUFFER = 450,
ISAMPLERBUFFER = 451,
USAMPLERBUFFER = 452,
SAMPLERCUBEARRAY = 453,
SAMPLERCUBEARRAYSHADOW = 454,
ISAMPLERCUBEARRAY = 455,
USAMPLERCUBEARRAY = 456,
SAMPLER2DMS = 457,
ISAMPLER2DMS = 458,
USAMPLER2DMS = 459,
SAMPLER2DMSARRAY = 460,
ISAMPLER2DMSARRAY = 461,
USAMPLER2DMSARRAY = 462,
SAMPLEREXTERNALOES = 463,
F16SAMPLER1D = 464,
F16SAMPLER2D = 465,
F16SAMPLER3D = 466,
F16SAMPLER2DRECT = 467,
F16SAMPLERCUBE = 468,
F16SAMPLER1DARRAY = 469,
F16SAMPLER2DARRAY = 470,
F16SAMPLERCUBEARRAY = 471,
F16SAMPLERBUFFER = 472,
F16SAMPLER2DMS = 473,
F16SAMPLER2DMSARRAY = 474,
F16SAMPLER1DSHADOW = 475,
F16SAMPLER2DSHADOW = 476,
F16SAMPLER1DARRAYSHADOW = 477,
F16SAMPLER2DARRAYSHADOW = 478,
F16SAMPLER2DRECTSHADOW = 479,
F16SAMPLERCUBESHADOW = 480,
F16SAMPLERCUBEARRAYSHADOW = 481,
SAMPLER = 482,
SAMPLERSHADOW = 483,
TEXTURE1D = 484,
TEXTURE2D = 485,
TEXTURE3D = 486,
TEXTURECUBE = 487,
TEXTURE1DARRAY = 488,
TEXTURE2DARRAY = 489,
ITEXTURE1D = 490,
ITEXTURE2D = 491,
ITEXTURE3D = 492,
ITEXTURECUBE = 493,
ITEXTURE1DARRAY = 494,
ITEXTURE2DARRAY = 495,
UTEXTURE1D = 496,
UTEXTURE2D = 497,
UTEXTURE3D = 498,
UTEXTURECUBE = 499,
UTEXTURE1DARRAY = 500,
UTEXTURE2DARRAY = 501,
TEXTURE2DRECT = 502,
ITEXTURE2DRECT = 503,
UTEXTURE2DRECT = 504,
TEXTUREBUFFER = 505,
ITEXTUREBUFFER = 506,
UTEXTUREBUFFER = 507,
TEXTURECUBEARRAY = 508,
ITEXTURECUBEARRAY = 509,
UTEXTURECUBEARRAY = 510,
TEXTURE2DMS = 511,
ITEXTURE2DMS = 512,
UTEXTURE2DMS = 513,
TEXTURE2DMSARRAY = 514,
ITEXTURE2DMSARRAY = 515,
UTEXTURE2DMSARRAY = 516,
F16TEXTURE1D = 517,
F16TEXTURE2D = 518,
F16TEXTURE3D = 519,
F16TEXTURE2DRECT = 520,
F16TEXTURECUBE = 521,
F16TEXTURE1DARRAY = 522,
F16TEXTURE2DARRAY = 523,
F16TEXTURECUBEARRAY = 524,
F16TEXTUREBUFFER = 525,
F16TEXTURE2DMS = 526,
F16TEXTURE2DMSARRAY = 527,
SUBPASSINPUT = 528,
SUBPASSINPUTMS = 529,
ISUBPASSINPUT = 530,
ISUBPASSINPUTMS = 531,
USUBPASSINPUT = 532,
USUBPASSINPUTMS = 533,
F16SUBPASSINPUT = 534,
F16SUBPASSINPUTMS = 535,
IMAGE1D = 536,
IIMAGE1D = 537,
UIMAGE1D = 538,
IMAGE2D = 539,
IIMAGE2D = 540,
UIMAGE2D = 541,
IMAGE3D = 542,
IIMAGE3D = 543,
UIMAGE3D = 544,
IMAGE2DRECT = 545,
IIMAGE2DRECT = 546,
UIMAGE2DRECT = 547,
IMAGECUBE = 548,
IIMAGECUBE = 549,
UIMAGECUBE = 550,
IMAGEBUFFER = 551,
IIMAGEBUFFER = 552,
UIMAGEBUFFER = 553,
IMAGE1DARRAY = 554,
IIMAGE1DARRAY = 555,
UIMAGE1DARRAY = 556,
IMAGE2DARRAY = 557,
IIMAGE2DARRAY = 558,
UIMAGE2DARRAY = 559,
IMAGECUBEARRAY = 560,
IIMAGECUBEARRAY = 561,
UIMAGECUBEARRAY = 562,
IMAGE2DMS = 563,
IIMAGE2DMS = 564,
UIMAGE2DMS = 565,
IMAGE2DMSARRAY = 566,
IIMAGE2DMSARRAY = 567,
UIMAGE2DMSARRAY = 568,
F16IMAGE1D = 569,
F16IMAGE2D = 570,
F16IMAGE3D = 571,
F16IMAGE2DRECT = 572,
F16IMAGECUBE = 573,
F16IMAGE1DARRAY = 574,
F16IMAGE2DARRAY = 575,
F16IMAGECUBEARRAY = 576,
F16IMAGEBUFFER = 577,
F16IMAGE2DMS = 578,
F16IMAGE2DMSARRAY = 579,
STRUCT = 580,
VOID = 581,
WHILE = 582,
IDENTIFIER = 583,
TYPE_NAME = 584,
FLOATCONSTANT = 585,
DOUBLECONSTANT = 586,
INT16CONSTANT = 587,
UINT16CONSTANT = 588,
INT32CONSTANT = 589,
UINT32CONSTANT = 590,
INTCONSTANT = 591,
UINTCONSTANT = 592,
INT64CONSTANT = 593,
UINT64CONSTANT = 594,
BOOLCONSTANT = 595,
FLOAT16CONSTANT = 596,
LEFT_OP = 597,
RIGHT_OP = 598,
INC_OP = 599,
DEC_OP = 600,
LE_OP = 601,
GE_OP = 602,
EQ_OP = 603,
NE_OP = 604,
AND_OP = 605,
OR_OP = 606,
XOR_OP = 607,
MUL_ASSIGN = 608,
DIV_ASSIGN = 609,
ADD_ASSIGN = 610,
MOD_ASSIGN = 611,
LEFT_ASSIGN = 612,
RIGHT_ASSIGN = 613,
AND_ASSIGN = 614,
XOR_ASSIGN = 615,
OR_ASSIGN = 616,
SUB_ASSIGN = 617,
LEFT_PAREN = 618,
RIGHT_PAREN = 619,
LEFT_BRACKET = 620,
RIGHT_BRACKET = 621,
LEFT_BRACE = 622,
RIGHT_BRACE = 623,
DOT = 624,
COMMA = 625,
COLON = 626,
EQUAL = 627,
SEMICOLON = 628,
BANG = 629,
DASH = 630,
TILDE = 631,
PLUS = 632,
STAR = 633,
SLASH = 634,
PERCENT = 635,
LEFT_ANGLE = 636,
RIGHT_ANGLE = 637,
VERTICAL_BAR = 638,
CARET = 639,
AMPERSAND = 640,
QUESTION = 641,
INVARIANT = 642,
PRECISE = 643,
HIGH_PRECISION = 644,
MEDIUM_PRECISION = 645,
LOW_PRECISION = 646,
PRECISION = 647,
PACKED = 648,
RESOURCE = 649,
SUPERP = 650
PERVERTEXNV = 377,
MAT2X2 = 378,
MAT2X3 = 379,
MAT2X4 = 380,
MAT3X2 = 381,
MAT3X3 = 382,
MAT3X4 = 383,
MAT4X2 = 384,
MAT4X3 = 385,
MAT4X4 = 386,
DMAT2X2 = 387,
DMAT2X3 = 388,
DMAT2X4 = 389,
DMAT3X2 = 390,
DMAT3X3 = 391,
DMAT3X4 = 392,
DMAT4X2 = 393,
DMAT4X3 = 394,
DMAT4X4 = 395,
F16MAT2X2 = 396,
F16MAT2X3 = 397,
F16MAT2X4 = 398,
F16MAT3X2 = 399,
F16MAT3X3 = 400,
F16MAT3X4 = 401,
F16MAT4X2 = 402,
F16MAT4X3 = 403,
F16MAT4X4 = 404,
F32MAT2X2 = 405,
F32MAT2X3 = 406,
F32MAT2X4 = 407,
F32MAT3X2 = 408,
F32MAT3X3 = 409,
F32MAT3X4 = 410,
F32MAT4X2 = 411,
F32MAT4X3 = 412,
F32MAT4X4 = 413,
F64MAT2X2 = 414,
F64MAT2X3 = 415,
F64MAT2X4 = 416,
F64MAT3X2 = 417,
F64MAT3X3 = 418,
F64MAT3X4 = 419,
F64MAT4X2 = 420,
F64MAT4X3 = 421,
F64MAT4X4 = 422,
ATOMIC_UINT = 423,
SAMPLER1D = 424,
SAMPLER2D = 425,
SAMPLER3D = 426,
SAMPLERCUBE = 427,
SAMPLER1DSHADOW = 428,
SAMPLER2DSHADOW = 429,
SAMPLERCUBESHADOW = 430,
SAMPLER1DARRAY = 431,
SAMPLER2DARRAY = 432,
SAMPLER1DARRAYSHADOW = 433,
SAMPLER2DARRAYSHADOW = 434,
ISAMPLER1D = 435,
ISAMPLER2D = 436,
ISAMPLER3D = 437,
ISAMPLERCUBE = 438,
ISAMPLER1DARRAY = 439,
ISAMPLER2DARRAY = 440,
USAMPLER1D = 441,
USAMPLER2D = 442,
USAMPLER3D = 443,
USAMPLERCUBE = 444,
USAMPLER1DARRAY = 445,
USAMPLER2DARRAY = 446,
SAMPLER2DRECT = 447,
SAMPLER2DRECTSHADOW = 448,
ISAMPLER2DRECT = 449,
USAMPLER2DRECT = 450,
SAMPLERBUFFER = 451,
ISAMPLERBUFFER = 452,
USAMPLERBUFFER = 453,
SAMPLERCUBEARRAY = 454,
SAMPLERCUBEARRAYSHADOW = 455,
ISAMPLERCUBEARRAY = 456,
USAMPLERCUBEARRAY = 457,
SAMPLER2DMS = 458,
ISAMPLER2DMS = 459,
USAMPLER2DMS = 460,
SAMPLER2DMSARRAY = 461,
ISAMPLER2DMSARRAY = 462,
USAMPLER2DMSARRAY = 463,
SAMPLEREXTERNALOES = 464,
F16SAMPLER1D = 465,
F16SAMPLER2D = 466,
F16SAMPLER3D = 467,
F16SAMPLER2DRECT = 468,
F16SAMPLERCUBE = 469,
F16SAMPLER1DARRAY = 470,
F16SAMPLER2DARRAY = 471,
F16SAMPLERCUBEARRAY = 472,
F16SAMPLERBUFFER = 473,
F16SAMPLER2DMS = 474,
F16SAMPLER2DMSARRAY = 475,
F16SAMPLER1DSHADOW = 476,
F16SAMPLER2DSHADOW = 477,
F16SAMPLER1DARRAYSHADOW = 478,
F16SAMPLER2DARRAYSHADOW = 479,
F16SAMPLER2DRECTSHADOW = 480,
F16SAMPLERCUBESHADOW = 481,
F16SAMPLERCUBEARRAYSHADOW = 482,
SAMPLER = 483,
SAMPLERSHADOW = 484,
TEXTURE1D = 485,
TEXTURE2D = 486,
TEXTURE3D = 487,
TEXTURECUBE = 488,
TEXTURE1DARRAY = 489,
TEXTURE2DARRAY = 490,
ITEXTURE1D = 491,
ITEXTURE2D = 492,
ITEXTURE3D = 493,
ITEXTURECUBE = 494,
ITEXTURE1DARRAY = 495,
ITEXTURE2DARRAY = 496,
UTEXTURE1D = 497,
UTEXTURE2D = 498,
UTEXTURE3D = 499,
UTEXTURECUBE = 500,
UTEXTURE1DARRAY = 501,
UTEXTURE2DARRAY = 502,
TEXTURE2DRECT = 503,
ITEXTURE2DRECT = 504,
UTEXTURE2DRECT = 505,
TEXTUREBUFFER = 506,
ITEXTUREBUFFER = 507,
UTEXTUREBUFFER = 508,
TEXTURECUBEARRAY = 509,
ITEXTURECUBEARRAY = 510,
UTEXTURECUBEARRAY = 511,
TEXTURE2DMS = 512,
ITEXTURE2DMS = 513,
UTEXTURE2DMS = 514,
TEXTURE2DMSARRAY = 515,
ITEXTURE2DMSARRAY = 516,
UTEXTURE2DMSARRAY = 517,
F16TEXTURE1D = 518,
F16TEXTURE2D = 519,
F16TEXTURE3D = 520,
F16TEXTURE2DRECT = 521,
F16TEXTURECUBE = 522,
F16TEXTURE1DARRAY = 523,
F16TEXTURE2DARRAY = 524,
F16TEXTURECUBEARRAY = 525,
F16TEXTUREBUFFER = 526,
F16TEXTURE2DMS = 527,
F16TEXTURE2DMSARRAY = 528,
SUBPASSINPUT = 529,
SUBPASSINPUTMS = 530,
ISUBPASSINPUT = 531,
ISUBPASSINPUTMS = 532,
USUBPASSINPUT = 533,
USUBPASSINPUTMS = 534,
F16SUBPASSINPUT = 535,
F16SUBPASSINPUTMS = 536,
IMAGE1D = 537,
IIMAGE1D = 538,
UIMAGE1D = 539,
IMAGE2D = 540,
IIMAGE2D = 541,
UIMAGE2D = 542,
IMAGE3D = 543,
IIMAGE3D = 544,
UIMAGE3D = 545,
IMAGE2DRECT = 546,
IIMAGE2DRECT = 547,
UIMAGE2DRECT = 548,
IMAGECUBE = 549,
IIMAGECUBE = 550,
UIMAGECUBE = 551,
IMAGEBUFFER = 552,
IIMAGEBUFFER = 553,
UIMAGEBUFFER = 554,
IMAGE1DARRAY = 555,
IIMAGE1DARRAY = 556,
UIMAGE1DARRAY = 557,
IMAGE2DARRAY = 558,
IIMAGE2DARRAY = 559,
UIMAGE2DARRAY = 560,
IMAGECUBEARRAY = 561,
IIMAGECUBEARRAY = 562,
UIMAGECUBEARRAY = 563,
IMAGE2DMS = 564,
IIMAGE2DMS = 565,
UIMAGE2DMS = 566,
IMAGE2DMSARRAY = 567,
IIMAGE2DMSARRAY = 568,
UIMAGE2DMSARRAY = 569,
F16IMAGE1D = 570,
F16IMAGE2D = 571,
F16IMAGE3D = 572,
F16IMAGE2DRECT = 573,
F16IMAGECUBE = 574,
F16IMAGE1DARRAY = 575,
F16IMAGE2DARRAY = 576,
F16IMAGECUBEARRAY = 577,
F16IMAGEBUFFER = 578,
F16IMAGE2DMS = 579,
F16IMAGE2DMSARRAY = 580,
STRUCT = 581,
VOID = 582,
WHILE = 583,
IDENTIFIER = 584,
TYPE_NAME = 585,
FLOATCONSTANT = 586,
DOUBLECONSTANT = 587,
INT16CONSTANT = 588,
UINT16CONSTANT = 589,
INT32CONSTANT = 590,
UINT32CONSTANT = 591,
INTCONSTANT = 592,
UINTCONSTANT = 593,
INT64CONSTANT = 594,
UINT64CONSTANT = 595,
BOOLCONSTANT = 596,
FLOAT16CONSTANT = 597,
LEFT_OP = 598,
RIGHT_OP = 599,
INC_OP = 600,
DEC_OP = 601,
LE_OP = 602,
GE_OP = 603,
EQ_OP = 604,
NE_OP = 605,
AND_OP = 606,
OR_OP = 607,
XOR_OP = 608,
MUL_ASSIGN = 609,
DIV_ASSIGN = 610,
ADD_ASSIGN = 611,
MOD_ASSIGN = 612,
LEFT_ASSIGN = 613,
RIGHT_ASSIGN = 614,
AND_ASSIGN = 615,
XOR_ASSIGN = 616,
OR_ASSIGN = 617,
SUB_ASSIGN = 618,
LEFT_PAREN = 619,
RIGHT_PAREN = 620,
LEFT_BRACKET = 621,
RIGHT_BRACKET = 622,
LEFT_BRACE = 623,
RIGHT_BRACE = 624,
DOT = 625,
COMMA = 626,
COLON = 627,
EQUAL = 628,
SEMICOLON = 629,
BANG = 630,
DASH = 631,
TILDE = 632,
PLUS = 633,
STAR = 634,
SLASH = 635,
PERCENT = 636,
LEFT_ANGLE = 637,
RIGHT_ANGLE = 638,
VERTICAL_BAR = 639,
CARET = 640,
AMPERSAND = 641,
QUESTION = 642,
INVARIANT = 643,
PRECISE = 644,
HIGH_PRECISION = 645,
MEDIUM_PRECISION = 646,
LOW_PRECISION = 647,
PRECISION = 648,
PACKED = 649,
RESOURCE = 650,
SUPERP = 651
};
#endif
@ -481,7 +482,7 @@ union YYSTYPE
};
} interm;
#line 485 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
#line 486 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;

View File

@ -501,6 +501,8 @@ INSTANTIATE_TEST_CASE_P(
"spv.multiviewPerViewAttributes.vert",
"spv.multiviewPerViewAttributes.tesc",
"spv.atomicInt64.comp",
"spv.fragmentShaderBarycentric.frag",
"spv.fragmentShaderBarycentric2.frag",
})),
FileNameAsCustomTestSuffix
);