Commit Graph

129 Commits

Author SHA1 Message Date
Ryan Harrison
98340ec500
Add warning about spurious 'git cl upload' messages (#4800)
Fixes #4186
2022-05-11 15:17:21 -04:00
Natalie Chouinard
78a0f075ac
Fix gen_build_version on Windows (#4780)
* Fix gen_build_version on Windows

The paths used in the gen_build_version script are causing some failures
in downstream builds. Switch to using the location of the CHANGES file
rather than the ".." parent directory workaround.

* Update other build files
2022-04-07 13:19:05 +00:00
Steven Perron
f182d02052
Generalize the copyright check (#4702)
The copyright check has hardcoded the years that can appear in the
copyright check.  This means is has to be constantly updated as new
years or range of years are needed.

We try to  avoid this, at least for a while.  We allow years up to 2027.
The ranges for the years allow any combination of from 2014 to 2027.
2022-02-09 19:21:32 +00:00
luzpaz
65ecfd1093
Fix various source comment (doxygen) typos (#4680)
Found via `codespell -q 3 -L fo,lod,parm
2022-01-26 15:13:08 -05:00
Steven Perron
5003644f55
Fix roll_deps.sh (#4687)
Two deps changes branch names, and roll_deps.sh must be updated.

We also don't want the script to fail just because one of the deps is
already up-to-date.  Set `+e` before rolling the deps.
2022-01-25 15:44:03 -05:00
Jaebaek Seo
fb9a10cd48
spirv-opt: add pass to Spread Volatile semantics (#4667)
Add a pass to spread Volatile semantics to variables with SMIDNV,
WarpIDNV, SubgroupSize, SubgroupLocalInvocationId, SubgroupEqMask,
SubgroupGeMask, SubgroupGtMask, SubgroupLeMask, or SubgroupLtMask BuiltIn
decorations or OpLoad for them when the shader model is the ray
generation, closest hit, miss, intersection, or callable shaders. This
pass can be used for VUID-StandaloneSpirv-VulkanMemoryModel-04678 and
VUID-StandaloneSpirv-VulkanMemoryModel-04679 (See "Standalone SPIR-V
Validation" section of Vulkan spec "Appendix A: Vulkan Environment for
SPIR-V").

Handle variables used by multiple entry points:

1. Update error check to make it working regardless of the order of
   entry points.
2. For a variable, if it is used by two entry points E1 and E2 and
   it needs the Volatile semantics for E1 while it does not for E2
  - If VulkanMemoryModel capability is enabled, which means we have to
    set memory operation of load instructions for the variable, we
    update load instructions in E1, but do not update the ones in E2.
  - If VulkanMemoryModel capability is disabled, which means we have
    to add Volatile decoration for the variable, we report an error
    because E1 needs to add Volatile decoration for the variable while
    E2 does not.

For the simplicity of the implementation, we assume that all functions
other than entry point functions are inlined.
2022-01-25 13:14:36 -05:00
Pierre Moreau
42dc678913
Remove duplicated "the" from comments (#4666) 2022-01-12 19:04:13 -05:00
Jakub Kuderski
c72c454203
Clarify how to update DEPS (#4626)
-  Mention that `depot_tools` are required and link to that repo.
-  Make `roll_deps.sh` exit on error. The script passes `shellcheck`
   with this change.
-  Reword instruction in the README.
2021-11-09 10:28:01 -05:00
ZHOU He
f9893c4549
spirv-opt: A pass to removed unused input on OpEntryPoint instructions. (#4275)
The new pass will removed interface variable on the OpEntryPoint instruction when they are not statically referenced in the call tree of the entry point.

It can be enabled on the command line using the options `remove-unused-interface-variables`.
2021-06-29 11:33:58 -04:00
Kévin Petit
e065c482c6
Initial support for SPV_KHR_integer_dot_product (#4327)
* Initial support for SPV_KHR_integer_dot_product

- Adds new operand types for packed-vector-format
- Moves ray tracing enums to the end

- PackedVectorFormat is a new optional operand type, so it requires
  special handling in grammar table generation.

- Add SPV_KHR_integer_dot_product to optimizer whitelists.

- Pass-through validation: valid cases pass validation
  Validation errors are not checked.

- Update SPIRV-Headers

Patch by David Neto <dneto@google.com>
Rebase and minor tweaks by Kevin Petit <kevin.petit@arm.com>

Signed-off-by: David Neto <dneto@google.com>
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Change-Id: Icb41741cb7f0f1063e5541ce25e5ba6c02266d2c

* format fixes

Change-Id: I35c82ec27bded3d1b62373fa6daec3ffd91105a3
2021-06-23 13:32:24 -04:00
David Neto
e992c96c89
fix symbol exports check, for Android build cases (#4342)
- Ignore symbols marked as .hidden
- Ignore weakly linked thunks (_ZT prefix)

Without this, the exports check fails on the Android NDK build.
2021-06-23 12:03:34 -04:00
Steven Perron
8ec9f456e6
Fix export symbol test. (#4254)
* Fix export symbol test.

The symbol export test does not check weak symbols, even though they are
possibly exported.  It also does not allow functions in the standard
namespace even though it allows symbols on other namespaces.

I've modified the check to look at the name of weakly defined function,
and I've allowed functions in the standard namespace, functions in a local scope, and
weak definitions of new and delete operators.

Fixes #4250
2021-04-29 14:27:16 -04:00
Ben Clayton
f8c78cc534
Updates to the vscode SPIR-V extension (#4246)
* utils/vscode: Allow running install.sh from any CWD

* utils/vscode: Update schema to latest

* utils/vscode: Don't keep on adding trailing newlines

Repeatedly formatting the file will keep on appending newlines to the end of the file.
Don't do that.
2021-04-29 08:58:55 -04:00
Shiyu Liu
6cdf07d2b3
spirv-fuzz: Swap positions of two functions in a module (#4236)
Adds a new transformation class that swaps the syntactic position of
two functions in the module, and a fuzzer pass to apply it.

Fixes #4026.
2021-04-27 12:33:08 +01:00
Steven Perron
1b8341b8b1
Fix warning in python script. (#4251) 2021-04-26 15:37:38 -04:00
Mostafa Ashraf
8fe39ad581
spirv-fuzz: Permute the order of variables at function scope issue (#4248)
Fixes #4194.
2021-04-26 16:53:55 +01:00
Alastair Donaldson
6578899781
spirv-fuzz: Manage available instructions efficiently (#4177)
Introduces a data structure for efficient management of available
instructions in the fuzzer.
2021-03-20 18:51:18 +00:00
Corentin Wallez
4a59fd4763
Fix -Wextra-semi-stmt -Wsuggest-destructor-override -Wdeprecated-copy-dtor (#4164)
* Fix -Wextra-semi-stmt
* Fix -Wsuggest-destructor-override
* Fix -Wdeprecated-copy-dtor
2021-03-09 13:16:43 +00:00
Ben Clayton
d28186db93
Fixes for the vscode language server extension (#4150)
Fix URL to the `OpenCL.DebugInfo.100` grammar file, which moved from `SPIRV-Tools` to `SPIRV-Headers`.

Add a `go.mod` and `go.sum` file.
Go has now fully migrated to using modules, and relative imports no longer work.
Fixup all the relative imports to use a fully qualified path based on the module name.

Fix the `.exe` executable extension on windows.

Update the generated grammar files.

Update the `README.md` with more information.

Disable generation of the log file. Seems to end up in the workspaceDir on windows, not the executable path
2021-02-26 18:07:00 +00:00
Ben Clayton
8383bd5d6f
Migrate all Kokoro build scripts over to use the docker VM image (#4114)
* Work around GCC-9 warning treated as error

```
../source/opt/instruction.h:101:23: error: '*((void*)& operand +32)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  101 |     uint64_t result = uint64_t(words[0]);
```

* Migrate all Kokoro build scripts over to use the docker VM image

Required updating the NDK SDK and build scripts, as well as the check_copyright for handling 2021.
2021-01-18 13:36:26 -05:00
Ryan Harrison
09d1fea589
Force using Python 3 git-sync-deps (#4067)
This scripts fails to run in Python 2. For systems that have both
Python 2 and 3 installed, depending on your PATH the existing code may
or may not run. Explictly using Python 3 to avoid this.
2020-12-10 13:39:37 -05:00
David Neto
cd590fa334
Update MeshShadingNV dependencies (and land Ray tracing updates) (#4028)
* Update to final ray tracing extensions

Drop Provisional from ray tracing enums
    sed -ie 's/RayQueryProvisionalKHR/RayQueryKHR/g' **/*
    sed -ie 's/RayTracingProvisionalKHR/RayTracingKHR/g' **/*
Add terminator support for SpvOpIgnoreIntersectionKHR and SpvOpTerminateRayKHR
Update deps for SPIRV-Headers

* Update capability dependencies for MeshShadingNV

Accommodate https://github.com/KhronosGroup/SPIRV-Headers/pull/180

MeshShadingNV: enables PrimitiveId, Layer, and ViewportIndex

Co-authored-by: Daniel Koch <dkoch@nvidia.com>
2020-11-23 12:23:54 -05:00
Alastair Donaldson
ed9863e46e
Favour 'integrity' over 'coherence' as a replacement for 'sanity'. (#3619) 2020-09-10 09:52:21 -04:00
Alastair Donaldson
f9b088fe0d
Avoid use of 'sanity' and 'sanity check' in the code base (#3585)
In line with:

  https://source.android.com/setup/contribute/respectful-code

this change uses the terms 'coherence' and 'coherence check' where
'sanity' and 'sanity check' were previously used.
2020-07-28 23:55:02 -04:00
Ryan Harrison
969f028647
Change DEPS rolling script to point at external/ (#3584) 2020-07-23 16:40:05 -04:00
Stefano Milizia
5f8cdd8b45
Implement transformation to record synonymous constants. (#3494)
Adds a fact-only transformation that records that two constants in the module are synonymous.
2020-07-10 14:02:14 +01:00
Ryan Harrison
36b5bb701d
Add support for different default/trunks in roll-deps (#3442) 2020-06-22 13:24:43 -04:00
dan sinclair
52a5f074e9
Update access control lists. (#3433)
This CL updates the access control lists used in SPIRV-Tools to the more
descriptive allow/deny naming.
2020-06-15 13:20:40 -04:00
Ben Clayton
23d68608b0
vscode: Handle '|' chains on BitEnum / ValueEnum (#3309)
* vscode: Regenerate schema with new opcodes.

* vscode: Handle '|' chains on BitEnum / ValueEnum

These were highlighting as errors.
2020-04-27 16:14:48 -04:00
Aaron Franke
7f341ffee6
Make file formatting comply with POSIX standards (#3242)
Add newlines to two files
2020-03-23 10:20:00 -04:00
Daniel Koch
5a97e3a391
Add support for KHR_ray_{query,tracing} extensions (#3235)
Update validator for SPV_KHR_ray_tracing.

* Added handling for new enum types
* Add SpvScopeShaderCallKHR as a valid scope
* update spirv-headers

Co-authored-by: alelenv <alele@nvidia.com>
Co-authored-by: Torosdagli <ntorosda@amd.com>
Co-authored-by: Tobias Hector <tobias.hector@amd.com>
Co-authored-by: Steven Perron <stevenperron@google.com>
2020-03-17 15:30:19 -04:00
Vasyl Teliman
533af49812
spirv-fuzz: Add fuzzer pass to permute function parameters (#3212)
Fixes #3194.
2020-03-08 14:27:05 +00:00
Alastair Donaldson
66a682b6a8
spirv-fuzz: Add swap commutable operands transformation (#3205)
In this PR, the classes that represent the swap commutable operands
transformation and the fuzzer pass were implemented.

Fixes #3205.
2020-03-05 08:18:39 +00:00
David Neto
e1688b60ca
Avoid use of Python distutils.dir_util (#3203)
Required for compatibility with (some?) Python3 installations.
2020-02-28 16:50:06 -05:00
Geoff Lang
fb6e3e48d5
Combine extinst-name and extinst-output-base into one arg. (#3200)
* Combine the extinst-name and extinst-output-base into one arg.

Some build systems such as Android blueprints require that the inputs
and outputs of generator scripts are all provided as arguments.  These
two arguments to generate_language_headers.py are combined to form the
output path in the script.  This change simply lets the user provide the
whole output path as an argument.

* Fix typo in build_defs.bzl and update Android.mk
2020-02-25 00:46:52 -05:00
Ben Clayton
79f8caf915
vscode: Add missing fields to schema.Opcode (#3169)
These were declared in the `Opcode` struct type, but were never assigned.
They're not actually used by the language server, but I reused this go schema package for a local experiment and found they were missing.
2020-02-18 06:01:56 -08:00
Ben Clayton
9e52bc0d0c
utils/vscode: LSP - Support OpExtInst (#3140)
This adds language server support for the `GLSL.std.450`, `OpenCL.std` and `OpenCL.DebugInfo.100` extension instructions.
2020-02-04 11:21:10 -05:00
Alastair Donaldson
fdd0c87765
Update script that checks copyright years. (#3173) 2020-02-04 08:57:47 -05:00
David Neto
fb2e819819
Fix GN build for OpenCL.DebugInfo.100 update (#3134)
The utils/generate_grammar_tables.py vendor-operand-kind-prefix
can now take a value of "...nil..." to signify the empty string.
That's needed because GN doesn't quote empty string arguments
correctly down into its action commands.

Fixes #3120
2020-01-08 17:27:38 -05:00
Ben Clayton
c86dc0bcdb Fix bad parameter names in error message (#3129) 2020-01-08 09:54:45 -05:00
David Neto
64f36ea529
Support OpenCL.DebugInfo.100 extended instruction set (#3080)
* Clone opencl.debuginfo.100 grammar from debuginfo grammar

Update version number to 200 revision 2

* Apply content from OpenCL.DebugInfo.100 extension text

* Rename grammar file

* Support OpenCL.DebugInfo.100 extended instructions

Add support for prefixing operand type names, to disambiguate
them between different instruction sets.

* Add tests for OpenCL.DebugInfo.100

* Support lookup of OpenCL.DebugInfo.100 extinst

* Add tests for enum values

* Recognize 2017-2019 as copyright date range

* Android.mk: support OpenCL.DebugInfo.100 extended instruction set

Also, stop generating core instruction tables for non-unified1 versions
of the grammar.

* Imported entity operand type is concrete

* Bazel: Suppoort OpenCL.DebugInfo.100

* BUILD.gn: Support OpenCL.DebugInfo.100
2019-12-19 17:16:26 -05:00
David Neto
e70b009b0f
Add support for SPV_KHR_non_semantic_info (#3110)
Add support for SPV_KHR_non_semantic_info

This entails a couple of changes:

- Allowing unknown OpExtInstImport that begin with the prefix `NonSemantic.`
- Allowing OpExtInst that reference any of those sets to contain unknown
  ext inst instruction numbers, and assume the format is always a series of IDs
  as guaranteed by the extension.
- Allowing those OpExtInst to appear in the types/variables/constants section.
- Not stripping OpString in the --strip-debug pass, since it may be referenced
  by these non-semantic OpExtInsts.
- Stripping them instead in the --strip-reflect pass.

* Add adjacency validation of non-semantic OpExtInst

- We validate and test that OpExtInst cannot appear before or between
  OpPhi instructions, or before/between OpFunctionParameter
  instructions.

* Change non-semantic extinst type to single value

* Add helper function spvExtInstIsNonSemantic() which will check if the extinst
  set is non-semantic or not, either the unknown generic value or any future
  recognised non-semantic set.

* Add test of a complex non-semantic extinst

* Use DefUseManager in StripDebugInfoPass to strip some OpStrings

* Any OpString used by a non-semantic instruction cannot be stripped, all others
  can so we search for uses to see if each string can be removed.
* We only do this if the non-semantic debug info extension is enabled, otherwise
  all strings can be trivially removed.

* Silence -Winconsistent-missing-override in protobufs
2019-12-18 18:10:29 -05:00
Ben Clayton
f31f26f739 utils/vscode: Add install.bat (#3071)
Installs the language server on windows.
Also add info to / correct `README.md`.
2019-11-26 16:23:57 -05:00
Ben Clayton
cdd6829a3e utils/vscode: Add SPIR-V language server support
Supports:
* Syntax highlighting.
* Red squiggles for parse errors.
* Basic sanity checking of operand types.
* Jump to definition of id.
* Find all uses of id.
* Rename id.
* Hover definition of id.
* Format file.
2019-11-13 13:48:11 -05:00
Ben Clayton
b96c9a057e utils/vscode: Add go language server packages.
The utils/vscode/src/lsp directory contains code forked from https://github.com/golang/tools/tree/master/internal/lsp.

This code has been modified to remove additional, unneeded features and dependencies.

Submitted on behalf of a third-party: The Go Authors
2019-11-13 13:48:11 -05:00
David Neto
3e4abc9ac3
Try to fix go linter: exported constant comment (#3026)
The linter wants the comment on an exported constant to
begin with the name of the constant.
2019-11-08 14:12:39 -05:00
David Neto
8a35bf030b Python 3: remove deprecated U qualifier on 'open' (#3019)
The U qualifier (universal line endings) has no effect
in Python3. Remove its use to avoid a Python warning.
2019-11-07 08:39:09 -05:00
David Neto
d9fbf02348
Fix Go lint issues: comment exported symbols (#3014) 2019-11-05 17:41:10 -05:00
Chris Lamb
178c4ddea5 Correct "environment" typo (#3007) 2019-11-04 21:01:27 -05:00
Ben Clayton
7e2cba6a52 utils/vscode: Change assembly file ext to .spvasm (#2995)
Instead of `.spirv`.
`.spvasm` is the official extension for these textual files.
2019-10-29 11:16:17 -04:00