Commit Graph

4853 Commits

Author SHA1 Message Date
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
Arcady Goldmints-Orlov
2aca6d419c 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-03-31 19:53:42 -06:00
Faith Ekstrand
45405e1d94 Add a .mailmap file
This will make my name and e-mail address remap properly in command-line
Git tools.
2023-03-25 12:26:55 -04:00
Moritz Heinemann
1db9cd2854 Fix CMake for OSDependent install 2023-03-24 16:31:40 -04:00
Arcady Goldmints-Orlov
c43008e829 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-03-23 17:45:57 -04:00
Jeremy Hayes
14e5a04e70 Update CHANGES for release 12.1.0 2023-03-21 16:20:54 -06:00
Jeremy Hayes
59abdcf912 Update known_good.json 2023-03-21 15:38:26 -06:00
Nathan Gauër
b34f619e1c kokoro: always chown files after build 2023-03-17 12:53:47 -06:00
Juan Ramos
ef77cf3a92 cmake: No need to set CMP0048/CMP0054
Now that the minimum is 3.14.0 setting these policies is redundant
2023-03-16 10:41:39 -06:00
Juan Ramos
43978b7c96 cmake: Remove outdated comment 2023-03-16 10:41:39 -06:00
Jeremy Hayes
0094e47972 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-03-16 10:05:58 -06:00
Joyce
cd2082e058
Set token permissions to workflows (#3156)
Signed-off-by: Joyce <joycebrum@google.com>
2023-03-08 11:27:09 -05:00
Greg Fischer
204812694c
Merge pull request #3153 from greg-lunarg/i3150
Fix installation of resource limits headers
2023-03-03 16:08:30 -07:00
Greg Fischer
aae2a7ae08 Fix installation of resource limits headers
Fixes #3150
2023-03-03 15:17:03 -07:00
Greg Fischer
2ca0ee3ba4
Merge pull request #3137 from moritz-h/resource-limits
Move ResourceLimits from StandAlone to glslang dir
2023-03-02 11:43:06 -07:00
Johan Mattsson
9cdfc5a511 Fix potential NULL dereference 2023-02-20 18:31:34 -05:00
Johan Mattsson
c64c98267c Fix potential NULL dereference 2023-02-20 17:33:15 -05:00
Moritz Heinemann
f5fa593143 move ResourceLimits from StandAlone to glslang dir (Fix #3064) 2023-02-15 20:06:26 +01:00
Randall C. O'Reilly
6d41bb9c55 updated test to test atomic float add and test results 2023-02-08 13:28:52 -07:00
Randall C. O'Reilly
ae55d83a88 change HLSL/hlslParseables.cpp to support InterlockedAdd on F=float types 2023-02-08 13:28:52 -07:00
Jan Engelhardt
4386679bcd 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-02-03 15:19:35 -07:00
David Neto
d62ef8a20a Use the ninja already in the docker build. 2023-02-02 16:34:01 -07:00
David Neto
8329d4a44b 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-02-02 16:34:01 -07:00
Maciej
d604f26843 Add test 2023-02-02 16:33:32 -07:00
Maciej
95ad533eb0 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-02-02 16:33:32 -07:00
Hans Wennborg
7341a21b34 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-02-02 11:20:54 -07:00
rdb
5137ce1a95 HLSL: Add missing relaxed-precision float/int matrix expansions 2023-02-02 11:14:33 -07:00
Jeremy Hayes
58d302cfa2 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-01-30 15:31:05 -07:00
Maciej
4e9cde50bb 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-01-23 12:49:48 -07:00
Arcady Goldmints-Orlov
0d3211ff7b 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-01-20 17:45:18 -07:00
Amir Masoud Abdol
8504d5ae1c Replace the deprecated $<CONFIGURATION> with $<CONFIG> 2023-01-20 10:27:13 -07:00
Jeremy Hayes
51813b65e9 Update readme with upcoming branch rename 2023-01-20 09:34:34 -07:00
Jeremy Hayes
ca8d07d0bc Update CHANGES for release 12.0.0 2023-01-19 09:57:51 -07:00
Jeremy Hayes
615741f278 Update known_good.json 2023-01-18 14:59:26 -07:00
Jeremy Hayes
42e94ee67e Update appveyor environment
SPIRV-Tools now requires 3.17.2 or higher. The version provided by
Visual Studio 2015 is 3.16.2.
2023-01-18 13:57:06 -07:00
Greg Fischer
1fb2f1d789
Merge pull request #3108 from greg-lunarg/i3105
Fix crash on bad structure member reference
2023-01-11 18:39:49 -07:00
Greg Fischer
9b67d41b85 Fix crash on bad structure member reference
Fixes #3105
2023-01-11 16:53:39 -07:00
Juan Ramos
06a7078ce7 build: Remove AMD_EXTENSIONS / NV_EXTENSIONS defines
These defines aren't needed anymore
2023-01-05 09:51:53 -07:00
Greg Fischer
1d978158de
Merge pull request #3100 from daniel-story/fix-dual-src-draw-buffers
Fix issues with MaxDualSourceDrawBuffersEXT
2022-12-29 12:09:46 -07:00
Greg Fischer
d1fc064e79
Merge pull request #3102 from jeremy-lunarg/hayes-fix-debuginfo-disassembly
Fix debuginfo disassembly
2022-12-26 13:30:34 -07:00
Jeremy Hayes
d38d06c03f Fix debuginfo disassembly 2022-12-22 15:43:03 -07:00
Greg Fischer
68935bc2c6
Merge pull request #3099 from jeremy-lunarg/hayes-fix-issue-3095
Fix const parameter debug types
2022-12-22 10:03:12 -07:00
Jeremy Hayes
bec8359bf7 Fix const parameter debug types
Constant qualified parameter types were not being correctly added to
the DebugTypeFunction instruction.

Fix #3095.
2022-12-21 14:20:44 -07:00
Daniel Story
a88f674124 Fix issues with MaxDualSourceDrawBuffersEXT 2022-12-21 11:53:50 -08:00
Jeremy Hayes
dcae187376 Remove languages from cmake project statement
Fix #3088
2022-12-20 09:33:05 -07:00
Chow
f9b760e6c7
[glslang] Refine implicit array size interfaces. (#3074)
* [glslang] Refine implicit array size interfaces.

Help to check builtin and other variables if across stages.
2022-12-13 11:20:28 -07:00