Commit Graph

5087 Commits

Author SHA1 Message Date
Arcady Goldmints-Orlov
3ba8cad6ed Add setSourceFile and addSourceText to TShader
These are now accessible through the C++ ShaderLang.h public API as well
as the C API.
2024-08-12 08:48:23 -06:00
dTry
7c4d91e781
Add type checks for hitObjectNV (#3689)
`VK_NV_ray_tracing_invocation_reorder` extension introduces `hitObjectNV`, a special opaque type
that can only be declared without storage qualifiers in either global or function scope.
Added checks/tests to enforce this constraint.

References:
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_ray_tracing_invocation_reorder.html
3e0d9a3b3f/extensions/nv/GLSL_NV_shader_invocation_reorder.txt (L180)

Co-authored-by: Tianyun <tianyuny@nvidia.com>
2024-08-08 08:21:00 -06:00
Arcady Goldmints-Orlov
5398d55e33 Remove execute permissions from source files. 2024-08-06 14:42:01 -06:00
Arcady Goldmints-Orlov
015cb4ce5c Fix initialization of arrays in TGlslIoMapper
The inVarMaps, outVarMaps, uniformVarMap, and intermediates arrays were
being memset with a size 1 bigger than their actual size. They are now
initialized correctly, which also allows making inVarMaps, outVarMaps,
and uniformVarMap into private members.
2024-08-06 13:36:21 -06:00
Arcady Goldmints-Orlov
b618604e77 Add MachineIndependent/iomapper.h to the list of installed headers. 2024-08-06 13:36:21 -06:00
Arcady Goldmints-Orlov
31584ef79d Clean up iomapper.h to make it suitable as a public API
Remove the dependency on LiveTraverser.h, which transitively includes
localintermediate.h. As a result, some things have been moved from
iomapper.h to iomapper.cpp, specifically the TVarEntry type and the
constructor and destructor of TGlslIoMapper.
2024-08-06 13:36:21 -06:00
dependabot[bot]
71c24c1e4b Bump actions/upload-artifact from 4.3.4 to 4.3.5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.4 to 4.3.5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b2256b8c0...89ef406dd8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 09:59:45 -06:00
Sergei Trofimovich
e40c14a3e0 SPIRV/SpvBuilder.h: add missing <cstdint> include
Without the change `glslang` build fails on upcoming `gcc-15` as:

    In file included from /build/source/SPIRV/GlslangToSpv.cpp:45:
    SPIRV/SpvBuilder.h:248:30: error: 'uint32_t' has not been declared
      248 |     Id makeDebugLexicalBlock(uint32_t line);
          |                              ^~~~~~~~
2024-08-02 17:00:44 -06:00
Arcady Goldmints-Orlov
11290021b7 ci: Add a list of known validation fails
Add a Test/baseResults/validation_fails.txt file to track test results
with known validation fails. This will hopefully make it easier to spot
when new test results are added that have invalid SPIR-V.
2024-08-02 16:47:35 -06:00
ravi688
48154f1766 Update comment to more succint that 8/16-bit composites can't be directly constructed
Earlier the comment looked misleading that composites of 8/16-bit types can't be constructed at all.
As per the GL_EXT_shader_16bit_storage extension, they can't be constructed directly, however, can be constructed indirectly.
2024-08-02 14:33:45 -06:00
Malcolm Bechard
8590f62c14 add optimizerAllowExpandedIDBound to SpvOptions
This option increases the max_id_bound in the optimizer to 0x3FFFFFFF, and then runs a
compact-id pass if the final result has a max_id greater than the standard limit of 0x3FFFFF.
2024-07-30 21:49:42 -04:00
Arcady Goldmints-Orlov
7e896697dc Add SPIRV/SpvTools.h back to the public headers
Clean up the includes in SpvTools.h so that it doesn't require any
transitive dependencies and add it back to the headers that get
installed.
2024-07-30 19:07:19 -04:00
Malcolm Bechard
69249e46b6 add cross-stage check for missing outputs
If an 'in' is present in a shader stage, make sure a matching 'out'
is present in the previous stage. Only enabled when doing Vulkan.

This commit also fixes a bug where previous stage's linkerObjects
got polluted with 'in' variables from the next stage when merging
linker objects.
2024-07-29 19:37:59 -04:00
dependabot[bot]
6a28e226c7 Bump github/codeql-action from 3.25.13 to 3.25.15
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.13 to 3.25.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2d790406f5...afb54ba388)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 19:24:48 -04:00
Pavel Asyutchenko
9f34b25f30 Fix HLSL offsets for non-cbuffers (#3668) 2024-07-29 19:24:33 -04:00
dependabot[bot]
4b73607b89 Bump ossf/scorecard-action from 2.3.3 to 2.4.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](dc50aa9510...62b2cac7ed)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 16:27:51 -04:00
Steve Urquhart
3c7b12c643 Add C interface types and functions for IO mapping 2024-07-24 18:46:04 -04:00
Steve Urquhart
10a923f740 Add C interface function to set preprocessed shader code 2024-07-24 18:46:04 -04:00
Steve Urquhart
42260d1f6d Add C interface glslang::Version counterpart and version getter function 2024-07-24 18:46:04 -04:00
Yamamoto Kazunari
ebbd65501d Fix missing calls to SetThreadPoolAllocator() in TProgram public interface functions 2024-07-24 18:30:51 -04:00
Andrei Alexeyev
bedbe7481e Expose setGlobalUniform* methods to the C API 2024-07-23 18:26:25 -04:00
dependabot[bot]
f7f15cf67c Bump github/codeql-action from 3.25.12 to 3.25.13
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.12 to 3.25.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4fa2a79536...2d790406f5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-23 11:36:05 -04:00
dependabot[bot]
ab670d444b Bump lukka/get-cmake from 3.30.0 to 3.30.1
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 3.30.0 to 3.30.1.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](983956e4a5...34181361be)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-23 11:35:36 -04:00
Arcady Goldmints-Orlov
592aed9c20 Don't emit debug instructions before an OpPhi
Nonsemantic instructions aren't allowed before an OpPhi, so don't emit
line and debug scope instructions when the instruction being emitted is
an OpPhi.
2024-07-22 17:43:12 -04:00
Arcady Goldmints-Orlov
74d448cc15 Add some comments and rename a helper function
This adds some documentation of the checkTypes() function to make
clearer what exactly it is checking.
2024-07-22 17:42:46 -04:00
Antoine
dc9f6f61ad
Add column to location logs
This option can be enabled using the new --error-column option to the command line utility.
It can also be enabled programatically.
2024-07-19 18:37:58 -04:00
jimihem
52f68dc6b2
Add more location aliasing checks
When location aliasing, the aliases sharing the location must have the same underlying numerical type and bit width (floating-point or integer, 32-bit versus 64-bit, etc.) and the same auxiliary storage and interpolation qualification.
This adds checks for the "patch" and "sample" qualifiers, and also relaxes the checks when the signedness of integer types differs.
2024-07-17 18:23:38 -04:00
arcady-lunarg
48eaea60b8
Fix undefined behaviors caught by ubsan
This fixes a couple of integer overflows in parsing as well as removes
the construction of a null reference that never got dereferenced.
This also initializes the bool members in TCall
Finally, this adds a UBSAN run alongside ASAN and TSAN in CI.
2024-07-15 19:10:42 -04:00
jimihem
702026e3f5
Support constant expression calculated by matrixCompMult. 2024-07-15 14:24:16 -04:00
dependabot[bot]
fb7a681cab Bump github/codeql-action from 3.25.11 to 3.25.12
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b611370bb5...4fa2a79536)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 13:23:09 -04:00
dependabot[bot]
4b3170d731 Bump actions/setup-python from 5.1.0 to 5.1.1
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](82c7e631bb...39cd14951b)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 13:22:33 -04:00
Malcolm Bechard
ba5c010c59 fix crash when atomicCounter() with no args is used. 2024-07-12 11:30:49 -04:00
dependabot[bot]
42d9adf50b Bump lukka/get-cmake from 3.29.6 to 3.30.0
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 3.29.6 to 3.30.0.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](2bcb1a4c14...983956e4a5)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 11:18:26 -04:00
Arcady Goldmints-Orlov
5ec1a8d0b5 Update macOS requirement from 11 to 12 in github CD workflow 2024-07-08 18:49:30 -04:00
dependabot[bot]
fae2f0ada8 Bump actions/upload-artifact from 4.3.3 to 4.3.4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...0b2256b8c0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 17:08:05 -04:00
David Neto
4a516f28a1 kokoro: use Python 3.12 for Linux builds
Bug: crbug.com/350048185
2024-07-05 17:36:16 -04:00
friendlyanon
f9fbc91d4f Fix glslangValidator installation
This caused the glslang[tools] vcpkg feature to not install properly,
because the glslangValidator executable didn't exist for tool
installation.
2024-07-05 13:17:03 -04:00
Mason Remaley
5939e32b87 Fixes undefined behavior due to unspecified enum backing
In C++, enums can only represent "in range" values. If the backing
type is not specified, then the result of using bitwise negation on
an enum is not gaurenteed to be in range, resulting in UB.

