Commit Graph

717 Commits

Author SHA1 Message Date
Aaron Franke
c8274e941e
Make file formatting comply with POSIX and Unix standards
UTF-8, LF, no BOM, and newlines at the end of files
2020-03-21 03:20:25 -04:00
Daniel Koch
db32b243ff Add support for GLSL_EXT_ray_tracing
and SPV_KHR_ray_tracing
2020-03-17 20:42:47 -04:00
John Kessenich
f368dcbb7d SPV headers: Bump up to the latest header.
This contains the base for ray tracing extensions.
2020-03-17 08:00:41 -06:00
Ryan Harrison
56a7e02056
Use strcmp for all of the extended instruction set checks in the disassembler (#2107)
Fixes #2106

* Convert memcmps to strcmps
2020-03-11 01:00:13 -06:00
Jeff Bolz
b57af2f5ad Decorate accesschain operand for nonuniform UBO loads
This is conservative and still also decorates the loaded value.
2020-03-09 14:09:41 -05:00
Jeff Bolz
39ffdaf2ab Allow nonuniformEXT() on sampler types.
Also add missing NonUniformEXT decoration on OpImageTexelPointer.
2020-03-09 10:48:12 -05:00
Jeff Bolz
04d73731de GL_EXT_debug_printf implementation 2020-03-05 13:41:34 -06:00
John Kessenich
8985fc9108 Fix long lines in the SPIR-V generator, retrigger bots. 2020-03-03 10:25:07 -07:00
John Kessenich
bbbd9a2a1f Fix #1843: Handle built-in function output parameters to a swizzled arg
In GLSL/HLSL/AST,  v.zyx is an l-value, but not in SPIR-V, which cannot represent it.
So, a temporary is used instead.
2020-03-03 07:21:37 -07:00
John Kessenich
56364b6b60 Copyright update, mostly to trigger bots again. 2020-03-01 04:51:40 -07:00
John Kessenich
9606a5cb99 Fix #1461: set the SPIRV-Tools' optimizer's target environment. 2020-02-28 07:10:59 -07:00
Rex Xu
fb18b6df28 Fix an issue of SPV generation for imageAtomicStore.
For GLSL function imageAtomicStore, it will be translated to
OpImageTexelPointer + OpAtomicStore. The result type of
OpImageTexelPointer must be the same as the sampled type of OpTypeImage.
On translation, the result type is mistakenly fetched from operand list
operands[2] while operands[2] corresponds to sampleNum whose type is
always uint. This leads to an error if the image type is iimageXXX that is
int image.
2020-02-22 22:04:31 +08:00
John Kessenich
d5f2f7b93d
Merge pull request #1940 from tsuoranta/fix-gcc9
Fix for GCC 9 / Werror=deprecated-copy
2020-01-27 01:02:08 -07:00
John Kessenich
c3bb5d6914 Update to latest SPIRV-Tools, supporting Vulkan 1.2. 2020-01-15 09:35:48 -07:00
John Kessenich
273d3a5093 SPV/Vulkan: Add support for Vulkan 1.2, which defaults to SPIR-V 1.5. 2020-01-15 00:10:41 -07:00
Roy
05a5b53208 Fix glslang can't link multiple AST in a single stage
Root cause:
GlslangToSpv use symbol structure's ptr as a map key, but multiple shader object can build a new AST.
In the AST the the same symbol has different ptr point to their structure, so indext map faild.

solution:
Add a new map glslangTypeToIdMap to map ptr to symbol id, and use symbol id to index memberRemapper.
2020-01-03 16:30:37 +08:00
John Kessenich
5de15a256e HLSL: Fix #2037: Integer dot used incorrect input for adds. 2019-12-26 10:56:54 -07:00
John Kessenich
b5d9dee710 Fix #2007: Fix a couple relative header paths in header files. 2019-12-09 03:12:10 -07:00
Ian Romanick
b3bd402c7c INTEL_shader_integer_functions2: Add SPIR-V generation
v2: Move addCapability and addExtension extension calls from
TGlslangToSpvTraverser::createBinaryOperation to
TGlslangToSpvTraverser::visitAggregate.  Suggested by JohnK.
2019-12-03 11:06:41 -08:00
John Kessenich
e01c847a70 Merge branch 'dj2-install' 2019-11-22 06:24:38 -07:00
Dan Sinclair
04567eb232 Check for ENABLE_SPVREMAPPER flag in CMakeList files.
There is a flag to disable the SPVRemapper during the GLSLang build.
That flag is check in some, but not all spots so if you try to build
with SPVRemapper disabled you get CMake errors and compile errors.

This CL fixs up the build so building with -DENABLE_SPVREMAPPER=0 will
complete correclty.
2019-11-21 10:33:32 -05:00
Arfrever Frehtes Taifersar Arahesis
bd69a4fb12 Respect CMAKE_INSTALL_LIBDIR in installed CMake files
Fixes #1965
2019-11-18 11:11:55 -08:00
David Neto
e43e8ba9f3 SPIR-V postprocessing: WEB case only needs CFG mods
The SPIR-V post-processing to discover capabilities and
extensions does not apply to WebGPU compilation.  So don't include
that code.

This reclaims some of the code space added by #1943
2019-11-07 17:55:22 -05:00
John Kessenich
199d115e15 Fix #1959 by reverting 7b0e236 to put files in two places. 2019-11-05 18:05:42 -07:00
Ryan Harrison
0552c0acc8 Remove std::move that is breaking chromium roll
This is causing the following error:

moving a temporary object prevents copy elision
[-Werror,-Wpessimizing-move]
2019-11-04 16:23:11 -05:00
John Kessenich
31c3370d83 Bump up the generator version, which is exposed in SPV test results. 2019-11-02 21:26:40 -06:00
David Neto
8c3d5b4b6c SPIR-V: Aggressively prune unreachable merge, continue target
More aggressively prune unreachable code as follows.
When no control flow edges reach a merge block or continue target:
- delete their contents so that:
  - a merge block becomes OpLabel, then OpUnreachable
  - a continue target becomes OpLabel, then an OpBranch back to the
    loop header
- any basic block which is dominated by such a merge block or continue
  target is removed as well.
- decorations targeting the removed instructions are removed.

Enables the SPIR-V builder post-processing step the GLSLANG_WEB case.
2019-10-29 15:33:54 -04:00
Greg Fischer
b44dac1968 Update spirv-tools known good. 2019-10-24 10:37:01 -06:00
John Kessenich
f8d1d7442b Web: Reclaim more space and make all work w/wo GLSLANG_WEB. 2019-10-23 03:15:55 -06:00
John Kessenich
e5eee8fb03 Web: Add basic atomics for SSBOs. 2019-10-23 00:25:39 -06:00
John Kessenich
3dd1ce5b54 Web: Add SSBOs and a few other missing compute features. 2019-10-23 00:25:39 -06:00
John Kessenich
51ed01c877 Web: Add compute stage. 2019-10-23 00:25:39 -06:00
Timo Suoranta
f0a85fc744 Fixes for gcc 9 / -Werror=deprecated-copy
Also enable -Werror-deprecated-copy for GCC version 9 and later.
2019-10-19 15:36:34 +03:00
Jeff Bolz
016ddee83a Only apply volatile semantics to atomics when using Vulkan Memory Model 2019-10-17 11:22:57 -05:00
John Kessenich
b03e4fc4e0
Merge pull request #1866 from rumblehhh/master
Export glslang targets on installation
2019-10-15 04:25:20 -06:00
Ryan Harrison
7c9accb653 Remove unnecessary semi-colons and add warning about them
These are causing integration issues with Chromium down stream since
it is more strict about these.
2019-10-11 11:25:04 -04:00
John Kessenich
ee8e9c1522 Fix #1924: Promote SPV_EXT_physical_storage_buffer to KHR when required.
If the semantics that require the KHR form over the EXT form are seen
(OpBitcast between a vector and a pointer) promote the requested extension
from the EXT to the KHR.
2019-10-10 20:54:21 -06:00
John Kessenich
1ff0c181bb Fix #1924: Emit SPV_EXT_physical_storage_buffer, not the KHR form.
The KHR form comes along as part of 1.5, and otherwise should require
another form of request to emit it.
2019-10-10 12:01:13 -06:00
dan sinclair
78ba2510b8 single line 2019-10-06 10:00:37 -04:00
dan sinclair
7b0e236325 Move install directory for SPIRV/ folder.
Currently the SPIRV/ folder will get installed into the include
directory. This folder is part of GLSLang, so it makes more sense under
glslang/SPIRV.

Currently, GLSLang will install a SPIRV/ folder while spirv-headers will
install a spirv/ folder. This is confusing and will cause issues on a
case sensitive filesystem if both are installed at the same time.
2019-10-03 19:35:44 -04:00
John Kessenich
90e402f42b SPV_KHR_physical_storage_buffer/SPV: Add GL_EXT_buffer_reference_uvec2
Adds uvec2 <-> reference constructor support.
Switches from EXT to KHR for physical_storage_buffer.
2019-09-18 23:52:36 -06:00
John Kessenich
e4e56bcf86
Merge pull request #1902 from jeffbolznv/extended_types
Add GL_EXT_shader_subgroup_extended_types support
2019-09-17 23:18:20 -06:00
Jeff Bolz
c5b669e04c Add GL_EXT_shader_subgroup_extended_types support 2019-09-17 23:44:27 -05:00
John Kessenich
8317e6c683 SPV: Support SPIR-V 1.5; five extensions no longer need OpExtension.
The generalization to addIncorporatedExtension() also fixed a 1.3
corner case with SPV_KHR_16bit_storage.
2019-09-16 07:14:10 -06:00
John Kessenich
aaff6cddd0 SPV 1.5: Switch to the 1.5 header, for SPIR-V 1.5. 2019-09-13 09:32:00 -06:00
Jeff Bolz
387657e4cf GL_NV_integer_cooperative_matrix support 2019-08-22 20:37:59 -05:00
John Kessenich
deec1933e9 Web: Turn off includes, independent preprocessing path, fine tune all.
Saved about 21K, size down to 380K of MSVC x86 code.
Fixed one bug that needs to be looked at on the master branch:
The test for needing a Vulkan binding has a bug in it, "!layoutAttachment"
which does not mean "no layoutAttachment", because that is non-zero.
This is why some test and test results changed.
2019-08-20 23:21:56 -06:00
John Kessenich
b9197c812e Web: Make switched methods all be non-virtual, more web-dependent code,
added a few more HLSL flag tests.  This was mostly focused on the SPV generator.
Saves about 17K.
2019-08-20 23:21:56 -06:00
John Kessenich
fb4f2333da Web: Use isEsProfile() instead of run-time testing; remove more atomics
Saves 2.5K, and design is better.
2019-08-20 23:21:56 -06:00
John Kessenich
155d351f86 Web: Remove unused stage functionality, SPIR-V logger, and hex_utils
Saves another 20K.
2019-08-20 23:21:56 -06:00