Commit 033ae528 by John Kessenich

GLSL: Implement nonuniformEXT keyword, declarations, and constructor.

parent a3bf9121
...@@ -393,6 +393,7 @@ enum Decoration { ...@@ -393,6 +393,7 @@ enum Decoration {
DecorationPassthroughNV = 5250, DecorationPassthroughNV = 5250,
DecorationViewportRelativeNV = 5252, DecorationViewportRelativeNV = 5252,
DecorationSecondaryViewportRelativeNV = 5256, DecorationSecondaryViewportRelativeNV = 5256,
DecorationNonUniformEXT = 5300,
DecorationHlslCounterBufferGOOGLE = 5634, DecorationHlslCounterBufferGOOGLE = 5634,
DecorationHlslSemanticGOOGLE = 5635, DecorationHlslSemanticGOOGLE = 5635,
DecorationMax = 0x7fffffff, DecorationMax = 0x7fffffff,
...@@ -688,6 +689,18 @@ enum Capability { ...@@ -688,6 +689,18 @@ enum Capability {
CapabilityShaderStereoViewNV = 5259, CapabilityShaderStereoViewNV = 5259,
CapabilityPerViewAttributesNV = 5260, CapabilityPerViewAttributesNV = 5260,
CapabilityFragmentFullyCoveredEXT = 5265, CapabilityFragmentFullyCoveredEXT = 5265,
CapabilityShaderNonUniformEXT = 5301,
CapabilityRuntimeDescriptorArrayEXT = 5302,
CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569, CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570, CapabilitySubgroupImageBlockIOINTEL = 5570,
......
nonuniform.frag
ERROR: 0:6: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:7: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:8: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:17: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:23: 'constructor' : too many arguments
ERROR: 0:23: 'assign' : cannot convert from ' const float' to ' nonuniform temp int'
ERROR: 0:24: 'constructor' : not enough data provided for construction
ERROR: 0:24: 'assign' : cannot convert from ' const float' to ' nonuniform temp int'
ERROR: 8 compilation errors. No code generated.
Shader version: 450
ERROR: node is still EOpNull!
0:10 Function Definition: foo(i1; ( global void)
0:10 Function Parameters:
0:10 'nupi' ( nonuniform in int)
0:14 Function Definition: main( ( global void)
0:14 Function Parameters:
0:? Sequence
0:19 Function Call: foo(i1; ( global void)
0:19 'nu_li' ( nonuniform temp int)
0:22 move second child to first child ( temp int)
0:22 'nu_li' ( nonuniform temp int)
0:22 add ( temp int)
0:22 'a' ( nonuniform temp int)
0:22 component-wise multiply ( nonuniform temp int)
0:22 'a' ( temp int)
0:22 Constant:
0:22 2 (const int)
0:23 'nu_li' ( nonuniform temp int)
0:24 'nu_li' ( nonuniform temp int)
0:? Linker Objects
0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float)
0:? 'nu_gf' ( nonuniform temp float)
0:? 'nu_outv4' ( nonuniform out 4-component vector of float)
0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float)
0:? 'nu_constf' ( nonuniform const float)
0:? 1.000000
Linked fragment stage:
Shader version: 450
ERROR: node is still EOpNull!
0:10 Function Definition: foo(i1; ( global void)
0:10 Function Parameters:
0:10 'nupi' ( nonuniform in int)
0:14 Function Definition: main( ( global void)
0:14 Function Parameters:
0:? Sequence
0:19 Function Call: foo(i1; ( global void)
0:19 'nu_li' ( nonuniform temp int)
0:22 move second child to first child ( temp int)
0:22 'nu_li' ( nonuniform temp int)
0:22 add ( temp int)
0:22 'a' ( nonuniform temp int)
0:22 component-wise multiply ( nonuniform temp int)
0:22 'a' ( temp int)
0:22 Constant:
0:22 2 (const int)
0:23 'nu_li' ( nonuniform temp int)
0:24 'nu_li' ( nonuniform temp int)
0:? Linker Objects
0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float)
0:? 'nu_gf' ( nonuniform temp float)
0:? 'nu_outv4' ( nonuniform out 4-component vector of float)
0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float)
0:? 'nu_constf' ( nonuniform const float)
0:? 1.000000
#version 450
nonuniformEXT in vec4 nu_inv4;
nonuniformEXT float nu_gf;
nonuniformEXT out vec4 nu_outv4; // ERROR, out
nonuniformEXT uniform vec4 nu_uv4; // ERROR, uniform
nonuniformEXT const float nu_constf = 1.0; // ERROR, const
void foo(nonuniformEXT int nupi)
{
}
void main()
{
nonuniformEXT int nu_li;
nonuniformEXT const int nu_ci = 2; // ERROR, const
foo(nu_li);
int a;
nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
nu_li = nonuniformEXT(a, a); // ERROR, too many arguments
nu_li = nonuniformEXT(); // ERROR, no arguments
}
\ No newline at end of file
...@@ -437,6 +437,7 @@ public: ...@@ -437,6 +437,7 @@ public:
clearInterstage(); clearInterstage();
clearMemory(); clearMemory();
specConstant = false; specConstant = false;
nonUniform = false;
clearLayout(); clearLayout();
} }
...@@ -470,7 +471,7 @@ public: ...@@ -470,7 +471,7 @@ public:
// Drop just the storage qualification, which perhaps should // Drop just the storage qualification, which perhaps should
// never be done, as it is fundamentally inconsistent, but need to // never be done, as it is fundamentally inconsistent, but need to
// explore what downstream consumers need. // explore what downstream consumers need.
// E.g., in a deference, it is an inconsistency between: // E.g., in a dereference, it is an inconsistency between:
// A) partially dereferenced resource is still in the storage class it started in // A) partially dereferenced resource is still in the storage class it started in
// B) partially dereferenced resource is a new temporary object // B) partially dereferenced resource is a new temporary object
// If A, then nothing should change, if B, then everything should change, but this is half way. // If A, then nothing should change, if B, then everything should change, but this is half way.
...@@ -478,6 +479,7 @@ public: ...@@ -478,6 +479,7 @@ public:
{ {
storage = EvqTemporary; storage = EvqTemporary;
specConstant = false; specConstant = false;
nonUniform = false;
} }
const char* semanticName; const char* semanticName;
...@@ -502,6 +504,7 @@ public: ...@@ -502,6 +504,7 @@ public:
bool readonly : 1; bool readonly : 1;
bool writeonly : 1; bool writeonly : 1;
bool specConstant : 1; // having a constant_id is not sufficient: expressions have no id, but are still specConstant bool specConstant : 1; // having a constant_id is not sufficient: expressions have no id, but are still specConstant
bool nonUniform : 1;
bool isMemory() const bool isMemory() const
{ {
...@@ -833,6 +836,10 @@ public: ...@@ -833,6 +836,10 @@ public:
// true front-end constant. // true front-end constant.
return specConstant; return specConstant;
} }
bool isNonUniform() const
{
return nonUniform;
}
bool isFrontEndConstant() const bool isFrontEndConstant() const
{ {
// True if the front-end knows the final constant value. // True if the front-end knows the final constant value.
...@@ -1692,6 +1699,8 @@ public: ...@@ -1692,6 +1699,8 @@ public:
appendStr(" writeonly"); appendStr(" writeonly");
if (qualifier.specConstant) if (qualifier.specConstant)
appendStr(" specialization-constant"); appendStr(" specialization-constant");
if (qualifier.nonUniform)
appendStr(" nonuniform");
appendStr(" "); appendStr(" ");
appendStr(getStorageQualifierString()); appendStr(getStorageQualifierString());
if (isArray()) { if (isArray()) {
......
...@@ -703,6 +703,7 @@ enum TOperator { ...@@ -703,6 +703,7 @@ enum TOperator {
EOpConstructF16Mat4x4, EOpConstructF16Mat4x4,
EOpConstructStruct, EOpConstructStruct,
EOpConstructTextureSampler, EOpConstructTextureSampler,
EOpConstructNonuniform, // expected to be transformed away, not present in final AST
EOpConstructGuardEnd, EOpConstructGuardEnd,
// //
......
...@@ -1816,6 +1816,9 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const ...@@ -1816,6 +1816,9 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
{ {
TOperator op = EOpNull; TOperator op = EOpNull;
if (type.getQualifier().nonUniform)
return EOpConstructNonuniform;
switch (type.getBasicType()) { switch (type.getBasicType()) {
case EbtStruct: case EbtStruct:
op = EOpConstructStruct; op = EOpConstructStruct;
......
...@@ -2579,12 +2579,15 @@ void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& t ...@@ -2579,12 +2579,15 @@ void TParseContext::transparentOpaqueCheck(const TSourceLoc& loc, const TType& t
// //
void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier) void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& qualifier)
{ {
bool nonuniformOkay = false;
// move from parameter/unknown qualifiers to pipeline in/out qualifiers // move from parameter/unknown qualifiers to pipeline in/out qualifiers
switch (qualifier.storage) { switch (qualifier.storage) {
case EvqIn: case EvqIn:
profileRequires(loc, ENoProfile, 130, nullptr, "in for stage inputs"); profileRequires(loc, ENoProfile, 130, nullptr, "in for stage inputs");
profileRequires(loc, EEsProfile, 300, nullptr, "in for stage inputs"); profileRequires(loc, EEsProfile, 300, nullptr, "in for stage inputs");
qualifier.storage = EvqVaryingIn; qualifier.storage = EvqVaryingIn;
nonuniformOkay = true;
break; break;
case EvqOut: case EvqOut:
profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs"); profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs");
...@@ -2595,10 +2598,17 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q ...@@ -2595,10 +2598,17 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q
qualifier.storage = EvqVaryingIn; qualifier.storage = EvqVaryingIn;
error(loc, "cannot use 'inout' at global scope", "", ""); error(loc, "cannot use 'inout' at global scope", "", "");
break; break;
case EvqGlobal:
case EvqTemporary:
nonuniformOkay = true;
break;
default: default:
break; break;
} }
if (!nonuniformOkay && qualifier.nonUniform)
error(loc, "for non-parameter, can only apply to 'in' or no storage qualifier", "nonuniformEXT", "");
invariantCheck(loc, qualifier); invariantCheck(loc, qualifier);
} }
...@@ -2847,6 +2857,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons ...@@ -2847,6 +2857,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
MERGE_SINGLETON(readonly); MERGE_SINGLETON(readonly);
MERGE_SINGLETON(writeonly); MERGE_SINGLETON(writeonly);
MERGE_SINGLETON(specConstant); MERGE_SINGLETON(specConstant);
MERGE_SINGLETON(nonUniform);
if (repeated) if (repeated)
error(loc, "replicated qualifiers", "", ""); error(loc, "replicated qualifiers", "", "");
...@@ -3669,7 +3680,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT ...@@ -3669,7 +3680,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
trackLinkage(*block); trackLinkage(*block);
} }
void TParseContext::paramCheckFix(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) void TParseContext::paramCheckFixStorage(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type)
{ {
switch (qualifier) { switch (qualifier) {
case EvqConst: case EvqConst:
...@@ -3715,8 +3726,10 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali ...@@ -3715,8 +3726,10 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
else else
warn(loc, "qualifier has no effect on non-output parameters", "precise", ""); warn(loc, "qualifier has no effect on non-output parameters", "precise", "");
} }
if (qualifier.isNonUniform())
type.getQualifier().nonUniform = qualifier.nonUniform;
paramCheckFix(loc, qualifier.storage, type); paramCheckFixStorage(loc, qualifier.storage, type);
} }
void TParseContext::nestedBlockCheck(const TSourceLoc& loc) void TParseContext::nestedBlockCheck(const TSourceLoc& loc)
...@@ -5867,6 +5880,11 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T ...@@ -5867,6 +5880,11 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
basicOp = EOpConstructBool; basicOp = EOpConstructBool;
break; break;
case EOpConstructNonuniform:
node->getWritableType().getQualifier().nonUniform = true;
return node;
break;
default: default:
error(loc, "unsupported construction", "", ""); error(loc, "unsupported construction", "", "");
......
...@@ -363,7 +363,7 @@ public: ...@@ -363,7 +363,7 @@ public:
bool containsFieldWithBasicType(const TType& type ,TBasicType basicType); bool containsFieldWithBasicType(const TType& type ,TBasicType basicType);
TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&); TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&);
void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes);
void paramCheckFix(const TSourceLoc&, const TStorageQualifier&, TType& type); void paramCheckFixStorage(const TSourceLoc&, const TStorageQualifier&, TType& type);
void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type); void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type);
void nestedBlockCheck(const TSourceLoc&); void nestedBlockCheck(const TSourceLoc&);
void nestedStructCheck(const TSourceLoc&); void nestedStructCheck(const TSourceLoc&);
......
...@@ -341,6 +341,7 @@ void TScanContext::fillInKeywordMap() ...@@ -341,6 +341,7 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["const"] = CONST; (*KeywordMap)["const"] = CONST;
(*KeywordMap)["uniform"] = UNIFORM; (*KeywordMap)["uniform"] = UNIFORM;
(*KeywordMap)["nonuniformEXT"] = NONUNIFORM;
(*KeywordMap)["in"] = IN; (*KeywordMap)["in"] = IN;
(*KeywordMap)["out"] = OUT; (*KeywordMap)["out"] = OUT;
(*KeywordMap)["inout"] = INOUT; (*KeywordMap)["inout"] = INOUT;
...@@ -857,6 +858,7 @@ int TScanContext::tokenizeIdentifier() ...@@ -857,6 +858,7 @@ int TScanContext::tokenizeIdentifier()
switch (keyword) { switch (keyword) {
case CONST: case CONST:
case UNIFORM: case UNIFORM:
case NONUNIFORM:
case IN: case IN:
case OUT: case OUT:
case INOUT: case INOUT:
......
...@@ -199,6 +199,7 @@ void TParseVersions::initializeExtensionBehavior() ...@@ -199,6 +199,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable; extensionBehavior[E_GL_EXT_shader_image_load_formatted] = EBhDisable;
extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable; extensionBehavior[E_GL_EXT_post_depth_coverage] = EBhDisable;
extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable; extensionBehavior[E_GL_EXT_control_flow_attributes] = EBhDisable;
extensionBehavior[E_GL_EXT_nonuniform_qualifier] = EBhDisable;
// #line and #include // #line and #include
extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable; extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable;
...@@ -351,6 +352,7 @@ void TParseVersions::getPreamble(std::string& preamble) ...@@ -351,6 +352,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_shader_image_load_formatted 1\n"
"#define GL_EXT_post_depth_coverage 1\n" "#define GL_EXT_post_depth_coverage 1\n"
"#define GL_EXT_control_flow_attributes 1\n" "#define GL_EXT_control_flow_attributes 1\n"
"#define GL_EXT_nonuniform_qualifier 1\n"
// GL_KHR_shader_subgroup // GL_KHR_shader_subgroup
"#define GL_KHR_shader_subgroup_basic 1\n" "#define GL_KHR_shader_subgroup_basic 1\n"
......
...@@ -157,6 +157,7 @@ const char* const E_GL_EXT_device_group = "GL_EXT_device_group"; ...@@ -157,6 +157,7 @@ const char* const E_GL_EXT_device_group = "GL_EXT_device_group";
const char* const E_GL_EXT_multiview = "GL_EXT_multiview"; const char* const E_GL_EXT_multiview = "GL_EXT_multiview";
const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage"; const char* const E_GL_EXT_post_depth_coverage = "GL_EXT_post_depth_coverage";
const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes"; const char* const E_GL_EXT_control_flow_attributes = "GL_EXT_control_flow_attributes";
const char* const E_GL_EXT_nonuniform_qualifier = "GL_EXT_nonuniform_qualifier";
// Arrays of extensions for the above viewportEXTs duplications // Arrays of extensions for the above viewportEXTs duplications
......
...@@ -140,7 +140,7 @@ extern int yylex(YYSTYPE*, TParseContext&); ...@@ -140,7 +140,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> U8VEC2 U8VEC3 U8VEC4 %token <lex> U8VEC2 U8VEC3 U8VEC4
%token <lex> VEC2 VEC3 VEC4 %token <lex> VEC2 VEC3 VEC4
%token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT %token <lex> MAT2 MAT3 MAT4 CENTROID IN OUT INOUT
%token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED %token <lex> UNIFORM PATCH SAMPLE BUFFER SHARED NONUNIFORM
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY %token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4 %token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4 %token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
...@@ -268,6 +268,7 @@ extern int yylex(YYSTYPE*, TParseContext&); ...@@ -268,6 +268,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%type <interm> array_specifier %type <interm> array_specifier
%type <interm.type> precise_qualifier invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier %type <interm.type> precise_qualifier invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier
%type <interm.type> layout_qualifier layout_qualifier_id_list layout_qualifier_id %type <interm.type> layout_qualifier layout_qualifier_id_list layout_qualifier_id
%type <interm.type> non_uniform_qualifier
%type <interm.type> type_qualifier fully_specified_type type_specifier %type <interm.type> type_qualifier fully_specified_type type_specifier
%type <interm.type> single_type_qualifier %type <interm.type> single_type_qualifier
...@@ -473,6 +474,11 @@ function_identifier ...@@ -473,6 +474,11 @@ function_identifier
$$.function = new TFunction(&empty, TType(EbtVoid), EOpNull); $$.function = new TFunction(&empty, TType(EbtVoid), EOpNull);
} }
} }
| non_uniform_qualifier {
// Constructor
$$.intermNode = 0;
$$.function = parseContext.handleConstructorCall($1.loc, $1);
}
; ;
unary_expression unary_expression
...@@ -966,7 +972,7 @@ parameter_declaration ...@@ -966,7 +972,7 @@ parameter_declaration
$$ = $1; $$ = $1;
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFix($1.loc, EvqTemporary, *$$.param.type); parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier()); parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
} }
// //
...@@ -986,7 +992,7 @@ parameter_declaration ...@@ -986,7 +992,7 @@ parameter_declaration
$$ = $1; $$ = $1;
parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type); parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
parseContext.paramCheckFix($1.loc, EvqTemporary, *$$.param.type); parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier()); parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
} }
; ;
...@@ -1211,6 +1217,9 @@ single_type_qualifier ...@@ -1211,6 +1217,9 @@ single_type_qualifier
// allow inheritance of storage qualifier from block declaration // allow inheritance of storage qualifier from block declaration
$$ = $1; $$ = $1;
} }
| non_uniform_qualifier {
$$ = $1;
}
; ;
storage_qualifier storage_qualifier
...@@ -1331,6 +1340,13 @@ storage_qualifier ...@@ -1331,6 +1340,13 @@ storage_qualifier
} }
; ;
non_uniform_qualifier
: NONUNIFORM {
$$.init($1.loc);
$$.qualifier.nonUniform = true;
}
;
type_name_list type_name_list
: IDENTIFIER { : IDENTIFIER {
// TODO // TODO
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -124,314 +124,315 @@ extern int yydebug; ...@@ -124,314 +124,315 @@ extern int yydebug;
SAMPLE = 334, SAMPLE = 334,
BUFFER = 335, BUFFER = 335,
SHARED = 336, SHARED = 336,
COHERENT = 337, NONUNIFORM = 337,
VOLATILE = 338, COHERENT = 338,
RESTRICT = 339, VOLATILE = 339,
READONLY = 340, RESTRICT = 340,
WRITEONLY = 341, READONLY = 341,
DVEC2 = 342, WRITEONLY = 342,
DVEC3 = 343, DVEC2 = 343,
DVEC4 = 344, DVEC3 = 344,
DMAT2 = 345, DVEC4 = 345,
DMAT3 = 346, DMAT2 = 346,
DMAT4 = 347, DMAT3 = 347,
F16VEC2 = 348, DMAT4 = 348,
F16VEC3 = 349, F16VEC2 = 349,
F16VEC4 = 350, F16VEC3 = 350,
F16MAT2 = 351, F16VEC4 = 351,
F16MAT3 = 352, F16MAT2 = 352,
F16MAT4 = 353, F16MAT3 = 353,
F32VEC2 = 354, F16MAT4 = 354,
F32VEC3 = 355, F32VEC2 = 355,
F32VEC4 = 356, F32VEC3 = 356,
F32MAT2 = 357, F32VEC4 = 357,
F32MAT3 = 358, F32MAT2 = 358,
F32MAT4 = 359, F32MAT3 = 359,
F64VEC2 = 360, F32MAT4 = 360,
F64VEC3 = 361, F64VEC2 = 361,
F64VEC4 = 362, F64VEC3 = 362,
F64MAT2 = 363, F64VEC4 = 363,
F64MAT3 = 364, F64MAT2 = 364,
F64MAT4 = 365, F64MAT3 = 365,
NOPERSPECTIVE = 366, F64MAT4 = 366,
FLAT = 367, NOPERSPECTIVE = 367,
SMOOTH = 368, FLAT = 368,
LAYOUT = 369, SMOOTH = 369,
__EXPLICITINTERPAMD = 370, LAYOUT = 370,
MAT2X2 = 371, __EXPLICITINTERPAMD = 371,
MAT2X3 = 372, MAT2X2 = 372,
MAT2X4 = 373, MAT2X3 = 373,
MAT3X2 = 374, MAT2X4 = 374,
MAT3X3 = 375, MAT3X2 = 375,
MAT3X4 = 376, MAT3X3 = 376,
MAT4X2 = 377, MAT3X4 = 377,
MAT4X3 = 378, MAT4X2 = 378,
MAT4X4 = 379, MAT4X3 = 379,
DMAT2X2 = 380, MAT4X4 = 380,
DMAT2X3 = 381, DMAT2X2 = 381,
DMAT2X4 = 382, DMAT2X3 = 382,
DMAT3X2 = 383, DMAT2X4 = 383,
DMAT3X3 = 384, DMAT3X2 = 384,
DMAT3X4 = 385, DMAT3X3 = 385,
DMAT4X2 = 386, DMAT3X4 = 386,
DMAT4X3 = 387, DMAT4X2 = 387,
DMAT4X4 = 388, DMAT4X3 = 388,
F16MAT2X2 = 389, DMAT4X4 = 389,
F16MAT2X3 = 390, F16MAT2X2 = 390,
F16MAT2X4 = 391, F16MAT2X3 = 391,
F16MAT3X2 = 392, F16MAT2X4 = 392,
F16MAT3X3 = 393, F16MAT3X2 = 393,
F16MAT3X4 = 394, F16MAT3X3 = 394,
F16MAT4X2 = 395, F16MAT3X4 = 395,
F16MAT4X3 = 396, F16MAT4X2 = 396,
F16MAT4X4 = 397, F16MAT4X3 = 397,
F32MAT2X2 = 398, F16MAT4X4 = 398,
F32MAT2X3 = 399, F32MAT2X2 = 399,
F32MAT2X4 = 400, F32MAT2X3 = 400,
F32MAT3X2 = 401, F32MAT2X4 = 401,
F32MAT3X3 = 402, F32MAT3X2 = 402,
F32MAT3X4 = 403, F32MAT3X3 = 403,
F32MAT4X2 = 404, F32MAT3X4 = 404,
F32MAT4X3 = 405, F32MAT4X2 = 405,
F32MAT4X4 = 406, F32MAT4X3 = 406,
F64MAT2X2 = 407, F32MAT4X4 = 407,
F64MAT2X3 = 408, F64MAT2X2 = 408,
F64MAT2X4 = 409, F64MAT2X3 = 409,
F64MAT3X2 = 410, F64MAT2X4 = 410,
F64MAT3X3 = 411, F64MAT3X2 = 411,
F64MAT3X4 = 412, F64MAT3X3 = 412,
F64MAT4X2 = 413, F64MAT3X4 = 413,
F64MAT4X3 = 414, F64MAT4X2 = 414,
F64MAT4X4 = 415, F64MAT4X3 = 415,
ATOMIC_UINT = 416, F64MAT4X4 = 416,
SAMPLER1D = 417, ATOMIC_UINT = 417,
SAMPLER2D = 418, SAMPLER1D = 418,
SAMPLER3D = 419, SAMPLER2D = 419,
SAMPLERCUBE = 420, SAMPLER3D = 420,
SAMPLER1DSHADOW = 421, SAMPLERCUBE = 421,
SAMPLER2DSHADOW = 422, SAMPLER1DSHADOW = 422,
SAMPLERCUBESHADOW = 423, SAMPLER2DSHADOW = 423,
SAMPLER1DARRAY = 424, SAMPLERCUBESHADOW = 424,
SAMPLER2DARRAY = 425, SAMPLER1DARRAY = 425,
SAMPLER1DARRAYSHADOW = 426, SAMPLER2DARRAY = 426,
SAMPLER2DARRAYSHADOW = 427, SAMPLER1DARRAYSHADOW = 427,
ISAMPLER1D = 428, SAMPLER2DARRAYSHADOW = 428,
ISAMPLER2D = 429, ISAMPLER1D = 429,
ISAMPLER3D = 430, ISAMPLER2D = 430,
ISAMPLERCUBE = 431, ISAMPLER3D = 431,
ISAMPLER1DARRAY = 432, ISAMPLERCUBE = 432,
ISAMPLER2DARRAY = 433, ISAMPLER1DARRAY = 433,
USAMPLER1D = 434, ISAMPLER2DARRAY = 434,
USAMPLER2D = 435, USAMPLER1D = 435,
USAMPLER3D = 436, USAMPLER2D = 436,
USAMPLERCUBE = 437, USAMPLER3D = 437,
USAMPLER1DARRAY = 438, USAMPLERCUBE = 438,
USAMPLER2DARRAY = 439, USAMPLER1DARRAY = 439,
SAMPLER2DRECT = 440, USAMPLER2DARRAY = 440,
SAMPLER2DRECTSHADOW = 441, SAMPLER2DRECT = 441,
ISAMPLER2DRECT = 442, SAMPLER2DRECTSHADOW = 442,
USAMPLER2DRECT = 443, ISAMPLER2DRECT = 443,
SAMPLERBUFFER = 444, USAMPLER2DRECT = 444,
ISAMPLERBUFFER = 445, SAMPLERBUFFER = 445,
USAMPLERBUFFER = 446, ISAMPLERBUFFER = 446,
SAMPLERCUBEARRAY = 447, USAMPLERBUFFER = 447,
SAMPLERCUBEARRAYSHADOW = 448, SAMPLERCUBEARRAY = 448,
ISAMPLERCUBEARRAY = 449, SAMPLERCUBEARRAYSHADOW = 449,
USAMPLERCUBEARRAY = 450, ISAMPLERCUBEARRAY = 450,
SAMPLER2DMS = 451, USAMPLERCUBEARRAY = 451,
ISAMPLER2DMS = 452, SAMPLER2DMS = 452,
USAMPLER2DMS = 453, ISAMPLER2DMS = 453,
SAMPLER2DMSARRAY = 454, USAMPLER2DMS = 454,
ISAMPLER2DMSARRAY = 455, SAMPLER2DMSARRAY = 455,
USAMPLER2DMSARRAY = 456, ISAMPLER2DMSARRAY = 456,
SAMPLEREXTERNALOES = 457, USAMPLER2DMSARRAY = 457,
F16SAMPLER1D = 458, SAMPLEREXTERNALOES = 458,
F16SAMPLER2D = 459, F16SAMPLER1D = 459,
F16SAMPLER3D = 460, F16SAMPLER2D = 460,
F16SAMPLER2DRECT = 461, F16SAMPLER3D = 461,
F16SAMPLERCUBE = 462, F16SAMPLER2DRECT = 462,
F16SAMPLER1DARRAY = 463, F16SAMPLERCUBE = 463,
F16SAMPLER2DARRAY = 464, F16SAMPLER1DARRAY = 464,
F16SAMPLERCUBEARRAY = 465, F16SAMPLER2DARRAY = 465,
F16SAMPLERBUFFER = 466, F16SAMPLERCUBEARRAY = 466,
F16SAMPLER2DMS = 467, F16SAMPLERBUFFER = 467,
F16SAMPLER2DMSARRAY = 468, F16SAMPLER2DMS = 468,
F16SAMPLER1DSHADOW = 469, F16SAMPLER2DMSARRAY = 469,
F16SAMPLER2DSHADOW = 470, F16SAMPLER1DSHADOW = 470,
F16SAMPLER1DARRAYSHADOW = 471, F16SAMPLER2DSHADOW = 471,
F16SAMPLER2DARRAYSHADOW = 472, F16SAMPLER1DARRAYSHADOW = 472,
F16SAMPLER2DRECTSHADOW = 473, F16SAMPLER2DARRAYSHADOW = 473,
F16SAMPLERCUBESHADOW = 474, F16SAMPLER2DRECTSHADOW = 474,
F16SAMPLERCUBEARRAYSHADOW = 475, F16SAMPLERCUBESHADOW = 475,
SAMPLER = 476, F16SAMPLERCUBEARRAYSHADOW = 476,
SAMPLERSHADOW = 477, SAMPLER = 477,
TEXTURE1D = 478, SAMPLERSHADOW = 478,
TEXTURE2D = 479, TEXTURE1D = 479,
TEXTURE3D = 480, TEXTURE2D = 480,
TEXTURECUBE = 481, TEXTURE3D = 481,
TEXTURE1DARRAY = 482, TEXTURECUBE = 482,
TEXTURE2DARRAY = 483, TEXTURE1DARRAY = 483,
ITEXTURE1D = 484, TEXTURE2DARRAY = 484,
ITEXTURE2D = 485, ITEXTURE1D = 485,
ITEXTURE3D = 486, ITEXTURE2D = 486,
ITEXTURECUBE = 487, ITEXTURE3D = 487,
ITEXTURE1DARRAY = 488, ITEXTURECUBE = 488,
ITEXTURE2DARRAY = 489, ITEXTURE1DARRAY = 489,
UTEXTURE1D = 490, ITEXTURE2DARRAY = 490,
UTEXTURE2D = 491, UTEXTURE1D = 491,
UTEXTURE3D = 492, UTEXTURE2D = 492,
UTEXTURECUBE = 493, UTEXTURE3D = 493,
UTEXTURE1DARRAY = 494, UTEXTURECUBE = 494,
UTEXTURE2DARRAY = 495, UTEXTURE1DARRAY = 495,
TEXTURE2DRECT = 496, UTEXTURE2DARRAY = 496,
ITEXTURE2DRECT = 497, TEXTURE2DRECT = 497,
UTEXTURE2DRECT = 498, ITEXTURE2DRECT = 498,
TEXTUREBUFFER = 499, UTEXTURE2DRECT = 499,
ITEXTUREBUFFER = 500, TEXTUREBUFFER = 500,
UTEXTUREBUFFER = 501, ITEXTUREBUFFER = 501,
TEXTURECUBEARRAY = 502, UTEXTUREBUFFER = 502,
ITEXTURECUBEARRAY = 503, TEXTURECUBEARRAY = 503,
UTEXTURECUBEARRAY = 504, ITEXTURECUBEARRAY = 504,
TEXTURE2DMS = 505, UTEXTURECUBEARRAY = 505,
ITEXTURE2DMS = 506, TEXTURE2DMS = 506,
UTEXTURE2DMS = 507, ITEXTURE2DMS = 507,
TEXTURE2DMSARRAY = 508, UTEXTURE2DMS = 508,
ITEXTURE2DMSARRAY = 509, TEXTURE2DMSARRAY = 509,
UTEXTURE2DMSARRAY = 510, ITEXTURE2DMSARRAY = 510,
F16TEXTURE1D = 511, UTEXTURE2DMSARRAY = 511,
F16TEXTURE2D = 512, F16TEXTURE1D = 512,
F16TEXTURE3D = 513, F16TEXTURE2D = 513,
F16TEXTURE2DRECT = 514, F16TEXTURE3D = 514,
F16TEXTURECUBE = 515, F16TEXTURE2DRECT = 515,
F16TEXTURE1DARRAY = 516, F16TEXTURECUBE = 516,
F16TEXTURE2DARRAY = 517, F16TEXTURE1DARRAY = 517,
F16TEXTURECUBEARRAY = 518, F16TEXTURE2DARRAY = 518,
F16TEXTUREBUFFER = 519, F16TEXTURECUBEARRAY = 519,
F16TEXTURE2DMS = 520, F16TEXTUREBUFFER = 520,
F16TEXTURE2DMSARRAY = 521, F16TEXTURE2DMS = 521,
SUBPASSINPUT = 522, F16TEXTURE2DMSARRAY = 522,
SUBPASSINPUTMS = 523, SUBPASSINPUT = 523,
ISUBPASSINPUT = 524, SUBPASSINPUTMS = 524,
ISUBPASSINPUTMS = 525, ISUBPASSINPUT = 525,
USUBPASSINPUT = 526, ISUBPASSINPUTMS = 526,
USUBPASSINPUTMS = 527, USUBPASSINPUT = 527,
F16SUBPASSINPUT = 528, USUBPASSINPUTMS = 528,
F16SUBPASSINPUTMS = 529, F16SUBPASSINPUT = 529,
IMAGE1D = 530, F16SUBPASSINPUTMS = 530,
IIMAGE1D = 531, IMAGE1D = 531,
UIMAGE1D = 532, IIMAGE1D = 532,
IMAGE2D = 533, UIMAGE1D = 533,
IIMAGE2D = 534, IMAGE2D = 534,
UIMAGE2D = 535, IIMAGE2D = 535,
IMAGE3D = 536, UIMAGE2D = 536,
IIMAGE3D = 537, IMAGE3D = 537,
UIMAGE3D = 538, IIMAGE3D = 538,
IMAGE2DRECT = 539, UIMAGE3D = 539,
IIMAGE2DRECT = 540, IMAGE2DRECT = 540,
UIMAGE2DRECT = 541, IIMAGE2DRECT = 541,
IMAGECUBE = 542, UIMAGE2DRECT = 542,
IIMAGECUBE = 543, IMAGECUBE = 543,
UIMAGECUBE = 544, IIMAGECUBE = 544,
IMAGEBUFFER = 545, UIMAGECUBE = 545,
IIMAGEBUFFER = 546, IMAGEBUFFER = 546,
UIMAGEBUFFER = 547, IIMAGEBUFFER = 547,
IMAGE1DARRAY = 548, UIMAGEBUFFER = 548,
IIMAGE1DARRAY = 549, IMAGE1DARRAY = 549,
UIMAGE1DARRAY = 550, IIMAGE1DARRAY = 550,
IMAGE2DARRAY = 551, UIMAGE1DARRAY = 551,
IIMAGE2DARRAY = 552, IMAGE2DARRAY = 552,
UIMAGE2DARRAY = 553, IIMAGE2DARRAY = 553,
IMAGECUBEARRAY = 554, UIMAGE2DARRAY = 554,
IIMAGECUBEARRAY = 555, IMAGECUBEARRAY = 555,
UIMAGECUBEARRAY = 556, IIMAGECUBEARRAY = 556,
IMAGE2DMS = 557, UIMAGECUBEARRAY = 557,
IIMAGE2DMS = 558, IMAGE2DMS = 558,
UIMAGE2DMS = 559, IIMAGE2DMS = 559,
IMAGE2DMSARRAY = 560, UIMAGE2DMS = 560,
IIMAGE2DMSARRAY = 561, IMAGE2DMSARRAY = 561,
UIMAGE2DMSARRAY = 562, IIMAGE2DMSARRAY = 562,
F16IMAGE1D = 563, UIMAGE2DMSARRAY = 563,
F16IMAGE2D = 564, F16IMAGE1D = 564,
F16IMAGE3D = 565, F16IMAGE2D = 565,
F16IMAGE2DRECT = 566, F16IMAGE3D = 566,
F16IMAGECUBE = 567, F16IMAGE2DRECT = 567,
F16IMAGE1DARRAY = 568, F16IMAGECUBE = 568,
F16IMAGE2DARRAY = 569, F16IMAGE1DARRAY = 569,
F16IMAGECUBEARRAY = 570, F16IMAGE2DARRAY = 570,
F16IMAGEBUFFER = 571, F16IMAGECUBEARRAY = 571,
F16IMAGE2DMS = 572, F16IMAGEBUFFER = 572,
F16IMAGE2DMSARRAY = 573, F16IMAGE2DMS = 573,
STRUCT = 574, F16IMAGE2DMSARRAY = 574,
VOID = 575, STRUCT = 575,
WHILE = 576, VOID = 576,
IDENTIFIER = 577, WHILE = 577,
TYPE_NAME = 578, IDENTIFIER = 578,
FLOATCONSTANT = 579, TYPE_NAME = 579,
DOUBLECONSTANT = 580, FLOATCONSTANT = 580,
INT16CONSTANT = 581, DOUBLECONSTANT = 581,
UINT16CONSTANT = 582, INT16CONSTANT = 582,
INT32CONSTANT = 583, UINT16CONSTANT = 583,
UINT32CONSTANT = 584, INT32CONSTANT = 584,
INTCONSTANT = 585, UINT32CONSTANT = 585,
UINTCONSTANT = 586, INTCONSTANT = 586,
INT64CONSTANT = 587, UINTCONSTANT = 587,
UINT64CONSTANT = 588, INT64CONSTANT = 588,
BOOLCONSTANT = 589, UINT64CONSTANT = 589,
FLOAT16CONSTANT = 590, BOOLCONSTANT = 590,
LEFT_OP = 591, FLOAT16CONSTANT = 591,
RIGHT_OP = 592, LEFT_OP = 592,
INC_OP = 593, RIGHT_OP = 593,
DEC_OP = 594, INC_OP = 594,
LE_OP = 595, DEC_OP = 595,
GE_OP = 596, LE_OP = 596,
EQ_OP = 597, GE_OP = 597,
NE_OP = 598, EQ_OP = 598,
AND_OP = 599, NE_OP = 599,
OR_OP = 600, AND_OP = 600,
XOR_OP = 601, OR_OP = 601,
MUL_ASSIGN = 602, XOR_OP = 602,
DIV_ASSIGN = 603, MUL_ASSIGN = 603,
ADD_ASSIGN = 604, DIV_ASSIGN = 604,
MOD_ASSIGN = 605, ADD_ASSIGN = 605,
LEFT_ASSIGN = 606, MOD_ASSIGN = 606,
RIGHT_ASSIGN = 607, LEFT_ASSIGN = 607,
AND_ASSIGN = 608, RIGHT_ASSIGN = 608,
XOR_ASSIGN = 609, AND_ASSIGN = 609,
OR_ASSIGN = 610, XOR_ASSIGN = 610,
SUB_ASSIGN = 611, OR_ASSIGN = 611,
LEFT_PAREN = 612, SUB_ASSIGN = 612,
RIGHT_PAREN = 613, LEFT_PAREN = 613,
LEFT_BRACKET = 614, RIGHT_PAREN = 614,
RIGHT_BRACKET = 615, LEFT_BRACKET = 615,
LEFT_BRACE = 616, RIGHT_BRACKET = 616,
RIGHT_BRACE = 617, LEFT_BRACE = 617,
DOT = 618, RIGHT_BRACE = 618,
COMMA = 619, DOT = 619,
COLON = 620, COMMA = 620,
EQUAL = 621, COLON = 621,
SEMICOLON = 622, EQUAL = 622,
BANG = 623, SEMICOLON = 623,
DASH = 624, BANG = 624,
TILDE = 625, DASH = 625,
PLUS = 626, TILDE = 626,
STAR = 627, PLUS = 627,
SLASH = 628, STAR = 628,
PERCENT = 629, SLASH = 629,
LEFT_ANGLE = 630, PERCENT = 630,
RIGHT_ANGLE = 631, LEFT_ANGLE = 631,
VERTICAL_BAR = 632, RIGHT_ANGLE = 632,
CARET = 633, VERTICAL_BAR = 633,
AMPERSAND = 634, CARET = 634,
QUESTION = 635, AMPERSAND = 635,
INVARIANT = 636, QUESTION = 636,
PRECISE = 637, INVARIANT = 637,
HIGH_PRECISION = 638, PRECISE = 638,
MEDIUM_PRECISION = 639, HIGH_PRECISION = 639,
LOW_PRECISION = 640, MEDIUM_PRECISION = 640,
PRECISION = 641, LOW_PRECISION = 641,
PACKED = 642, PRECISION = 642,
RESOURCE = 643, PACKED = 643,
SUPERP = 644 RESOURCE = 644,
SUPERP = 645
}; };
#endif #endif
...@@ -475,7 +476,7 @@ union YYSTYPE ...@@ -475,7 +476,7 @@ union YYSTYPE
}; };
} interm; } interm;
#line 479 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ #line 480 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */
}; };
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
......
...@@ -184,6 +184,7 @@ INSTANTIATE_TEST_CASE_P( ...@@ -184,6 +184,7 @@ INSTANTIATE_TEST_CASE_P(
"loopsArtificial.frag", "loopsArtificial.frag",
"matrix.frag", "matrix.frag",
"matrix2.frag", "matrix2.frag",
"nonuniform.frag",
"newTexture.frag", "newTexture.frag",
"Operations.frag", "Operations.frag",
"overlongLiteral.frag", "overlongLiteral.frag",
......
...@@ -6560,6 +6560,7 @@ void HlslParseContext::mergeQualifiers(TQualifier& dst, const TQualifier& src) ...@@ -6560,6 +6560,7 @@ void HlslParseContext::mergeQualifiers(TQualifier& dst, const TQualifier& src)
MERGE_SINGLETON(readonly); MERGE_SINGLETON(readonly);
MERGE_SINGLETON(writeonly); MERGE_SINGLETON(writeonly);
MERGE_SINGLETON(specConstant); MERGE_SINGLETON(specConstant);
MERGE_SINGLETON(nonUniform);
} }
// used to flatten the sampler type space into a single dimension // used to flatten the sampler type space into a single dimension
......
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