Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify glslang grammar for identifier lists #3772

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Test/baseResults/100.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ERROR: 0:227: 'non-constant global initializer (needs GL_EXT_shader_non_constant
ERROR: 0:235: '#define' : names containing consecutive underscores are reserved, and an error if version < 300: A__B
ERROR: 0:236: 'a__b' : identifiers containing consecutive underscores ("__") are reserved, and an error if version < 300
ERROR: 0:3000: '#error' : line of this error should be 3000
ERROR: 0:3002: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:3002: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 82 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/100samplerExternal.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found
ERROR: 0:31: 'texture' : no matching overloaded function found
ERROR: 0:32: 'textureProjLod' : no matching overloaded function found
ERROR: 0:38: 'samplerExternalOES' : required extension not requested: GL_OES_EGL_image_external
ERROR: 0:41: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:41: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 14 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/140.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ERROR: 0:27: 'location' : not supported for this version or the enabled extensio
ERROR: 0:27: 'location qualifier on output' : not supported for this version or the enabled extensions
ERROR: 0:41: 'assign' : l-value required "v" (can't modify shader input)
ERROR: 0:41: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters.
ERROR: 0:56: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:56: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 9 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/300samplerExternal.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found
ERROR: 0:31: 'texture' : no matching overloaded function found
ERROR: 0:32: 'textureProjLod' : no matching overloaded function found
ERROR: 0:38: 'samplerExternalOES' : required extension not requested: GL_OES_EGL_image_external_essl3
ERROR: 0:41: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:41: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 11 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/300samplerExternalYUV.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ERROR: 0:29: 'texture3D' : no matching overloaded function found
ERROR: 0:30: 'texture2DProjLod' : no matching overloaded function found
ERROR: 0:31: 'texture' : no matching overloaded function found
ERROR: 0:32: 'textureProjLod' : no matching overloaded function found
ERROR: 0:37: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:37: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 10 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/420.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ERROR: 0:12: 'gl_FragDepth' : cannot redeclare after use
ERROR: 0:14: 'atomic_uint' : array must be explicitly sized
ERROR: 0:17: 'imageSize' : required extension not requested: GL_ARB_shader_image_size
ERROR: 0:54: 'std430' : not supported for this version or the enabled extensions
ERROR: 0:54: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:54: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 7 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/glspv.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ERROR: 0:23: 'noise3' : no matching overloaded function found
ERROR: 0:24: 'noise4' : no matching overloaded function found
ERROR: 0:27: 'atomic_uint' : layout(binding=X) is required
ERROR: 0:28: 'input_attachment_index' : only allowed when using GLSL for Vulkan
ERROR: 0:28: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:28: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 10 compilation errors. No code generated.


Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/glspv.vert.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ERROR: 0:9: 'binding' : uniform/buffer blocks require layout(binding=X)
ERROR: 0:13: 'gl_VertexIndex' : undeclared identifier
ERROR: 0:14: 'gl_InstanceIndex' : undeclared identifier
ERROR: 0:17: 'gl_DepthRangeParameters' : undeclared identifier
ERROR: 0:20: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 0:20: '' : syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
ERROR: 10 compilation errors. No code generated.


Expand Down
14 changes: 4 additions & 10 deletions glslang/MachineIndependent/glslang.y
Original file line number Diff line number Diff line change
Expand Up @@ -922,15 +922,9 @@ declaration
parseContext.updateStandaloneQualifierDefaults($1.loc, $1);
$$ = 0;
}
| type_qualifier IDENTIFIER SEMICOLON {
| type_qualifier identifier_list SEMICOLON {
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$2.string);
$$ = 0;
}
| type_qualifier IDENTIFIER identifier_list SEMICOLON {
parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
$3->push_back($2.string);
parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$3);
parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$2);
$$ = 0;
}
;
Expand All @@ -947,9 +941,9 @@ block_structure
}

identifier_list
: COMMA IDENTIFIER {
: IDENTIFIER {
$$ = new TIdentifierList;
$$->push_back($2.string);
$$->push_back($1.string);
}
| identifier_list COMMA IDENTIFIER {
$$ = $1;
Expand Down
Loading