Commit Graph

4750 Commits

Author SHA1 Message Date
Malcolm Bechard
067f33d239 only use dead input elimination on vertex shaders
It can't be safely used unilaterally on other stages, since that will
result in output/input mismatches between stages. They arn't
having their output variables eliminated accordingly.
2023-12-11 20:03:13 +00:00
James0124
0226373c81 CInterface: Add preamble support.
Add interface for `TShader::setPreamble`.
2023-12-11 20:03:13 +00:00
Eric Werness
6abc9f768f GL_EXT_opacity_micromap 2023-12-11 20:03:13 +00:00
Ralf Habacker
316bb9f17d cmake: Do not install static libraries in shared build mode.
The glslang cmake build system installs static libraries in addition to
the dynamic glslang library, which are required when used in a package
that uses glslang when calling find_package().

Distributions such as openSUSE (and perhaps others) use a "shared only"
strategy, which conflicts with the current state of the glslang build
system.
The static libraries mentioned are already all included in glslang and
thus not needed. With this commit, these will no longer install the
associated cmake support files when glslang is built shared.
2023-12-11 20:03:13 +00:00
Ralf Habacker
5789f5d0f5 cmake: Use common installation directory for cmake support files.
At least on openSUSE, the usual installation location for cmake support
files is ${MAKE_INSTALL_LIBDIR}/cmake/<name>

   $ find /usr/lib64 -name '*.cmake' | grep /cmake/ | wc -l
   834
   $ find /usr/lib64 -name '*.cmake' | grep -v /cmake/ | wc -l
   8

which is also used by glslang with these changes.
2023-12-11 20:03:12 +00:00
Johannes Kauffmann
ed25e50b7d Fix -Wundef warnings for MINGW_HAS_SECURE_API
Since 12e27e17de, it was assumed that the
MINGW_HAS_SECURE_API macro was unconditionally defined. This is not
always the case, and GCC produces -Wundef warnings when that happens.

Fix this, by first checking if MINGW_HAS_SECURE_API is defined, and if
so, also check that it does not evaluate to zero.

As a drive-by, place parentheses around _MSC_VER for consistency.
2023-12-11 20:03:12 +00:00
Pankaj Mistry
4470b29085 Fix for bug #3019 : That incorrectly removed perVertexEXT qualifier as arrayed IO
This bug got introduced as part of EXT_mesh_shader changes 228c672
Also updated barycentric test cases to add coverage for multiple pervertexEXT array inputs
2023-12-11 20:03:12 +00:00
Jeremy Hayes
d3fcb30389 Use DebugDeclare for local variables
Previously we had decided to issue DebugValue directly in glslang.
However, this was incorrect and causing issues with RenderDoc.
2023-12-11 20:03:12 +00:00
Qingyuan Zheng
7015946384 Fix OpLine prepending OpFunction reports wrong file when #line is present 2023-12-11 20:03:12 +00:00
Ricardo Garcia
c6202b20fc Make gl_SubGroupARB a flat int in Vulkan
gl_SubGroupARB was being correctly declared as an Input variable in
Vulkan but it was missing the Flat decoration, which made spirv-val emit
the VUID-StandaloneSpirv-Flat-04744 validation error with shaders using
that built-in.
2023-12-11 20:03:12 +00:00
Malcolm Bechard
86ed5819f3 further updates to 67384dd18b
since we are changing the type before the visitBinary now, we need to be
comparing against the new type.
Previous test cases worked since the 'unitType' was a shallow copy and
ended up getting updated in some cases to match the new type, but not all.
2023-12-11 20:03:12 +00:00
Pankaj Mistry
5c688f77fa Make a utility function for termination instructions that take input operands.
Use the new utility function for generating OpEmitMeshTasksEXT.
2023-12-11 20:03:12 +00:00
Pankaj Mistry
56de853fda Fix for issue #3020
Make OpEmitTMeshasksEXT a terminal instructions
2023-12-11 20:03:12 +00:00
Jeremy Hayes
deb8e38707 Implement NonSemantic.Shader.DebugInfo.100
See https://github.com/KhronosGroup/SPIRV-Registry.
2023-12-11 20:03:12 +00:00
ichordev
04afbb6052 Fixed a small grammatical error 2023-12-11 20:03:12 +00:00
sean
828a040306 Fix: Remove NV suffix from C interface 2023-12-11 20:03:12 +00:00
Pankaj Mistry
ed789649ce GL_EXT_mesh_shader/SPV_EXT_mesh_shader implementation
Added following updates to GL_EXT_mesh_shader implementation:

