Commit Graph

4679 Commits

Author SHA1 Message Date
sean
37ada218f4 Fix: Migrate Windows CI to GitHub Actions 2023-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
3b33c7a3c2 Add a test for empty structs in HLSL hull shaders 2023-12-11 20:03:15 +00:00
Try
7536f5670b fix crash in HLSL frontend
fix crash, when converting HLSL return of hull shader into spirv/glsl like arrayed output.

fix #2914
2023-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
f36ffb9b0d Improve help text for the new -P option 2023-12-11 20:03:15 +00:00
Jeremy Hayes
7150c2a81a Fix appveyor build worker image 2023-12-11 20:03:15 +00:00
spencer-lunarg
1c2f7a3a4f Improve error message of alignment offset 2023-12-11 20:03:15 +00:00
Moritz Heinemann
f0f119233f Add more preamble tests 2023-12-11 20:03:15 +00:00
Moritz Heinemann
98137dc808 Add option to glslangValidator to inject preamble 2023-12-11 20:03:15 +00:00
Jeremy Hayes
7fafb89266 Fix DebugCompilationUnit scope
Fix 3167.
2023-12-11 20:03:15 +00:00
Rex Xu
68e8d79cad Fix an issue when we merge multiple spirv_decorate_xxx directives
There is a typo.
2023-12-11 20:03:15 +00:00
Rex Xu
cb579ee0d9 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-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
094b567af7 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-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
01dad4e801 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-12-11 20:03:15 +00:00
Qingyuan Zheng
632704e140 Improve line info for symbol access and assignment 2023-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
98e22aaf51 Remove a redundant condition in an if statement
This was added erroneously in commit 12bc9aa9c.
2023-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
571944fd00 Refactor Builder::createTextureCall() to use std::vector
Use a temporary std::vector to accumulate arguments, rather than a
stack-allocated array with a fixed size. This is safer and more
future-proof.
2023-12-11 20:03:15 +00:00
Faith Ekstrand
c7df3b6d65 Add a .mailmap file
This will make my name and e-mail address remap properly in command-line
Git tools.
2023-12-11 20:03:15 +00:00
Moritz Heinemann
f70cee463d Fix CMake for OSDependent install 2023-12-11 20:03:15 +00:00
Arcady Goldmints-Orlov
b47ecbb53c Fix double expansion of macro arguments.
This adds a new fullyExpanded flag that makes sure that macro arguments
only get expanded once. This can happen either in PrescanMacroArg, or, if
there is token pasting or a function-like macro name has been passed as
an argument and may need to be expanded when used as a function.
2023-12-11 20:03:15 +00:00
Jeremy Hayes
02acddd5a7 Update CHANGES for release 12.1.0 2023-12-11 20:03:15 +00:00
Jeremy Hayes
fc5a9f151b Update known_good.json 2023-12-11 20:03:15 +00:00
Nathan Gauër
e2240edc71 kokoro: always chown files after build 2023-12-11 20:03:15 +00:00
Juan Ramos
6a2a5d8f49 cmake: No need to set CMP0048/CMP0054
Now that the minimum is 3.14.0 setting these policies is redundant
2023-12-11 20:03:15 +00:00
Juan Ramos
dae70f7204 cmake: Remove outdated comment 2023-12-11 20:03:15 +00:00
Jeremy Hayes
05212c36f7 Fix outdated cmake conditional
Remove cmake condition. The minimum is 3.14. The condition is no longer
required.

