Commit Graph

4976 Commits

Author SHA1 Message Date
Juan Ramos
026a9bcdb2 ci: Test Android NDK matrix combinations 2023-07-24 18:42:14 -06:00
scribam
c81b34fb24 Remove useless semicolons 2023-07-24 15:36:54 -06:00
Sven van Haastregt
fe82779952 Silence unused parameter warning
The parameter could be removed, but keep it for consistency with other
`makeSpirvTypeParameters` overloads.
2023-07-24 10:54:56 -06:00
Arcady Goldmints-Orlov
65397339c5 Remove obsolete files
WORKSPACE is related to Bazel, which is no longer supported
Test/makeDoc uses an option that glslang no longer supports.
2023-07-20 16:12:44 -06:00
Jeremy Hayes
4f3ae4b03d Update CHANGES for release 12.3.1 2023-07-20 14:53:51 -06:00
Nathaniel Cesario
45ce545ad3 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-07-20 13:59:11 -06:00
David Neto
77417d5c9e Support MinGW build with Clang, not just GCC
Fixes: #3270
2023-07-19 20:02:03 -06:00
Nathaniel Cesario
865fe73958 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-07-19 17:16:37 -06:00
Jeremy Hayes
9b1a0f4d3e Update CHANGES for release 12.3.0 2023-07-19 12:57:07 -06:00
Jeremy Hayes
2af597d1a8 Update known_good.json 2023-07-18 15:29:59 -06:00
Nathaniel Cesario
856e280502 cmake: Rename glslang to glslangValidator
Rename glslangValidator to glslang and adds a glslangValidator symlink
to the build and install directories.

