The PhysicalStorageBufferAddresses capability can now be
trimmed. From the spec, it seems any instruction enabled by this
required some operand to have the PhysicalStorageBuffer storage class.
This means checking the storage class is enough.
Now, because the pass uses the grammar, we don't need to add any
new logic.
Signed-off-by: Nathan Gauër <brioche@google.com>
The StorageImageReadWithoutFormat capability is only required when
an image type with the format set to Unknown is used with some specific
OpImageRead or OpImageSparseRead instructions.
This patch adds the required code to the capability trimming pass to
remove the StorageImageReadWithoutFormat capability when not required.
Signed-off-by: Nathan Gauër <brioche@google.com>
Previously, the version string would include `v2022.4-N-...` indicating N commits since the last annotated tag (`v2022.4`).
This change broadens the search from just annotated tags to all tags that match `v*`, including the latest version `v2023.4.rc2`.
See also: https://github.com/KhronosGroup/SPIRV-Tools/pull/5417#issuecomment-1764772856
The function that get the number of elements in a composite variable
returns an incorrect values for the arrays. This is fixed, so that it
returns the correct number of elements for arrays where the number of
elements is represented as a 32-bit integer and is known at compile
time.
Fixes#4953
* Remove references to __FILE__
Uses of `__FILE__` leak the directory structure of the machine used to
build because it adds a string to the string table with the full path
name. I've removed the uses that show up in the release builds.
Fixes#5416
The SPIR-V specification allows any scalar integer type as an index. DXC
usually emits indexes as 32-bit integer types, however, in some cases it
is possible to make it emit 64-bit indexes instead (as in
https://github.com/microsoft/DirectXShaderCompiler/issues/5638).
When building, .git directory may not exist in current
directory (e.g. chromium build), so it will produce
with current timestamp, which becomes non-deterministic build.
Check if repo_path is in git repository and use git info.
Also fix fallback logic when 'git describe' failed.
'git rev-parse HEAD' result was not used because it didn't
update success.
* Add ComputeDerivativeGroup*NV capabilities to trim capabilities pass.
* Add SPV_NV_compute_shader_derivatives to allow lists
No tests needed for this. The code path is well tested. Just adding new
data.
35bb195dec...b673de3583
$ git log 35bb195de..b673de358 --date=short --no-merges --format='%ad %ae %s'
2023-10-06 junyer Clean up some fuzzer-related cruft.
2023-10-05 allenwebb Use a variable for `PKG_CONFIG` for distros that cross-compile.
Created with:
roll-dep external/re2
Co-authored-by: GitHub Actions[bot] <>
spirv-link requires that memory models match between its input files.
Ensure this is the case by always returning SuccessWithChange and
always changing the memory model to match the instrumentation
code in Vulkan-ValidationLayers.
Also, disable the DCE pass in the --inst-* command line options, since
it will only work after linking.
Add a new legalization pass to dedupe invocation interlock instructions
DXC will be adding support for HLSL's rasterizer ordered views by using
the SPV_EXT_fragment_shader_interlock_extension. That extension
stipulates that if an entry point has an interlock ordering execution
mode, it must dynamically execute OpBeginInvocationInterlockEXT and
OpEndInvocationInterlockEXT, in that order, exactly once. This would be
difficult to determine in DXC's SPIR-V backend, so instead we will emit
these instructions potentially multiple times, and use this legalization
pass to ensure that the final SPIR-V follows the specification.
This PR uses data-flow analysis to determine where to place begin and
end instructions; in essence, determining whether a block contains or is
preceded by a begin instruction is similar to a specialized case of a
reaching definitions analysis, where we have only a single definition,
such as `bool has_begun = false`. For this simpler case, we can compute
the set of blocks using BFS to determine the reachability of the begin
instruction.
We need to do this for both begin and end instructions, so I have
generalized portions of the code to run both forward and backward over
the CFG for each respective case.
For some reason the `gh` command to create a pull request with a team as
the reviewer is not working. That command works when I run it locally. I
don't know what the problem is, but I will just stop adding a reviewer.
Then anyone can look at it.
These functions are getting far too complicated to code in SPIRV-Tools
C++. Replace them with import stubs so that the real implementations
can live in Vulkan-ValidationLayers where they belong.
VVL will need to define these functions in spirv and link them to the
instrumented version of the user's shader.
From here on out, VVL can redefine the functions and any data they use
without updating SPIRV-Tools. Changing the function declarations will
still require both VVL and SPIRV-Tools to be updated in lock step.
When we are attempting to fetch the version info from the git
repository, first check if we're actually in one, otherwise
spurious errors messages get printed.
e0077036ca...a807e8a3aa
$ git log e0077036c..a807e8a3a --date=short --no-merges --format='%ad %ae %s'
2023-09-07 junyer Revert "Make the extension work for Python 3.8+."
2023-09-07 junyer Make the extension work for Python 3.8+.
2023-09-07 junyer Try plumbing the platform name a different way.
2023-09-07 junyer Add a "dry run" mode to the Python workflow.
2023-09-04 junyer Switch to `python -m build`.
2023-09-04 junyer Mark three dependencies as `dev_dependency = True`.
Created with:
roll-dep external/re2
Co-authored-by: GitHub Actions[bot] <>
From the Capability's text in the SPIRV spec:
```
An MS operand in OpTypeImage indicates multisampled, used with an
OpTypeImage having Sampled == 2 and Arrayed == 1.
```
Adding this logic to the capability trimming pass.
Adds the RayTracingKHR and RayQueryKHR capabilities to
the supported capabilities list (this includes the linked extension).
(NV and KHR capabilities/extensions shared the same IDs, so it also
works for NV flavors of those).