Purpose :
According to GLSL SPEC 4.6 ( 4.4.1.4 Compute Shader Inputs), for compute shader input qualifiers, we should declare such qualifiers with same values in the same shader (local_size_x, y and z).
"If such a layout qualifier is declared more than once in the same shader, all those declarations must set the same set of local work-group sizes and set them to the same values; otherwise a compile-time error results."
Why this fix:
If we manually set "local_size_x = 1" and directly following a declaration like "local_size_x = 2", this would not be detected. That is because currently we treat all the '1' as default value and could not restrictly detect whether those are default values.
Test case:
......
layout(local_size_x=1) in;
layout(local_size_x=2) in;
......
So I add test cases for this fix:
1. set local_size_y = 1 => success
2. set local_size_y = 2 => error
3. set local_size_y = 1 => success
According to the 32-bit counterparts, their forms should be
genI64Type findLSB(genI64Type value)
genI64Type findLSB(genU64Type value)
genI64Type findMSB(genI64Type value)
genI64Type findMSB(genU64Type value)
The order of error checking was not quite being correct (maybe there is no correct
ordering, when many checks must be done and they affect each other).
So, check for block-name reuse twice.
Also fixes, in practice, https://github.com/KhronosGroup/GLSL/issues/83.
When the specification language is correctly created, glslang can be
revisited for correctness. In the meantime, this seems like the best
"bug" to have relative to the specification.
Memory qualifiers are only relevant to parameters when they apply
to what the argument points to, as otherwise the argument is copied.
This leaves the fix from #1870 in place, and then more correctly
ignores memory qualifiers when something will be passed by copy.
In the current version of the code on non-debug builds these cases
will fallthrough, since assert is a no-op, and eventually make a call
passing in |op| which hasn't been initialized. clang is currently
throwing a warning about this behaviour when integrating downstream.
This patch changes the behaviour, so that in any branch that has an
assert now has a return nullptr, to indicate failure after it and
avoid the uninitialized variable usage.
If we don't do this then we get reflection output like so:
ArrayedBind[0].a.a: offset 0, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].a.b: offset 4, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b.a: offset 4, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b.b: offset 8, type 1406, size 1, index 4, binding -1, stages 0
ArrayedBind[0].b: offset 4, type 1406, size 1, index 4, binding -1, stages 1
When the outer reflection loop that calls blowUpActiveAggregate incorrectly iterates over the struct members.
Saved about 21K, size down to 380K of MSVC x86 code.
Fixed one bug that needs to be looked at on the master branch:
The test for needing a Vulkan binding has a bug in it, "!layoutAttachment"
which does not mean "no layoutAttachment", because that is non-zero.
This is why some test and test results changed.
About 60K smaller (20% the target size is these units of 300K).
Over 300 fewer #ifdef.
This adds a new glslang.m4 file that needs to be processed by m4 to get
the glslang.y file needed by bison. See comment in glslang.m4 for more
detail.
This updates the updateGrammar script to do the .m4 -> .y processing,
to conditionally exclude grammar not needed for the web build.
About 50 fewer #ifdefs.
About 14K smaller.
Note, the base size is ill-defined due to optimizer settings (size vs. performance),
compression, and target architecture. Some recent %'s are accidentally reported as
3X the real savings. Early %'s were accurate. What matters though is that each
step got worthwhile gains, and what the final size ends up being.