Closes #47.
2023-07-18 15:23:50 -06:00
Juan Ramos
a9a2625416 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-07-18 13:08:33 -06:00
Pedro Olsen Ferreira
9afd346127 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-07-18 12:05:43 -06:00
Dawid-Lorenz-Mobica
d5f3ad6c9a
HLSL: support binary literals
Fixes #3089
2023-07-18 09:35:36 -06:00
Zeqiang Li
9e41635d74
Add missing initialization members for web (#3246) 2023-07-17 17:11:32 -06:00
Malcolm Bechard
6defcb2478 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-07-17 14:42:20 -04:00
Nathaniel Cesario
8a6a311d22 build: Remove bazel build support 2023-07-17 12:17:55 -04:00
Arcady Goldmints-Orlov
f47028995c 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-07-13 18:14:29 -04:00
Joyce
d9a6fb2247
Create a Security Policy (#3169)
* Create SECURITY.md

Signed-off-by: Joyce <joycebrum@google.com>
2023-07-13 13:58:05 -04:00
Dawid Lorenz
44779f508a 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-07-11 13:36:38 -04:00
Dawid Lorenz
4ae01c5f41 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-07-11 13:36:38 -04:00
Rex Xu
051f18c0cc 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-07-11 13:26:22 -04:00
Nathaniel Cesario
eaa7057768 Fix C example in README
Remove the usage of C++ STL types in the C-only interface example.

Fixes #3239.
2023-07-07 16:33:08 -04:00
Arcady Goldmints-Orlov
3ebb72cc74 Add an assert that ID operands are non-zero
Zero is not a valid ID value and the SPIR-V emitter library should never
be emitting instructions with ID values of 0.
2023-06-27 13:49:14 -04:00
Arcady Goldmints-Orlov
d89c0b1d13 Force generateDebugInfo when non-semantic debug info is enabled
From the command line, the debug options "stack", with -gVS enabling all
of generateDebugInfo, emitNonSemanticShaderDebugInfo and
emitNonSemanticShaderDebugSource, however the programmatic interface
allows setting the latter options without the former. In this case, the
string corresponding to the source filename never gets emitted and some
debuginfo instructions end up with zero ID operands, resulting in
invalid SPIR-V.

Fixes #3240
2023-06-27 13:49:14 -04:00
Sven van Haastregt
9575e33186 Fix unused parameter warning in Release builds
The `function` parameter is only used by an assert currently, so mark
it as "maybe unused".  Alternatively the parameter could be removed,
but avoid such API churn for now.
2023-06-21 16:43:18 -04:00
Jason Liu
6a7ec4be7b Fix linking error "ld: unknown option: --no-undefined" on macOS 2023-06-19 14:32:31 -04:00
juan-lunarg
5793fbd624 cmake: Fix CMake 3.27 warnings
The FindPythonInterp and FindPythonLibs modules, which have
been deprecated since CMake 3.12, have been removed by policy
CMP0148. Port projects to FindPython3, FindPython2, or FindPython.
2023-06-16 16:12:26 -04:00
Pablo Delgado Krämer
72713baf74 Fix GL_NV_shader_invocation_reorder #define typo 2023-06-12 13:06:02 -07:00
Sven van Haastregt
4d95e22826 Fix -Wmaybe-uninitialized warnings
Fix some potentially uninitialized uses that are reported by GCC 13
with `-O3`.
2023-06-12 07:52:56 -07:00
David Neto
a6662c53ce ndk-build: test Android API 24
Vulkan was introduced in Android API 24.
Test against that API level.
NDKs drop support for older APIs

Google-internal BUG=285134453
2023-05-31 15:50:03 -04:00
rcombs
b587425025 glslang_c_interface: use valid C function prototypes
Prototypes are required in C.
2023-05-29 14:55:51 -06:00
Rémi Verschelde
48a467b413 CMake: Use set_target_properties instead of set_property
This makes the cmake code a bit cleaner and more consistent.
2023-05-25 14:34:34 -06:00
Arcady Goldmints-Orlov
6f22e41e0d CMake: Make glslang-default-resource-limits STATIC 2023-05-25 14:34:34 -06:00
Allan MacKinnon
9fbc561947
glslangValidator: Exit with an error if output file cannot be written
Propagate the error from glslang::OutputSpv[Hex|Bin] and exit with an error code if there is an error.
2023-05-23 14:07:48 -06:00
Allan MacKinnon
a5bf69936d [glslang] Strip trailing whitespace
There are many other files in the repo that have trailing whitespace
but this PR only cleans `glslang/SPIRV` and `glslang/Standalone`.
2023-05-22 12:04:40 -06:00
Arcady Goldmints-Orlov
e06bd35fea Switch Android.mk to use --std=c++17 2023-05-22 12:01:20 -06:00
Arcady Goldmints-Orlov
4c9cc240e6 Switch Bazel to c++17 2023-05-22 12:01:20 -06:00
Arcady Goldmints-Orlov
9caca7a17b Add decorations to structs with buffer references
The containsPhysicalStorageBufferOrArray function now handles struct
types correctly, checking their contents recursively for buffer
reference types. As a result, OpVariables containing structs that have
members that are buffer references now have the appropriate
AliasedPointer or RestrictPointer decoration as per the spec.

Fixes #3188
2023-05-19 11:35:18 -06:00
Jeremy Hayes
d1517d64cf Update CHANGES for release 12.2.0 2023-05-17 14:47:56 -06:00
Jeremy Hayes
f697b55c92 Update known_good.json 2023-05-16 17:03:00 -06:00
Arcady Goldmints-Orlov
1e4955adbc Include <cstdint> header in Common.h
This change also cleans up some ifdef'd code for no longer supported
versions of MSVC.

Fixes: #3139
2023-05-15 14:06:02 -06:00
Johannes Kauffmann
d9c3c7538b Common.h: don't use to_string workaround on MSVC
Pre-VS2012 is no longer supported.

It might still be needed on Android, I haven't tested this.
2023-05-10 09:55:02 -06:00
Johannes Kauffmann
f202aa665e PP: remove workaround for VS2015 2023-05-10 09:55:02 -06:00
Johannes Kauffmann
e00517acfe SPIRV: remove pre-C++11 workaround 2023-05-10 09:55:02 -06:00
Johannes Kauffmann
076c35863e SPIRV: hex_float: remove workaround for VS2013 2023-05-10 09:55:02 -06:00
Arcady Goldmints-Orlov
14e57abf26 Enable constructor reorder warnings
They no longer happen "all over" as the comment suggests, and downstream
builds have them enabled already.
2023-05-09 14:37:10 -06:00
Ryan Harrison
a02dde76f6 Correct ctor order to make '-Wreorder-ctor' pass
These lines in the ctor being out of order are causing -Wreorder-ctor
to fire when trying to integrate glslang ToT into Chromium/Dawn/etc,
https://logs.chromium.org/logs/dawn/buildbucket/cr-buildbucket/8781562047251466593/+/u/compile_with_ninja/stdout.
2023-05-09 12:39:09 -06:00
Steven Perron
49aad1361e Remove the windows-msvc-2015-release-bazel config
The VS2015 bazel test has been stopped, so we can not remove the config
file. We have the windows-msvc-2019-release-bazel to replace it. It is
already running, and it is passing.
2023-05-09 11:33:42 -06:00
Alexey Ozeritskiy
84d11c472a Use custom callbacks if they are available in 'i->callbacks' 2023-05-09 10:38:08 -06:00