GLSL: Disallow 'shared' in nested scopes.

This implements Khronos-private specification bug 16130.
This commit is contained in:
John Kessenich 2017-06-08 10:13:15 -06:00
parent c5f2ab965f
commit dd56173d04
4 changed files with 609 additions and 599 deletions

View File

@ -1,2 +1,6 @@
#version 450 core
layout(local_size_x = 0) in; // ERROR, 0 not allowed
layout(local_size_x = 0) in; // ERROR, 0 not allowed
void main()
{
shared float f; // ERROR shared must be global
}

View File

@ -1,20 +1,24 @@
450.comp
ERROR: 0:2: 'local_size_x' : must be at least 1
ERROR: 1 compilation errors. No code generated.
ERROR: 0:5: 'shared' : not allowed in nested scope
ERROR: 2 compilation errors. No code generated.
Shader version: 450
local_size = (1, 1, 1)
ERROR: node is still EOpNull!
0:3 Function Definition: main( ( global void)
0:3 Function Parameters:
0:? Linker Objects
Linked compute stage:
ERROR: Linking compute stage: Missing entry point: Each stage requires one entry point
Shader version: 450
local_size = (1, 1, 1)
ERROR: node is still EOpNull!
0:3 Function Definition: main( ( global void)
0:3 Function Parameters:
0:? Linker Objects

View File

@ -1231,6 +1231,7 @@ storage_qualifier
$$.qualifier.storage = EvqBuffer;
}
| SHARED {
parseContext.globalCheck($1.loc, "shared");
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
parseContext.requireStage($1.loc, EShLangCompute, "shared");

File diff suppressed because it is too large Load Diff