Commit Graph

4770 Commits

Author SHA1 Message Date
Wooyoung Kim
bd0edbc7e0 extension: GL_QCOM_image_processing support 2023-12-11 20:03:17 +00:00
Joyce
e07c1bb5fc Add badge to README.md
Signed-off-by: Joyce <joycebrum@google.com>
2023-12-11 20:03:17 +00:00
Joyce
7884e50c41 Create scorecard.yml
Signed-off-by: Joyce <joycebrum@google.com>
2023-12-11 20:03:17 +00:00
Nathaniel Cesario
368549ffe6 Fix CI build badge
Replaces the appveyor build (which is no longer used) with a badge
pointing to the continuous_integration.yml job status.
2023-12-11 20:03:17 +00:00
Sven van Haastregt
4b165580ae cmake: Don't link SPVRemapper into glslang executable
The functionality of `libSPVRemapper` is only used by the
`spirv-remap` executable, so don't link it into the `glslang`
executable.
2023-12-11 20:03:17 +00:00
Pedro Olsen Ferreira
f9a15613b0 [cmake] Use CMake property for symbol visibility
CMake provides a target property to set default symbol visibility which
supports different toolchains transparently.
2023-12-11 20:03:17 +00:00
Kacper Michajłow
99da060110 Look for external SPIR-V Tools build, if not building in-tree
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>
2023-12-11 20:03:17 +00:00
Rex Xu
0da98c51c4 Spirv_intrinsics: Remove early return in layoutTypeCheck
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.
2023-12-11 20:03:17 +00:00
Nathaniel Cesario
e69f74f010 Update known_good.json
SPIRV-Tools: v2023.4.rc2
2023-12-11 20:03:17 +00:00
Arseny Kapoulkine
76dd399629 Fix interaction between GL_EXT_mesh_shader and GL_EXT_fragment_shading_rate
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.
2023-12-11 20:03:17 +00:00
Nathaniel Cesario
43a1334078 Fix continuous deployment
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
2023-12-11 20:03:17 +00:00
Nathaniel Cesario
270b1f34f7 Add emscripten build to CI
Adds a build-only (no test) job for testing the emscripten (web) build
on github actions.
2023-12-11 20:03:17 +00:00
Arcady Goldmints-Orlov
b4443eb859 Replace GlobalLock functions with std::mutex
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.
2023-12-11 20:03:17 +00:00
Tim Biermann
1b37f3a490 respect destdir for compat symlink 2023-12-11 20:03:17 +00:00
Arcady Goldmints-Orlov
e40191047c Remove glslang.m4
The m4 grammar build mechanism was only ever needed as a preprocessor
for bison, to be used with GLSLANG_WEB, which has now been removed.

Fixes #2958
2023-12-11 20:03:17 +00:00
Arcady Goldmints-Orlov
73b75b1998 Remove a stray GLSLANG_WEB ifdef 2023-12-11 20:03:17 +00:00
dan sinclair
1352540a63 Remove GLSLANG_WEB and GLSLANG_WEB_DEVEL
This CL removes the GLSLANG_WEB and GLSLANG_WEB_DEVEL
cmake build options and their usage in the codebase.