This was caught by UBSAN, stack trace is as follows:

0.  0x000000000426e391 in spv::operator& (a=spv::MemoryAccessMaskNone,
    b=(spv::MemoryAccessVolatileMask | spv::MemoryAccessAlignedMask | spv::MemoryAccessNontemporalMask | spv::MemoryAccessMakePointerVisibleMask | spv::MemoryAccessNonPrivatePointerMask | spv::MemoryAccessAliasScopeINTELMaskMask | spv::MemoryAccessNoAliasINTELMaskMask | unknown: 0xfffcffc0)) at SPIRV/spirv.hpp:2804
1.  0x00000000041e81e0 in (anonymous namespace)::TGlslangToSpvTraverser::accessChainLoad (this=0x7fffffffcbb8, type=...) at SPIRV/GlslangToSpv.cpp:5127
2.  0x00000000041bc059 in (anonymous namespace)::TGlslangToSpvTraverser::visitBinary (this=0x7fffffffcbb8, node=0x5f6a6c8) at SPIRV/GlslangToSpv.cpp:2192
3.  0x0000000003db8660 in glslang::TIntermBinary::traverse (this=0x5f6a6c8, it=0x7fffffffcbb8) at glslang/glslang/MachineIndependent/IntermTraverse.cpp:92
4.  0x0000000003db952e in glslang::TIntermAggregate::traverse (this=0x5f6a7d8, it=0x7fffffffcbb8) at glslang/glslang/MachineIndependent/IntermTraverse.cpp:175
5.  0x00000000042082db in (anonymous namespace)::TGlslangToSpvTraverser::makeGlobalInitializers (this=0x7fffffffcbb8, initializers=...) at SPIRV/GlslangToSpv.cpp:5618
6.  0x00000000041c511f in (anonymous namespace)::TGlslangToSpvTraverser::visitAggregate (this=0x7fffffffcbb8, visit=glslang::EvPreVisit, node=0x5f6a9b8) at SPIRV/GlslangToSpv.cpp:2907
7.  0x0000000003db8fb9 in glslang::TIntermAggregate::traverse (this=0x5f6a9b8, it=0x7fffffffcbb8) at glslang/glslang/MachineIndependent/IntermTraverse.cpp:159
8.  0x00000000041acc04 in glslang::GlslangToSpv (intermediate=..., spirv=..., logger=0x7fffffffdc38, options=0x7fffffffdc2f) at SPIRV/GlslangToSpv.cpp:10398
9.  0x0000000003bfd6f1 in CompileAndLinkShaderUnits (compUnits=...) at StandAlone/StandAlone.cpp:1547
10. 0x0000000003bfe2f8 in CompileAndLinkShaderFiles (Worklist=...) at StandAlone/StandAlone.cpp:1640
11. 0x0000000003bfec2c in singleMain () at StandAlone/StandAlone.cpp:1713
12. 0x0000000003bff4dd in main (argc=5, argv=0x7fffffffe3d8) at StandAlone/StandAlone.cpp:1767
2024-07-03 15:59:55 -04:00
Qingyuan Zheng
704107fda3 Fix function call line number for calls spanning multiple lines. 2024-07-02 14:38:40 -04:00
Qingyuan Zheng
85262fb20e Fill correct file name to OpDebugFunction and add line info for parameters' OpDebugDeclare 2024-07-02 14:23:59 -04:00
dependabot[bot]
8a5086efb0 Bump github/codeql-action from 3.25.10 to 3.25.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.10 to 3.25.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](23acc5c183...b611370bb5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 14:19:02 -04:00
Steven Perron
33c7e30860
Don't emit duplicate decorations. (#3635)
It is invalid if the same decoration is applied to the same id multiple
times. This adds a check before adding a decoration that the decoration
is not already in the list. If it is, then the duplicate is not added.

Fixes #3627
2024-06-28 19:16:59 -04:00
Antoine
7c40de7aa2 Auto-detect WASI platform 2024-06-28 11:00:54 -04:00
Antoine
20490a11aa Adding the preprocessor value DISABLE_THREAD_SUPPORT to allow compilation of glslang without thread support for WASI. 2024-06-28 11:00:54 -04:00
dependabot[bot]
ea087ff90d Bump lukka/get-cmake from 3.29.5 to 3.29.6
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 3.29.5 to 3.29.6.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](18d87816d1...2bcb1a4c14)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-26 13:18:45 -04:00
Jeremy Hayes
fa9c3deb49 Update CHANGES for 14.3.0 2024-06-25 18:42:43 -04:00
Jeremy Hayes
0d6be86cf1 Update known_good.json 2024-06-25 13:59:16 -04:00
Arcady Goldmints-Orlov
0c15a28c94 refactor: Make type component/constituent counts unsigned
A type can't have a negative number of constituents, components, rows,
or columns. Therefore, the utility functions to query said information
on types and values should return unsigned int rather than int.
2024-06-24 13:52:56 -04:00
Arcady Goldmints-Orlov
33d517470e Generate vector constructions more efficiently when sizes match
When two vectors are the same size, there is no need to extract the
components and construct a new vector.
2024-06-24 13:52:56 -04:00
Arcady Goldmints-Orlov
2d8b71fc63 Add test cases for redundant type conversions
These redundant type conversions were generating illegal SPIR-V when
only the 8-bit/16-bit storage extensions and not the corresponding
arithmetic extensions were enabled.
2024-06-20 20:12:29 -04:00