diff --git a/Test/310.comp b/Test/310.comp index 9575b6f9db3cf262a1348aa32ce5a5c99a44866a..9ca8eaaa104aa48599789dd50b69523c81fe5e15 100644 --- a/Test/310.comp +++ b/Test/310.comp @@ -4,7 +4,7 @@ layout(local_size_x = 2) in; layout(local_size_x = 16) in; // ERROR, changing layout(local_size_z = 4096) in; // ERROR, too large layout(local_size_x = 2) in; - +layout(local_size_y = 0) in; // ERROR, 0 not allowed const int total = gl_MaxComputeWorkGroupCount.y + gl_MaxComputeUniformComponents + gl_MaxComputeTextureImageUnits diff --git a/Test/450.comp b/Test/450.comp index 7f723ec0fe2746f446b3ac12add9404379d29245..b6d974ea854b462dab7019e5dbc6eedb8b236868 100644 --- a/Test/450.comp +++ b/Test/450.comp @@ -1 +1,2 @@ #version 450 core +layout(local_size_x = 0) in; // ERROR, 0 not allowed \ No newline at end of file diff --git a/Test/baseResults/310.comp.out b/Test/baseResults/310.comp.out index e97571ac94245a5d8526467e70b8154a76c9a224..85bb3d7c361b643160f5d4d68b7630b91b163dbc 100644 --- a/Test/baseResults/310.comp.out +++ b/Test/baseResults/310.comp.out @@ -1,6 +1,7 @@ 310.comp ERROR: 0:4: 'local_size' : cannot change previously set size ERROR: 0:5: 'local_size' : too large; see gl_MaxComputeWorkGroupSize +ERROR: 0:7: 'local_size_y' : must be at least 1 ERROR: 0:23: '' : array size required ERROR: 0:39: 'in' : global storage input qualifier cannot be used in a compute shader ERROR: 0:39: 'location qualifier on input' : not supported in this stage: compute @@ -83,7 +84,7 @@ WARNING: 0:238: '#define' : names containing consecutive underscores are reserve ERROR: 0:244: 'gl_DeviceIndex' : required extension not requested: GL_EXT_device_group ERROR: 0:245: 'gl_ViewIndex' : undeclared identifier ERROR: 0:255: 'gl_ViewIndex' : undeclared identifier -ERROR: 82 compilation errors. No code generated. +ERROR: 83 compilation errors. No code generated. Shader version: 310 diff --git a/Test/baseResults/450.comp.out b/Test/baseResults/450.comp.out index 4d3ff7d88bf749b4cc9f54c81b4c659c866a5530..0e4ab326fd8750056451f25a036c31cf50662462 100644 --- a/Test/baseResults/450.comp.out +++ b/Test/baseResults/450.comp.out @@ -1,7 +1,11 @@ 450.comp +ERROR: 0:2: 'local_size_x' : must be at least 1 +ERROR: 1 compilation errors. No code generated. + + Shader version: 450 local_size = (1, 1, 1) -0:? Sequence +ERROR: node is still EOpNull! 0:? Linker Objects @@ -11,6 +15,6 @@ ERROR: Linking compute stage: Missing entry point: Each stage requires one entry Shader version: 450 local_size = (1, 1, 1) -0:? Sequence +ERROR: node is still EOpNull! 0:? Linker Objects diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 0208224b885a07e589b08308a359c9f565ce6096..4aa6f4e16ee8cc7a6df8bf7892204cb3aa3bdb07 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -4260,6 +4260,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi if (id.compare(0, 11, "local_size_") == 0) { profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize"); profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); + if (id.size() == 12 && value == 0) { + error(loc, "must be at least 1", id.c_str(), ""); + return; + } if (id == "local_size_x") { publicType.shaderQualifiers.localSize[0] = value; return;