* Fixes#2005
Allow multiple units in a stage to have push_constants as long
as the blocks match.
Requires #2006 to be fixed to be functional.
* tweaks to #2005 fix after some testing
* add unit tests for push constants across multiple compilation units
For #2005
* update reference output for tests that fail validation
* fix uninitialized result.validationResult
For GLSL function imageAtomicStore, it will be translated to
OpImageTexelPointer + OpAtomicStore. The result type of
OpImageTexelPointer must be the same as the sampled type of OpTypeImage.
On translation, the result type is mistakenly fetched from operand list
operands[2] while operands[2] corresponds to sampleNum whose type is
always uint. This leads to an error if the image type is iimageXXX that is
int image.
When 2DMS or 2DMSArray is used, IMAGE_PARAMS will take an additional
paramter to represent sample number. The semantics check should get the
correct semantics values, taking this case into account.
GLSL Version : >= 150
Purpose:
Allow users to use features by enabling this extension, even in low versions.
Extension Name:
ARB_gpu_shader_fp64
Builtin-variables:
Nah
Builtin-functions:
functions overloaded for this extension, please check registry in reference.
Keywords:
Double
Features:
add support for type "double"
Reference:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gpu_shader_fp64.txt
Add support for implicit conversion
1. Remove builtin double vertex (this is introduced by vertex_attrib_64bit
2. Add extension check and implicit conversion as double has been introduced
3. Add test results.
Modify atomic_uint binding check.
Currently, when not declared with offset, default atomic_unint won't check whether its binding is valid or not more than its limit value.
GLSL Version : >= 140
Purpose:
Allow users to use features by enabling this extension, even in low versions.
Extension Name:
ARB_texture_multisample
Builtin-variables:
Nah
Builtin-functions:
Nah
Keywords:
sampler2DMS, isampler2DMS, usampler2DMS,
sampler2DMSArray, isampler2DMSArray, usampler2DMSArray
Reference:
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_multisample.txt
Purpose:
glsl spec allows to define array with the length of the result of constant expression, the arithmetic operation of "mod(float (7.1), float (4.0))" should be generate the array length at the shader compile time,
but glslang didn't support mod operation for the constant expression in previous implementation;
An example is as following:
###########
#version 460
flat out highp int vtx_out_out0;
void main (void)
{
float array[int(mod(float (7.1), float (4.0)))];
vtx_out_out0 = array.length();
}
###########
The changes to glslang/glslang/MachineIndependent/ParseHelper.cpp exist
purely to prevent even more instances of "warning: enumeration value
‘EOp...’ not handled in switch"
v2: Remove 8-bit types. Overzealous copy-and-paste led to adding
support for a bunch of types that the extension doesn't actually enable.
v3: Update expected test results file. Just changing an expected
results file to make a test pass seems sketchy to me, but I'm not sure
what else to do.
v4: Add missing entry for EOpAbsDifference in
TOutputTraverser::visitBinary. Noticed by JohnK.
More aggressively prune unreachable code as follows.
When no control flow edges reach a merge block or continue target:
- delete their contents so that:
- a merge block becomes OpLabel, then OpUnreachable
- a continue target becomes OpLabel, then an OpBranch back to the
loop header
- any basic block which is dominated by such a merge block or continue
target is removed as well.
- decorations targeting the removed instructions are removed.
Enables the SPIR-V builder post-processing step the GLSLANG_WEB case.