Commit Graph

754 Commits

Author SHA1 Message Date
Ben Clayton
cb261e3c21 License headers: s/Google/The Khronos Group
This was a copy-paste screwup, where the first line of the copyright had the company name was updated, but the company name mid way though was not.
2020-07-03 12:21:01 +01:00
Ben Clayton
1d21270ebf Add missing copyright headers
Add copyright headers to build files and scripts.
Simplifies automated scanning for bad license headers.
2020-07-02 16:03:48 +01:00
John Kessenich
8d3f3b7dac
Merge pull request #2302 from KhronosGroup/fix-texture-precision
SPV: RelaxedPrecision: use the result precision for texture sampling.
2020-06-30 12:41:15 -06:00
John Kessenich
d5b5215a88
Merge pull request #2300 from KhronosGroup/generalize-precision
SPV: RelaxedPrecision: Generalize fix #2293 to cover more operations.
2020-06-30 10:57:16 -06:00
Ben Clayton
b8c3386ec0 CMake: break up glslang into smaller static libs
Add `GenericCodeGen` and `MachineIndependent` static library targets.
Privately import both of these into the `glslang` target.
Privately import `MachineIndependent` into the  `SPIRV` target.

This is done to break the dependency of `libglslang.so` non-public APIs from `libspirv.so`,
which will become problematic once `glslang` hides its non-public symbols.

| File                      | Before     |     After  |
|---------------------------|-----------:|-----------:|
| `libGenericCodeGen.a`     |  -         |   `527716` |
| `libglslang.a`            | `68175944` |   `512938` |
| `libHLSL.a`               |     `1428` |     `1428` |
| `libMachineIndependent.a` |  -         | `67132202` |
| `libOGLCompiler.a`        |    `75908` |    `75908` |
| `libOSDependent.a`        |    `23768` |    `23768` |
| `libSPIRV.a`              | `15710210` | `15710210` |
| `libSPVRemapper.a`        |  `3250894` |  `3250894` |

| File                                    | Before     |     After  |
|-----------------------------------------|-----------:|-----------:|
| `libglslang-default-resource-limits.so` |   `117032` |   `117032` |
| `libglslang.so`                         | `22380688` | `22368216` |
| `libHLSL.so`                            |     `7520` |     `7520` |
| `libOGLCompiler.a`                      |    `75908` |    `75908` |
| `libOSDependent.a`                      |    `23768` |    `23768` |
| `libSPIRV.so`                           |  `7288336` | `28151016` |
| `libSPVRemapper.so`                     |  `1940208` |  `1940208` |

Issues: #2283, #1484
2020-06-30 14:57:40 +01:00
John Kessenich
12c155f303 SPV: RelaxedPrecision: use the result precision for texture sampling.
Fix #2298.

