Move the parameter verifictation to a centralized place where all the builtins
are verified for correctness.
Add verification for the new builtins with version and extension check
These builtins are supported on GLSL since version 130 and GLES since
version 300.
Adds the --no-link option which outputs the compiled shader binaries
without linking them. This is a first step towards allowing users to
create SPIR-v binary, non-executable libraries.
When using the --no-link option, all functions are decorated with the
Export linkage attribute.
Previously, the type names in the nonsemantic shader debug info would be
"int", "uint", or "float" for all numeric types. This change makes the
correct names such as "int8_t" or "float16_t" get emitted.
float textureOffset(sampler2DArrayShadow sampler, vec4 P, ivec2 offset)
was incorrectly requiring the GL_EXT_texture_shadow_lod extension.
NOTE: Prior to GLSL 440, this prototype was defined as
float textureOffset(sampler2DArrayShadow sampler, vec4 P, vec2 offset)
i.e., the type of 'offset' was specified as 'vec2' rather than 'ivec2'.
This is believed to be a typo.
Fixes#3325.
This is needed now that we force the user to explicitly choose between
disabling use of SPIRV-Tools, using a version installed on the system,
or using the version obtained by update_glslang_source.py
This makes it more clear to users when SPIR-V optimization is disabled
because SPIRV-Tools could not be found, and suggests alternatives for
finding it.
This allows to build with optimizer enabled, if external SPIR-V tools
libraries are available in the system. It is quite common in *nix world
to package spirv-tools and glslang separately.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Previously, when GL_EXT_spirv_intrinsics are enabled, we disable all
checks in layoutTypeCheck. This is too coarse because we can use nothing
in GL_EXT_spirv_intrinsics in a shader while the necessary processing is
skipped, such as addUsedLocation.
In this change, we apply fine check and more might be added if we
encounter new cases in the future.
Before this change, using gl_MeshPrimitivesEXT in mesh shader would
unconditionally create gl_MeshPrimitivesEXT.gl_PrimitiveShadingRateEXT
field and add PrimitiveShadingRateKHR capability to the output SPIRV
file, which would subsequently trigger validation errors when creating
the shader module unless the application requested primitive shading
rate feature.
What should happen instead is that unless GL_EXT_fragment_shading_rate
extension is enabled, we should not allow using
gl_PrimitiveShadingRateEXT and should not emit the associated fields
into the output.
This change fixes this by using existing filterMember mechanism that is
already used in a few other cases like this, and adjusting the required
extension on the field member which will generate an error when
gl_PrimitiveShadingRateEXT is used without enabling the extension.
There should not be a '/' after $ENV{DESTDIR} in the cmake install script.
This change also:
- Uses lukka/get-cmake github action consistently across jobs
- Add the glslang binary to the continuous deployment archive
The usage of GetGlobalLock/ReleaseGlobalLock/InitGlobalLock is replaced
by std::lock_guard which is available as of c++11, and the functions are
removed from the OSDependent ossource.cpp files.
The standalone glslang binary now explicitly depends on OSDependent, as
nothing in in the glslang library uses those functions anymore and they
are not implicitly picked up by the linker.
The `spirv-remap` tool now supports two output modes:
* Outputting one or more inputs to a single directory -- the previous
behavior
* One output file per input -- new behavior.
Build fails due to external dependency on SPIRV-Tools.
EX:
```
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at External/spirv-tools/CMakeLists.txt:15 (cmake_minimum_required):
CMake 3.17.2 or higher is required. You are running version 3.14.0
```