1. Added SPIRV and GLSL test cases
2. Added checks to ensure NV and EXT mesh shader builtins cannot be used interchangeably.
3. Updated the language name by removing the postfix "NV" to MeshShader and TaskShader.
4. Added checks for grammar checking to comply with the spec.

5. Added gl_NumWorkGroups builtin to Mesh shader
6. Fixed data type of gl_PrimitiveLineIndicesEXT and gl_PrimitiveTriangleIndicesEXT
7. Added new constants to the resources table
8. Updates to handle new storage qualifier "taskPayloadSharedEXT"
9. Updated test cases by replacing "taskEXT" with storage qualifier "taskPayloadSharedEXT"

Addressed  Review comments
1. Fixed instruction description used by glslang disassembly.
2. Updated OpEmitMeshTasksEXT as per spec update
3. Fixed implementation that errors out if there are more then one taskPayloadSharedEXT varjables.
4. Fixed miscellaneous error logs and removed unwanted code.

SPIRV 1.6 related build failure fixes
- Update SPIRV header to 1.6
- Fix conflict wiht SPIRV 1.6 change, where localSizeId is used for execution mode for mesh/task shaders

Enable SPIRV generated for EXT_mesh_shader to be version 1.4

GL_EXT_mesh_shader: Add checks for atomic support and corresponding test cases
2023-12-11 20:03:12 +00:00
Pedro J. Estébanez
91ff31a64e Remove the unused OS_CleanupThreadData 2023-12-11 20:03:12 +00:00
Harlen
557f31d8fe Fix strict aliasing violation 2023-12-11 20:03:12 +00:00
Andrea Pappacoda
a06a94a446 build: install glslang-config.cmake to libdir
As glslang ships architecture dependant files, the Config file should be
installed to libdir, not datadir. See
https://github.com/KhronosGroup/glslang/pull/2989#discussion_r955367103
for more details.

Here's the diff between the install tree before and after this patch:

    $ diff <(tree install-datadir) <(tree install)
    1c1
    < install-datadir
    ---
    > install
    74,99c74,98
    <         ├── lib
    <         │   ├── cmake
    <         │   │   ├── glslang-default-resource-limitsTargets.cmake
    <         │   │   ├── glslangTargets.cmake
    <         │   │   ├── glslangValidatorTargets.cmake
    <         │   │   ├── HLSLTargets.cmake
    <         │   │   ├── OGLCompilerTargets.cmake
    <         │   │   ├── OSDependentTargets.cmake
    <         │   │   ├── spirv-remapTargets.cmake
    <         │   │   ├── SPIRVTargets.cmake
    <         │   │   └── SPVRemapperTargets.cmake
    <         │   ├── libGenericCodeGen.a
    <         │   ├── libglslang.a
    <         │   ├── libglslang-default-resource-limits.a
    <         │   ├── libHLSL.a
    <         │   ├── libMachineIndependent.a
    <         │   ├── libOGLCompiler.a
    <         │   ├── libOSDependent.a
    <         │   ├── libSPIRV.a
    <         │   └── libSPVRemapper.a
    <         └── share
    <             └── glslang
    <                 ├── glslang-config.cmake
    <                 ├── glslang-config-version.cmake
    <                 ├── glslang-targets.cmake
    <                 └── glslang-targets-debug.cmake
    ---
    >         └── lib
    >             ├── cmake
    >             │   ├── glslang-default-resource-limitsTargets.cmake
    >             │   ├── glslangTargets.cmake
    >             │   ├── glslangValidatorTargets.cmake
    >             │   ├── HLSLTargets.cmake
    >             │   ├── OGLCompilerTargets.cmake
    >             │   ├── OSDependentTargets.cmake
    >             │   ├── spirv-remapTargets.cmake
    >             │   ├── SPIRVTargets.cmake
    >             │   └── SPVRemapperTargets.cmake
    >             ├── glslang
    >             │   ├── glslang-config.cmake
    >             │   ├── glslang-config-version.cmake
    >             │   ├── glslang-targets.cmake
    >             │   └── glslang-targets-debug.cmake
    >             ├── libGenericCodeGen.a
    >             ├── libglslang.a
    >             ├── libglslang-default-resource-limits.a
    >             ├── libHLSL.a
    >             ├── libMachineIndependent.a
    >             ├── libOGLCompiler.a
    >             ├── libOSDependent.a
    >             ├── libSPIRV.a
    >             └── libSPVRemapper.a
    101c100
    < 15 directories, 83 files
    ---
    > 14 directories, 83 files