Issue #2958
2023-12-11 20:03:17 +00:00
Allan MacKinnon
91cf7eea89 spirv-remap: Support outputting each SPIR-V module to a filename
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.
2023-12-11 20:03:17 +00:00
Juan Ramos
3540cd5081 ci: Test CMake minimum 2023-12-11 20:03:17 +00:00
Juan Ramos
d3c403eeb5 cmake: Raise minimum to 3.17.2
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
```
2023-12-11 20:03:17 +00:00
画卦伏羲
7247854500 Fix [type] command file url forward slashes issue when use mingw 2023-12-11 20:03:17 +00:00
Arcady Goldmints-Orlov
4540ec6cf3 Remove OSDependent TLS functions
These are no longer used now that the PoolAllocator uses the standard
c++11 thread_local storage mechanism.
2023-12-11 20:03:17 +00:00
Ben Clayton
75deb53f3a Deprecate InitializeDll functions
These were only used for TThreadPool, which now uses `thread_local`.
2023-12-11 20:03:17 +00:00
Ben Clayton
f527002d45 Simplify PoolAlloc with use of thread_local.
glslang is using C++ 11, which has first class support for variables of the `thread_local` storage class.

By dropping the use of the `OS_[GS]etTLSValue`, we can simplify the logic, and have it support a thread-local default allocator if none is provided.

Issue: #2346
2023-12-11 20:03:16 +00:00
Boris Zanin
f56d219587 Implement support for GL_KHR_cooperative_matrix extension 2023-12-11 20:03:16 +00:00
Sven van Haastregt
16af4d6c49 Fix typo in error message 2023-12-11 20:03:16 +00:00
Juan Ramos
0dbb5dd1bd Modernize linux CI
- Test Ubuntu-22.04
- Use ccache
- Ensure backwards compatibility with Ubuntu-20.04
2023-12-11 20:03:16 +00:00
Juan Ramos
ffa62876c7 git: Ignore CMakeUserPresets.json
CMakeUserPresets.json can be useful for developers and is not
meant to be checked in.
2023-12-11 20:03:16 +00:00
Juan Ramos
3eff55b56b ci: Test Android NDK matrix combinations 2023-12-11 20:03:16 +00:00
scribam
700c328ea3 Remove useless semicolons 2023-12-11 20:03:16 +00:00
Sven van Haastregt
917e466f9d Silence unused parameter warning
The parameter could be removed, but keep it for consistency with other
`makeSpirvTypeParameters` overloads.
2023-12-11 20:03:16 +00:00
Arcady Goldmints-Orlov
35a3b0251c Remove obsolete files
WORKSPACE is related to Bazel, which is no longer supported
Test/makeDoc uses an option that glslang no longer supports.
2023-12-11 20:03:16 +00:00
Jeremy Hayes
c64cba89d6 Update CHANGES for release 12.3.1 2023-12-11 20:03:16 +00:00
Nathaniel Cesario
4bf5ec0c1e web: Fix emscripten build
The web/emscripten build has been broken for an unknown amount of time
and for multiple reasons:
  - Calling `cat` on Windows
  - The latest version of wasm-ld does not support the `--no-undefined`
    flag
  - `ccall` was not being exported

Fixes #3272.
2023-12-11 20:03:16 +00:00
David Neto
cf7e5a9343 Support MinGW build with Clang, not just GCC
Fixes: #3270
2023-12-11 20:03:16 +00:00
Nathaniel Cesario
2feaf5600a cmake: Fix symlink on Windows
Copy the old glslangValidator name on Windows rather than creating a
symlink. While cmake 3.13 and above supports creating symlinks on
Windows, a security policy change is required in general to allow
the creation of symlinks for non-trusted users. See
https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links

Fixes #3268.
2023-12-11 20:03:16 +00:00
Jeremy Hayes
fc0426602c Update CHANGES for release 12.3.0 2023-12-11 20:03:16 +00:00
Jeremy Hayes
c47d5fc843 Update known_good.json 2023-12-11 20:03:16 +00:00
Nathaniel Cesario
635ce4f2e2 cmake: Rename glslang to glslangValidator
Rename glslangValidator to glslang and adds a glslangValidator symlink
to the build and install directories.

Closes #47.
2023-12-11 20:03:16 +00:00
Juan Ramos
e7c558ba38 cmake: Fix Android build for r25 NDK
Currently with the build instructions provided in README.md
the build will fail.

In the r25 NDK the CMake toolchain defaults to the legacy path,
due to a bug in the current implementation.

https://github.com/android/ndk/issues/323
2023-12-11 20:03:16 +00:00
Pedro Olsen Ferreira
02aa2b282b Fix maybe-uninitialized warning
The 'set' and 'setRT' variables were warning as maybe-uninitialized even
though in practice that case would never trigger (due to how the
function flow-controls).
The code blocks where these variables are actually read do not overlap,
so merge them into the same 'set' variable.
Simplify the control flow of the function with early-returns, which
drops indentation and simplifies the function.
2023-12-11 20:03:16 +00:00
Dawid-Lorenz-Mobica
a94c5ff864 HLSL: support binary literals
Fixes #3089
2023-12-11 20:03:16 +00:00
Zeqiang Li
1804b08805 Add missing initialization members for web (#3246) 2023-12-11 20:03:16 +00:00
Malcolm Bechard
b8227c215e Rework how auto push_constant upgrading works a bit.
Ensure we traverse the entire tree and upgrade all references to the
given symbol so it can be upgraded to push_constant. Without this change
only one instance was upgraded, and others were left as uniform buffers.
2023-12-11 20:03:16 +00:00
Nathaniel Cesario
2f4a667120 build: Remove bazel build support 2023-12-11 20:03:16 +00:00
Arcady Goldmints-Orlov
f83eeaebf5 Use std::call_once in spv::Parameterize()
There was a race condition in this function as it used a static variable
to attempt to ensure global initialization was only done once, which was
not thread-safe. Instead, use std::call_once, which was added to C++11
for this exact case.

Fixes #342
2023-12-11 20:03:16 +00:00
Joyce
6f0b445f90 Create a Security Policy (#3169)
* Create SECURITY.md

Signed-off-by: Joyce <joycebrum@google.com>
2023-12-11 20:03:16 +00:00
Dawid Lorenz
56b1090f33 Add support for pre and post HLSL qualifier validation
The change makes it possible to define a const variable after the marked
type. Example "float const"
2023-12-11 20:03:16 +00:00
Dawid Lorenz
10da9c9550 Add support for pre and post HLSL qualifier validation
The change makes it possible to define a const variable after the marked
type. Example "float const"
2023-12-11 20:03:16 +00:00
Rex Xu
4218bbe746 Spirv_intrinsics: Add support of type specifier to spirv_type
Previously, spirv_type doesn't accept type specifier as its parameter.
With this change, we can input non-array type specifier. This is because
some SPIR-V type definition intructions often need to reference other
SPIR-V types as its source operands. We add the support to facilitate
such usage.
2023-12-11 20:03:16 +00:00