`glslang_pch()` did manual mangling of the compiler flags to enable pre-compiled headers.
I couldn't get this approach to work with the `MachineIndependent` subdirectory, but fortunately CMake has added first-class support for precompiled headers in 3.16, which does work with subdirectories.
Moved `glslang_pch()` to the other global function declarations.
`glslang_pch()` is a no-op when using CMake earlier than `3.16`.
CMake's PCH implementation does not need the `pch.cpp` files, so just remove them.
On closer inspection, it appears that nearly all the targets use the `POSITION_INDEPENDENT_CODE` target option anyway.
Simplify all this away by always being PIC.
`.vscode/` ignores Visual Studio Code user config files
`bazel-*` ignores bazel build system symlinks.
`out/` ignores the default output directory for Visual Studio generated files.
Dawn tests use shaderc, which assumes glslang has HLSL support. This
change makes HLSL support also follow template arguments, and changes
the target names such that glslang_sources will remain the "has all
features" target and the new glslang_lib_sources would be what ANGLE
would use.
Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
Enables `-fPIC` compiler flag even when building statically.
This is helpful for statically linking a `glslang` target into a shared library.
Simplifies the workarounds seen in google/shaderc#1093 to a `set(GLSLANG_BUILD_PIC 1)`.
To reduce the binary size of ANGLE, a gn override is added
(glslang_angle) which:
- Controls whether ENABLE_OPT=1 is set
- Customizes the build for the Vulkan backend of ANGLE. As a first
step, this removes HLSL functionality which together with no
optimization shave ~2.5MB off of ANGLE's binary size.
Upcoming changes will add a macro for GLSLANG_ANGLE similar to
GLSLANG_WEB that will strip features from glslang to support only what
ANGLE needs.
Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
This introduces five new "Validation failures":
- baseResults/hlsl.semantic.vert: issue with gl_ClipDistance/CullDistance
- baseResults/spv.430.vert: issue gl_ClipDistance
- baseResults/spv.450.tesc: still unknown
- baseResults/spv.dataOut.frag: gl_FragData should not be supported, problem with front end
- baseResults/spv.meshShaderPerViewUserDefined.mesh: seems okay, maybe a problem with SPIRV-Tools
This adds or changes binding/location decorations in 100s of shaders.
It also allows more output (spv.register.autoassign.rangetest.frag)
due to allowing ioMap() to fail.
Ideally we'd unify the licenses in use by changing the licenses in the file headers to BSD-3-clause.
Until then, let's correctly list all the licenses currently in use.
Issue: #2305
Default to `-fvisibility=hidden`, and annotate the public glslang interface with `GLSLANG_EXPORT` to change the visibility of these cherry-picked symbols to default.
This is also used by Windows builds for `__declspec(dllexport)`-ing the public DLL interface.
This allows us to classify API changes into those that are publicly backwards compatible, and those that are not.
Note that `libSPIRV` will likely need similar treatment.
Issues: #2283, #1484
Fix#2298.
The AST has two precisions, an operation precision and a result precision.
Actual use of GLSL with mediump samplers wants the result precision, so
pick that up instead of the operation precision.
This simplifies and enforces use of precision in many more places,
to help avoid accidental loss of RelaxedPrecision through intermediate
operations. Known fixes are:
- ?:
- function return values with mis-matched precision
- precision of function return values when a copy was needed to fix types