2023-12-11 20:03:12 +00:00
kd-11
b8f9add95a
Merge pull request #3 from kd-11/sdk_224
Sync with SDK ver 224
2022-12-11 01:36:02 +03:00
kd-11
fe192e9b58 Sync with upstream SDK ver 1.3.224.1 2022-12-11 01:33:15 +03:00
Jeremy Hayes
10423ec659
Merge pull request #3000 from jeremy-lunarg/hayes-update-cmake-minimum
Update cmake minimum required version
2022-08-12 11:44:16 -06:00
Jeremy Hayes
56e19ed8ce Update cmake minimum required version 2022-08-12 10:29:31 -06:00
Jeremy Hayes
73c9630da9
Merge pull request #2998 from jeremy-lunarg/hayes-update-changes
Update CHANGES for release 11.11.0
2022-08-12 09:32:10 -06:00
Jeremy Hayes
6079f49dea Update CHANGES for release 11.11.0 2022-08-11 14:09:38 -06:00
Greg Fischer
f771c1293d
Merge pull request #2995 from jeremy-lunarg/hayes-update-known-good
Update known_good.json
2022-08-11 13:47:08 -06:00
Jeremy Hayes
5326d151b2 Update known_good.json 2022-08-10 12:29:15 -06:00
Greg Fischer
adf7bf0113
Merge pull request #2991 from KhronosGroup/revert-2988-build_arm64_binaries_mac
Revert "Fix: Build arm64 binaries for macOS"
2022-08-03 13:22:21 -06:00
Greg Fischer
d8b64c2713
Revert "Fix: Build arm64 binaries for macOS" 2022-08-03 12:39:23 -06:00
Greg Fischer
de0b1bf6d7
Merge pull request #2988 from spnda/build_arm64_binaries_mac
Fix: Build arm64 binaries for macOS
2022-08-03 10:32:34 -06:00
MACHIZAUD Andréa
fb64704060
Add unified glslang CMake config collecting glslang-targets targets (#2989) 2022-08-02 18:16:03 -06:00
David Neto
f28022c9f9
Avoid double-free in functions cloned for vulkan relaxed mode (#2987)
* Avoid double-free in functions cloned for vulkan relaxed mode

When rewriting function calls atomicCounterIncrement and
atoicCounterDecrement, clone the parameters so that the TParameter
'type' field is cloned.  This avoids double-free when both the original
and transformed functions are deleted by the parser.

Fixes a ubsan failure.
2022-08-02 18:07:01 -06:00
sean
b43848f0ca
Fix: Build arm64 binaries for macOS 2022-07-30 06:51:06 +02:00
Greg Fischer
f0ce653a25
Merge pull request #2986 from jeremy-lunarg/hayes-update-macos-runner
Update MacOS runner
2022-07-27 17:39:33 -06:00
Jeremy Hayes
457d11ebd8 Update MacOS runner
Per https://github.com/actions/virtual-environments/issues/5583

Fix #2984
2022-07-27 17:13:36 -06:00
Greg Fischer
22d39cd684
Merge pull request #2977 from AMD-dwang/AMD_shader_early_and_late_fragment_tests
Add SPV_AMD_shader_early_and_late_fragment_tests
2022-07-27 11:23:16 -06:00
Jeremy Hayes
7b75c5dc7d
Merge pull request #2982 from jeremy-lunarg/hayes-remove-tabs
Replace tabs with spaces
2022-07-26 09:05:13 -06:00
Jeremy Hayes
b35ba4f355
Merge pull request #2981 from jeremy-lunarg/hayes-fix-2978
Update release description
2022-07-26 09:04:25 -06:00
Jeremy Hayes
6a2b45c3cd Replace tabs with spaces
This file was accidentally using mixed tabs and spaces.
2022-07-25 17:10:17 -06:00
Jeremy Hayes
738c09e31b Update release description
Fix #2978.
2022-07-25 17:04:26 -06:00
Jeremy Hayes
607771c362
Merge pull request #2979 from spnda/master
Fix #2658: Properly include all headers in deployments
2022-07-25 11:39:28 -06:00
sean
7f784c81e9
Fix: Properly include all headers in deployments 2022-07-25 17:54:20 +02:00
Greg Fischer
6ef2e49216
Merge pull request #2974 from thoave-arm/EOpConstructAccStruct
Make GL_KHR_ray_query provide EOpConstructAccStruct
2022-07-22 10:51:42 -06:00
Thomas Aven
374c124025 Make GL_KHR_ray_query provide EOpConstructAccStruct
Previously, GL_KHR_ray_tracing was a required extension to generate
OpConvertUToAccelerationStructureKHR conversion instructions from uint64
and uvec2. However, both GL_KHR_ray_tracing and GL_KHR_ray_query should
provide this construction.

Change-Id: I6564c127fd28d9b527d334958a5adc168f5cdd9a
2022-07-21 11:00:34 +02:00
dwang102
070863af69 Add SPV_AMD_shader_early_and_late_fragment_tests 2022-07-18 14:20:18 +08:00
Jeremy Hayes
7e6b7c26a2
Merge pull request #2976 from jeremy-lunarg/hayes-fix-2975
Emit Int64Atomics for imageAtomicStore
2022-07-14 18:05:46 -06:00
Jeremy Hayes
8bdc3d4d31 Emit Int64Atomics for imageAtomicStore
This covers a corner case wherein imageAtomicStore is used exclusively.
The proxy type for imageAtomicStore is inferred from the image type.

Fix #2975.
2022-07-14 17:37:52 -06:00
Greg Fischer
68c1880c09
Merge pull request #2973 from haasn/version_macros
Fix version check macros
2022-07-12 10:57:21 -06:00
Niklas Haas
6fdf03e4d1 Fix version check macros
These were defined backwards to the usual convention.

 #if GLSLANG_VERSION_GREATER_THAN(11, 10, 0)

This reads as "if glslang version is greater than 11.10.0" to any
reasonable sane programmer, and should therefore expand to
"glslang_version > macro_argument".

Yet the check it references was actually written as "macro_argument >
glslang_version", thus expressing the completely opposite condition of
"if glslang version is *less than* 11.10.0". This is definitely
backwards and extremely, dangerously surprising behavior to any
programmer familiar with such version macros.

I'm not sure if anybody actually ever used them. I certainly didn't, on
account of them being backwards. I could not find a single reference to
them on GitHub (other than in copies of this header) - every project I
found just used the GLSLANG_VERSION_MAJOR etc. macros directly.
2022-07-12 16:59:22 +02:00