The AST has two precisions, an operation precision and a result precision.
Actual use of GLSL with mediump samplers wants the result precision, so
pick that up instead of the operation precision.
2020-06-30 07:52:05 -06:00
John Kessenich
435dd8028b SPV: RelaxedPrecision: Generalize fix #2293 to cover more operations.
This simplifies and enforces use of precision in many more places,
to help avoid accidental loss of RelaxedPrecision through intermediate
operations. Known fixes are:
- ?:
- function return values with mis-matched precision
- precision of function return values when a copy was needed to fix types
2020-06-30 02:44:52 -06:00
John Kessenich
bf6efd0316 SPV: Fix #2293: keep relaxed precision on arg passed to relaxed param
When arguments are copied to make space for a writable formal parameter,
and the formal parameter is relaxed precision, make the copy also
relaxed precision.
2020-06-26 09:05:31 -06:00
John Kessenich
4df10335e6 SPV: Partially address #2293: correct "const in" precision matching.
Track whether formal parameters declare reduced precision and match
that with arguments, and if they differ, make a copy to promote the
precision.
2020-06-26 08:37:06 -06:00
Graeme Leese
060882fd37 Update SPIR-V generator version
Change to 10 to reflect the change to generating unordered !=
operations.
2020-06-22 11:03:46 +01:00
Graeme Leese
65ce566cbc Use OpFUnordNotEqual for floating-point !=
The normal IEEE not equal operation tests whether operands are unordered
or not equal (so comparison with a NaN returns true). This corresponds
to the SPIR-V OpFUnordNotEqual, so change to using that.
2020-06-22 10:59:33 +01:00
Shahbaz Youssefi
d52dce5067
Add -g0 command line argument
Analogous to gcc, -g0 would strip all debug info.  This is done
regardless of whether optimizations are enabled.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
2020-06-18 10:16:40 -04:00
Ben Clayton
1a6c8ecb20 C Interface: Split SPIR-V C interface to own file
This breaks a cyclic dependency between the SPIRV and glslang build targets.
2020-06-15 13:22:19 +01:00
John Kessenich
3641ff7378 Bump code gen version, due to removal of OpEntryPoint operands. 2020-06-10 07:40:56 -06:00
John Kessenich
c30d335377 Fix #2264: OpEntryPoint incorrectly including function parameters. 2020-06-10 07:17:11 -06:00
Alejandro Piñeiro
ff6dcca575
spirv: Support initializers on uniforms (#1588)
If a uniform has an initializer it will now be given as the optional
initializer operand to the OpVariable instruction.

Fixes: https://github.com/KhronosGroup/glslang/issues/1259

Signed-off-by: Neil Roberts <nroberts@igalia.com> (the code)
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com> (the tests)
Signed-off-by: Arcady Goldmints-Orlov <agoldmints@igalia.com>

Co-authored-by: Neil Roberts <nroberts@igalia.com>
2020-06-04 01:39:31 -06:00
Ricardo Garcia
232ba0d848
Add SPIR-V capabilities needed for spec constants (#2199)
Fixes #2198.
2020-06-03 07:52:55 -06:00
rdb
d8edfd8e66
HLSL: fix handling of uniform qualifier in entry point parameters (#2254)
* HLSL: Fix handling of uniforms in entry point parameters

* HLSL: fix handling of "uniform in"

* Tests: Update baseResults of hlsl.function.frag.out for #2254

* HLSL: fix uniforms in function parameters for opaque types
2020-06-02 00:30:07 -06:00
alelenv
999d4fdcdd
Add default descriptorset decoration for acceleration structure (#2257)
variables.
2020-06-02 00:24:41 -06:00
dan sinclair
f15982ebeb
Remove install to the SPIRV/ folder. (#2256)
This CL updates the build scripts to only install to glslang/SPIRV
instead of also installing to the SPIRV/ folder. The deprecation notice
is also removed.

Note, this may cause downstream build issues if include directories have
not been updated

Fixes #1964 #2216
2020-06-01 23:21:03 -06:00
alelenv
59216d5cd8
Add support for primitive culling layout qualifier. (#2220)
* Add support for primitive culling layout qualifier.

* Add error checks for primitive flags and negative test.
2020-05-21 05:38:41 -06:00
Pankaj Mistry
2a8ead2109 Add support for extension GL_EXT_shader_implicit_conversions
Updated extension management in TIntermediate class.
2020-04-30 08:41:23 -07:00
John Kessenich
bcf6a2430e Move to SPIR-V 1.5 Rev. 3, bump revision, remove a status from README. 2020-04-27 02:12:05 -06:00
John Kessenich
52d34b4c65 Move to latest SPIR-V header, and bump glslang revision. 2020-04-24 08:46:32 -06:00
Cody Northrop
4d2298bfd7
Support multiple swizzled out operands (#2175)
Swizzled out operands were added in bbbd9a2a. This was sufficient
for most tests, but we ran into problems with umulExtended and
imulExtended, which have two.

This CL converts the tracking values to vectors so multiple operands
can be supported.

Test: KHR-GLES31.core.shader_bitfield_operation.*
Test: ctest
2020-04-13 21:59:49 -06:00
alelenv
75de196cec
Add support for EXT_ray_flags_primitive_culling. (#2173)
Fixes issue #2169.
2020-04-08 22:09:20 -06:00
John Kessenich
1fff362355 Build warning: Fix #2167: Remove nested reuse of 'unreachable'. 2020-04-01 00:46:57 -06:00
ntfs.hard
7fc409eecc bitwise on boolean 2020-03-30 01:32:23 +03:00
Neslisah Torosdagli
054b5e35eb pass by reference updates 2020-03-26 12:24:31 -04:00
Neslisah Torosdagli
7d37a68ad7 pass-by-reference updates 2020-03-26 11:08:28 -04:00
John Kessenich
8e26c5f50e
Merge pull request #2139 from neslimsah/master
GL_EXT_ray_query updates
2020-03-25 08:18:33 -06:00
Neslisah Torosdagli
cea9384b6b switch format update 2020-03-25 08:13:32 -04:00
Neslisah Torosdagli
ea98c46c2b spirv.hpp reverted to commit f368dcbb7d 2020-03-24 12:02:20 -04:00
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
Neslisah Torosdagli
7d122c96a4 Merge branch 'master' of https://github.com/neslimsah/glslang 2020-03-20 18:35:57 -04:00
Neslisah Torosdagli
50a722818b GL_EXT_ray_query glslang updates, and test cases added. 2020-03-20 18:23:27 -04:00
Torosdagli
06c2eee720 GL_EXT_ray_query updates 2020-03-19 16:46:30 -04:00
Torosdagli
74d6d6a208 GL_EXT_ray_query updates 2020-03-19 11:09:57 -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