C++17 is now required. Update the landing page.
2023-12-11 20:03:15 +00:00
Joyce
5f580159db Set token permissions to workflows (#3156)
Signed-off-by: Joyce <joycebrum@google.com>
2023-12-11 20:03:15 +00:00
Greg Fischer
1fc6f81b44 Fix installation of resource limits headers
Fixes #3150
2023-12-11 20:03:15 +00:00
Moritz Heinemann
4d1dd71a89 move ResourceLimits from StandAlone to glslang dir (Fix #3064) 2023-12-11 20:03:15 +00:00
Johan Mattsson
2247294c22 Fix potential NULL dereference 2023-12-11 20:03:15 +00:00
Johan Mattsson
4959424f12 Fix potential NULL dereference 2023-12-11 20:03:15 +00:00
Randall C. O'Reilly
0ab71c6180 updated test to test atomic float add and test results 2023-12-11 20:03:15 +00:00
Randall C. O'Reilly
5aa37e39cc change HLSL/hlslParseables.cpp to support InterlockedAdd on F=float types 2023-12-11 20:03:15 +00:00
Jan Engelhardt
b8f0b00b36 build: set SOVERSION on all libraries
Commit fbe9a23baf erroneously
only added SOVERSION to libglslang.so, but none of the others
that are produced.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2023-12-11 20:03:15 +00:00
David Neto
20aded7722 Use the ninja already in the docker build. 2023-12-11 20:03:15 +00:00
David Neto
579686849b kokoro: avoid git permissions issue that GN fails on
In the docker build script that Kokoro runs, the directories
are owned by a different user.  Git complains about that and in the GN
flow GN will error out.
In this docker flow we don't care about that warning, so within
the docker config set a git global option to ignore the issue.
2023-12-11 20:03:15 +00:00
Maciej
9dec5d66ce Add test 2023-12-11 20:03:15 +00:00
Maciej
0afb68fbb8 Block-decorate Vulkan Structs with RuntimeArrays
Fixes KhronosGroup/glslang#2439

When decorating a struct for Vulkan, add [Buffer]Block decoration if the
struct has a RuntimeArray member, as required by VUID-...-04680.
2023-12-11 20:03:15 +00:00
Hans Wennborg
bd1b8f8a5b GLSL: Fix integer overflow warnings in Constant.cpp
New versions of Clang warn:

```
glslang/MachineIndependent/Constant.cpp(216,114):
error: overflow in expression; result is -9223372036854775808 with type 'long long' [-Werror,-Winteger-overflow]
                else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)-0x8000000000000000ll)
                                                                                                                 ^
glslang/MachineIndependent/Constant.cpp(217,61):
error: overflow in expression; result is -9223372036854775808 with type 'long long' [-Werror,-Winteger-overflow]
                    newConstArray[i].setI64Const((long long)-0x8000000000000000ll);
                                                            ^
2 errors generated.
```

Using LLONG_MIN instead avoids the problem. I think it's also more
clear, and the code for EOpMod further down already does this.
2023-12-11 20:03:15 +00:00
rdb
1465a518fc HLSL: Add missing relaxed-precision float/int matrix expansions 2023-12-11 20:03:15 +00:00
Jeremy Hayes
4d9426830f Rename master to main and update news
Update CI and README to reflect rename.
Update News:
    * Notify users of rename.
    * Update minimum required VS compiler to 2019.
    * Remove notice about versioning. This has been completed.
    * Remove notice about SPIRV folder relocation. It has been 2.5 years
    since this occured.
2023-12-11 20:03:15 +00:00
Maciej
d881c507ea Move check if useStorageBuffer needs to be set.
From TParseContext used only by GLSL, to TParseContextBase inherited by both GLSL and HLSL paths.
It caused compilations from HLSL to SPIR-V 1.3+ to use BufferBlock decoration which is no longer valid.
2023-12-11 20:03:14 +00:00
Arcady Goldmints-Orlov
2d537a62b1 Reject non-float inputs/outputs with version < 120
GLSL 1.20 and prior stated that "the attribute qualifier can be used
only with float, floating-point vectors, and matrices" and likewise
for varying.

Fixes: #3111
2023-12-11 20:03:14 +00:00
Amir Masoud Abdol
127aba47ee Replace the deprecated $<CONFIGURATION> with $<CONFIG> 2023-12-11 20:03:14 +00:00
Jeremy Hayes
da0206e706 Update readme with upcoming branch rename 2023-12-11 20:03:14 +00:00
Jeremy Hayes
913b17ac0a Update CHANGES for release 12.0.0 2023-12-11 20:03:14 +00:00
Jeremy Hayes
bcba7dae74 Update known_good.json 2023-12-11 20:03:14 +00:00
Jeremy Hayes
a2b9ca1643 Update appveyor environment
SPIRV-Tools now requires 3.17.2 or higher. The version provided by
Visual Studio 2015 is 3.16.2.
2023-12-11 20:03:14 +00:00
Greg Fischer
254c47f875 Fix crash on bad structure member reference
Fixes #3105
2023-12-11 20:03:14 +00:00
Juan Ramos
532f78d433 build: Remove AMD_EXTENSIONS / NV_EXTENSIONS defines
These defines aren't needed anymore
2023-12-11 20:03:14 +00:00
Daniel Story
17b1314933 Fix issues with MaxDualSourceDrawBuffersEXT 2023-12-11 20:03:14 +00:00