4848 Commits

Author SHA1 Message Date
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
Steven Perron
1397890e8e Add windows-msvc-2019-release-bazel CI config
The `windows-msvc-2015-release-bazel` build config name is misleading.
It now runs VS2019. We should rename it. This is the first part: create
the new config files.
2023-05-09 09:29:29 -06:00
Jeremy Hayes
010019f93b Fix windows-msvc-2015-bazel CI job
The build file is updated to use MSVC 2019 as well as bazel 5.0.0.
2023-05-09 08:31:04 -06:00
janharaldfredriksen-arm
0bbec2e8f6 Add GLSL_EXT_shader_tile_image 2023-05-08 19:49:25 -06:00
juan-lunarg
a3310b7cff ci: Test GCC on MacOS CI
closes #3062
2023-05-05 22:02:16 -06:00
juan-lunarg
9743480f3c cmake: Don't set CMAKE_INSTALL_PREFIX
While trying to set a default for CMAKE_INSTALL_PREFIX sounds
appealing it has multiple issues.

It's particularly problematic for open source projects where
many users try to accomplish many different things.

It's also conflicting with the new way of installing with cmake

IE: `cmake --install build --prefix build/install`

I've already removed similar logic in various other Khronos
repositories a while ago to address similar complaints.

closes #1015
2023-05-05 10:17:32 -06:00
Eric Werness
9d8c7b75c9 GL_EXT_ray_tracing_position_fetch 2023-05-05 09:12:37 -06:00
juan-lunarg
d6e9d3bb4e cmake: Remove USE_CCACHE
This is no longer needed with modern CMake.

I've already removed this from several Khronos repos.

See this stackoverflow for modern approaches to setting ccache via cmake:
https://stackoverflow.com/a/74120112/19739129
2023-05-05 09:11:06 -06:00
juan-lunarg
955f21aad2 cmake: Remove explicitly setting CMAKE_EXPORT_COMPILE_COMMANDS
Modern IDEs / C++ environments will just set this for you.

EX: vscode will set this for you.
2023-05-05 09:11:06 -06:00
Sruthik P
bc6b2bc17a glslang: Do not link with pthread on QNX
On QNX, pthread APIs are provided as part of libc and a separate pthread
library does not exist.

This change updates the makefile of glslang to not link with pthread on
QNX, thereby enabling glslang to be built for QNX platforms.
2023-05-03 09:09:01 -06:00
Chuang Zhu
dfc97740ff Use CMAKE_INSTALL_FULL_LIBDIR in compat cmake files
According to
https://cmake.org/cmake/help/v3.25/module/GNUInstallDirs.html,
CMAKE_INSTALL_LIBDIR can be an absolute path. For instance, Nixpkgs
[defined it to an absolute path in /nix/store](3d17b4c305/pkgs/development/tools/build-managers/cmake/setup-hook.sh (L101)).
The output in this case is:

	# result-glslang/lib/cmake/glslangTargets.cmake:5
	include("${CMAKE_CURRENT_LIST_DIR}/../..//nix/store/3mif2zibig0cilk5dbz334278n0vlq9s-glslang-1.3.231.0/lib/glslang/glslang-targets.cmake")

Signed-off-by: Chuang Zhu <git@chuang.cz>
2023-05-02 15:46:45 -06:00
Brad Smith
9c7fd1a33e Fix building on OpenBSD when building shared libs
OpenBSD does not link shared libs against libc so it is expected
that the use of --no-undefined when linking will fail.

Also garbage collect CMAKE_VERSION check while here, as requested, since
the minimum version is already 3.14.
2023-04-21 20:51:32 -04:00
David Neto
b8955549ef fix error message for vertex struct input
Vertex shaders can have pipeline inputs that are arrays, but not structure
inputs. (GLSL 4.5 section 4.3.4)

But the error message for struct inputs says "cannot be a structure or array".
This PR removes the "or array" part.

Note: The array case is handled immediately after the check for
structure type.

Co-authored-by: Arcady Goldmints-Orlov <arcady@lunarg.com>
2023-04-20 18:25:55 -04:00
Jeremy Hayes
dfdd0ed2ca Delete appveyor configuration
Windows CI is now covered by GitHub actions.
2023-04-20 11:03:54 -06:00
sean
f46f4b192a Fix: Migrate Windows CI to GitHub Actions 2023-04-19 14:51:55 -06:00
Arcady Goldmints-Orlov
68f073b195 Add a test for empty structs in HLSL hull shaders 2023-04-13 09:49:00 -04:00
Try
4142fead74 fix crash in HLSL frontend
fix crash, when converting HLSL return of hull shader into spirv/glsl like arrayed output.

fix #2914
2023-04-13 09:49:00 -04:00
Arcady Goldmints-Orlov
f766ee96f5 Improve help text for the new -P option 2023-04-12 18:24:35 -04:00
Jeremy Hayes
a270fdae55 Fix appveyor build worker image 2023-04-11 13:38:56 -06:00
spencer-lunarg
9fe5223370 Improve error message of alignment offset 2023-04-10 16:21:15 -04:00
Moritz Heinemann
bdba39bae6 Add more preamble tests 2023-04-06 13:38:39 -04:00
Moritz Heinemann
893145ead2 Add option to glslangValidator to inject preamble 2023-04-06 13:38:39 -04:00
Jeremy Hayes
1aefd184a6 Fix DebugCompilationUnit scope
Fix 3167.
2023-04-04 10:56:17 -04:00
Rex Xu
77f7cdfb1e Fix an issue when we merge multiple spirv_decorate_xxx directives
There is a typo.
2023-04-03 18:02:49 -04:00
Rex Xu
8ff8b45131 Parameters of spirv_decorate_id should accept variables
spirv_decorate_id will generate OpDecorateId. The parameter list should
accept variables as part of decorations. This is because OpDecorateId
allows this. The spec says:

  All such <id> Extra Operands must be constant instructions or
  OpVariable instructions.
2023-04-03 18:02:49 -04:00
Arcady Goldmints-Orlov
adcc7e8163 Add tests for conditionals that return a struct value
There are 3 separate tests added to cover the 3 cases in
visitSelection(). With SPIR-V versions prior to 1.4, control flow is
generated, with GLSL generating code to execute only the appropriate
branch of the conditional while HLSL executes both branches and uses the
control flow to select the appropriate one. Finally, with SPIR-V
versions newer than 1.4, OpSelect can be used on structs.

Note that the hlsl.structcopy.comp and hlsl.structcopylogical.comp tests
have identical shader code, but are compiled with different versions of
SPIR-V and result in different codepaths being used and different SPIR-V
generated.
2023-04-03 12:33:59 -04:00
Arcady Goldmints-Orlov
cdb350b356 Fix generation of conditionals with a struct result in SPIR-V
It is possible for the SPIR-V code generator to receive a conditional
where the two branches have the same shader language level type but
different SPIR-V types because of things like offset decorations. This
change modifies visitSelection() to handle this case by using either
multiTypeStore() or, if that is available, OpCopyLogical.

Fixes #3164
2023-04-03 12:33:59 -04:00
Qingyuan Zheng
f8a2442a16 Improve line info for symbol access and assignment 2023-04-01 21:04:46 -06:00
Arcady Goldmints-Orlov
fbabd37aca Remove a redundant condition in an if statement
This was added erroneously in commit 12bc9aa9c.
2023-03-31 19:53:42 -06:00