Currently spirv-link fails if all input files don't use the same
SPIR-V version. Add an option to instead use the highest input
version as the output version. Note that if one of the 'old'
input files uses an opcode that is deprecated in the 'new'
version, the output spirv will be invalid.
Some operands are not simple values, but bitmasks.
The lookup in the table for required decomposing the mask into
single values.
This commit adds support for such operands, like MinLod|Offset.
A token is allowed to parse even when it's from the wrong
version, or is not enabled by a capability or extension.
This allows more modules to parse.
Version/capability/extension checking is fully moved to
validation instead.
Fixes: #5364
* opt: fix StorageInputOutput16 trimming.
While integrating this pass into DXC, I found a lot of missing
cases. This PR fixes a few issues centered around this capability
while laying out fondations for more fixes.
1. The grammar can define extensions in operand & opcode tables.
- opcode can rely on common capabilities, but require a new
extension.
- opcode can also rely on a capability which requires an extension.
Sometimes, the extension is listed twice, in the opcode, and
capability. But this redundancy is not guaranteed.
2. minVersion check. The condition was flipped: we added the extension
when the minVersion was less than current.
Didn't noticed the issue as I only tests on the default env.
3. Capability/Extension instructions were not ignored.
- `OpCapability Foo` will require the `Foo` capability.
- it doesn't mean the module requires the `Foo` capability.
Same for extensions.
This commit adds disabled tests, for fixes which are too large to
be brought into this already large PR.
* Roll external/googletest/ 6f6ab4212..46db91ef6 (9 commits)
6f6ab4212a...46db91ef6f
$ git log 6f6ab4212..46db91ef6 --date=short --no-merges --format='%ad %ae %s'
2023-08-07 dinor Make references to `#include`s consistent across docs
2023-08-02 robert.shade Avoid unreachable code warning
2023-08-02 dmauro Update documentation to refer to v1.14
2023-08-02 dmauro Bump version to v1.14 in preparation for release
2023-08-02 dmauro Remove the GTEST_HAS_DOWNCAST_ customization point.
2023-08-02 dmauro Add googletest-message-test to the Bazel tests It appears to have been unintentionally left out
2023-08-01 phoebeliang Make testing::Message support streamed AbslStringify values
2023-08-01 dmauro Update GoogleTest dependencies
2023-07-27 patryk gtest: Supress warning about set unused variable
Created with:
roll-dep external/googletest
* Roll external/re2/ 960c86176..9dc7ae7b5 (1 commit)
960c861764...9dc7ae7b52
$ git log 960c86176..9dc7ae7b5 --date=short --no-merges --format='%ad %ae %s'
2023-08-04 junyer Minor Bazel cleanups.
Created with:
roll-dep external/re2
---------
Co-authored-by: GitHub Actions[bot] <>
The autoroll workflow is currently failing due to being unable to find
some depot_tools executables. This is due to a limitation in Go os/exec
which effectively rejects all relative paths in PATH, and is exposed by
a recent update to depot_tools
(https://crrev.com/43083529de5802a83f53f1d53d7f5f9615999996).
Multiple calls to this function were causing vkCreateGraphicsPipelines
to be 3x slower on some driver. I suspect this was because each
call had to be inlined separately which bloated the code and caused
more work in the driver's SPIRV -> native instruction compilation.
* Roll external/googletest/ 40412d851..6f6ab4212 (2 commits)
40412d8512...6f6ab4212a
$ git log 40412d851..6f6ab4212 --date=short --no-merges --format='%ad %ae %s'
2023-07-27 julien.combattelli Use #if and not #ifdef to check filesystem support
2023-07-28 absl-team Adjust includes to use <> instead of "", consistent with quickstart pages.
Created with:
roll-dep external/googletest
* Roll external/re2/ e66463312..960c86176 (10 commits)
e66463312e...960c861764
$ git log e66463312..960c86176 --date=short --no-merges --format='%ad %ae %s'
2023-07-28 junyer Don't try to support ARM64 on Windows yet.
2023-07-28 junyer Try again to make cross-compiling on Windows work.
2023-07-28 junyer `bazelbuild/setup-bazelisk` doesn't work for some reason.
2023-07-28 junyer Bazelisk isn't installed with Chocolatey, apparently.
2023-07-28 junyer Avoid the Chocolatey install of Bazel(isk) getting in the way.
2023-07-28 junyer Try using `bazelbuild/setup-bazelisk` everywhere.
2023-07-28 junyer Tell the Python build where Bazelisk is.
2023-07-28 junyer Explicitly invoke Bazelisk rather than Bazel.
2023-07-28 junyer Avoid `Conflicts: python3-lldb-x.y` between packages.
2023-07-28 junyer Prepare to release `google-re2` 1.1.
Created with:
roll-dep external/re2
* Roll external/spirv-headers/ 51b106461..ae89923fa (1 commit)
51b1064617...ae89923fa7
$ git log 51b106461..ae89923fa --date=short --no-merges --format='%ad %ae %s'
2023-07-26 kevin.petit Add KHR suffix to Cooperative Matrix Operands
Created with:
roll-dep external/spirv-headers
---------
Co-authored-by: GitHub Actions[bot] <>
This commit adds a new optimization which tries to remove unnecessary
capabilities from a SPIR-V module.
When compiling a SPIR-V module, you may have some dead-code using
features gated by a capability.
DCE will remove this code, but the capability will remain. This means
your module would still require some capability, even if it doesn't
require it. Calling this pass on your module would remove obsolete
capabilities.
This pass wouldn't be enabled by default, and would only be usable
from the API (at least for now).
NOTE: this commit only adds the basic skeleton/structure, and
doesn't mark as supported many capabilities it could support.
I'll add them as supported as I write tests.
Signed-off-by: Nathan Gauër <brioche@google.com>
The code currently tries to get the value of the floating point constant
to see if it is -0.0. However, we are not able to get the value for
16-bit floating point value, and we hit an assert.
To avoid this, we add an early check for the width to make sure it is
either 32 or 64.
Fixes https://github.com/microsoft/DirectXShaderCompiler/issues/5413.
Expanding a bit the EnumSet API to have iterator-based
insert and constructors (like the STL).
This is also a pre-requisite from the capability-trimming pass as
it allows to build a const set from a constexpr std::array easily.
Signed-off-by: Nathan Gauër <brioche@google.com>
GetCapabilities returned a const*, and GetExtensions did not exist.
This commit adds GetExtensions, and changes the return value to
be a const&.
This commit also removes the overload to GetCapabilities which returns
a mutable set, as it is unused.
Signed-off-by: Nathan Gauër <brioche@google.com>
Work around a problem in CMake 3.22.1 in setting -std=c++17.
Instead -std=c++11 is in effect for targets in test/*, but
those targets require C++17.
Fixes: #5340
When using PhysicalStorageBuffer it is possible for a function to
return a pointer type. This was not being handled correctly in
`GetLoadedVariablesFromFunctionCall` in the DCE pass because
`IsPtr` returns the wrong result.
Fixes#5270.