Граф коммитов

188 Коммитов

Автор SHA1 Сообщение Дата
Natalie Chouinard 4f4bb42089
Bump submodules (#6577)
Update SPIRV-Headers and SPIRV-Tools submodules.
2024-05-02 17:03:11 +00:00
Michael Anttila f19b3f5439
Update submodules (#6397)
Updating SPIRV-Tools and SPIRV-Headers.
2024-03-07 13:22:50 -05:00
Cassandra Beckley bda8121115
[SPIR-V] Update dependencies (#6303)
Update SPIRV-Headers and SPIRV-Tools
2024-02-13 23:10:59 +00:00
Steven Perron 69a64d8419
[SPIRV] Using 64-bit int literals in flat conversion (#6283)
During flat convertion, we have to pick the bit width for literals
because they could be used in multiple places as different sizes, and
that breaks the literal visitor.  We currently use 32-bit types because
that is the most common use case, and we don't want to unnecessarily
add a capability.

However, if we pick a 64-bit width, we should be able to fold all of
the operations on literals. If they are only used as 32-bit value, then
ultimatlly fold them to 32-bit constants and remove the 64-bit
capabilities.

This commit updates the spir-v submodule to pull in the 64-bit interger
folding changes, and then starts to use 64-bit integer literal in flat
conversion.

Note that the problem still exists for floating point values. Spirv-opt
does not fold OpFConvert yet, we still treat the literals like a float.

Fixes #6188

---------

Co-authored-by: Natalie Chouinard <chouinard.nm@gmail.com>
2024-02-12 11:18:45 -08:00
Natalie Chouinard 5c05021989
Update submodules (#6237)
Bump submodules to include the fix for #5962
2024-02-02 10:07:08 -05:00
Nathan Gauër 2fae54abe6
[SPIR-V] add SPV_EXT_mesh_shader to opt allowlist (#6224)
Bring SPIRV-Tools changes required to optimize code using this
extension.

Fixes #6087

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-01-30 18:48:51 +00:00
Natalie Chouinard fe70cb07fb
[SPIR-V] Add VulkanMemoryModelDeviceScope (#6186)
The VulkanMemoryModelDeviceScope capability is now covered by the
SPIRV-Tools capability trimming pass, so it should be added here
unconditionally now.

Fixes #6066
2024-01-29 15:00:13 +00:00
Nathan Gauër 7d2f9c74d5
deps: update SPIRV-Tools for SDK release (#6114)
Bump the SPIRV-Tools version to v2023.6.rc1 to prepare Vulkan SDK
release.
2024-01-02 09:56:30 -05:00
Xiang Li 5f7834de56
[lit][SPIRV] convert runCodeTest to lit and remove dependence on effcee (#6077)
Convert runCodeTest to lit FileCheck test and remove all the code
related to runCodeTest.

Remove effcee and re2 from git submodule since nothing is dependent on
them after the change.
2023-12-14 06:50:32 -08:00
Antonio Maiorano 37a082651d
CMake dxc as subproject fixes (#6050)
These changes allow us to use DXC as as CMake subproject (via
add_subdirectory).

Commit comments from each commit:

===

cmake: allow CMAKE_INSTALL_RPATH to be defined in superproject on APPLE
platforms

As on Linux, allow CMAKE_INSTALL_RPATH to be defined in a CMake
superproject.

===

cmake: Allow LLVM_ENABLE_ASSERTIONS=OFF to disable assertions in Debug
builds

Currently, this flag is only used to enable assertions in non-Debug
builds, but is not respected in Debug builds. That is, if set to false,
Debug builds will still assert. This change fixes that.

Note that by default, LLVM_ENABLE_ASSERTIONS is true in Debug builds, so
unless it's explicitly set to false, this is a no-op for most people.

===

cmake: Allow DIRECTX_HEADERS_INCLUDE_DIR to be defined from superproject

Useful for when DXC is included as a subdirectory. In Dawn/Chrome, we
use our own mirror of DirectX-Headers instead of checking out the repo's
submodules, so we need to override this variable.
2023-11-22 14:33:09 -05:00
Nathan Gauër c5ec2772bc
Update submodules (#6043)
Bumping submodule dependencies.
2023-11-20 14:24:49 -08:00
Steven Perron df0287c23f
[SPIRV] Implement SM6.6 implicit LOD operations in compute shaders (#5829)
SPIRV has not yet implemented the changes in SM6.6 that allows
[derivatives
in compute, mesh, and amplification
shaders](https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_Derivatives.html).
This is because there is no KHR
extension that enabled that capability in SPIR-V.

However, we have decided to use
[SPV_NV_compute_shader_derivatives](https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/NV/SPV_NV_compute_shader_derivatives.asciidoc)
to implement it for compute shader while we wait for a KHR extension.

This change only deals with the texture sample instructions.
The changes involve

1. modifying code that makes sure these only appear in fragment shaders
to allow compute shaders as well.
1. add the extension and capability
1. set the correct execution mode on the function when
the intrinsics are used in compute shaders.
2023-10-27 14:39:36 +00:00
Nathan Gauër d6e7e37e5f
[SPIR-V] Update submodules (#5850)
Update submodules to prepare the LunarG SDK release.
2023-10-11 14:40:12 -04:00
Cassandra Beckley e4304d9ef4
[SPIR-V] Update submodules (#5819)
This pulls in the new legalization pass in SPIRV-Tools that will be used
for rasterizer ordered views in SPIR-V.
2023-10-04 11:56:50 -04:00
Cassandra Beckley 3a4cad2f9d
[SPIR-V] Update submodules (#5655)
Update `SPIRV-Headers` and `SPIRV-Tools` to their latest versions.
2023-09-06 09:05:08 -04:00
Nathan Gauër da36098644
[SPIR-V] Add capability trimming pass (#5518)
This new optimization passes determines the required capabilities for a
module, and strips unneeded capabilities.
This means if some dead-code uses a capability, it won't be added as a
requirement for the module anymore.

This interacts with `[[vk::ext_capabilities]]` and
[[vk::ext_extension]]` attributes, as the extension/capability they
declare could be stripped if not required.

Still markes as draft for now as there are inconsistencies with debug
instruction I need to figure out:
 - if 2 DebugScope are generated, SPIRV-Tools squash them into 1.
- seems like we started to generated the wrong ones, but test didn't saw
the 2 conflicting scopes, only checked the first one.
2023-08-24 13:18:19 +02:00
Nathan Gauër 4cfac01422
prepare LunarG SDK v2023.4.rc2 release (#5511)
Bumping SPIRV-Tools & SPIRV-Headers version for SDK release.
SPIRV-Headers version matches the one SPIRV-Tools uses on the main repo.
2023-08-08 10:50:08 -04:00
Diego Novillo c201a11d6e
Update submodule hashes for SPIRV-Tools and SPIRV-Headers. (#5450)
This is in preparation for the upcoming 1.7.2308 release.
2023-07-24 20:50:52 +00:00
Diego Novillo 7305c8bf42
Update SPIRV-Tools and SPIRV-Headers to current release candidate versions (#5439)
Taken from
http://sheets/1r4wC2cge0Cjru1ShjGqZRmUNEmo_FRZHCX-BdeemXsU#gid=1167313977
2023-07-20 18:24:29 +02:00
Steven Perron 1501181418
Update spirv-headers and spirv-tools (#5419)
Updates the submodules, and disables validation on two tests. The SPIR-V
is invalid, and spir-val just started checking it. Since we have been
generating this code for a while, I do not see the need to modify the
generated code immediatly.
2023-07-17 10:28:48 -07:00
Kirill Kozlov 38fcd6f741
[SPIRV] Add option to preserve interface variables (#5400)
Add `-fspv-preserve-interface` CLI option to prevent DCE optimization
pass from compiling out interface variables. It happens if these
variables are unused.

The option may be useful when decompiling SPIR-V back to HLSL.
Personally, I need it to convert DX12 shaders to DX11 ones using
SPIRV-Cross as a tool for converting SPIR-V, produced by DXC, to the old
shader model HLSL.

SPIR-V Tools now have a parameter in `RegisterPerformancePasses()` and
`RegisterLegalizationPasses()` for this. This PR creates a new command
line option in DXC and passes it to the `spvtools::Optimizer`.

Closes #4567
2023-07-11 12:20:58 +02:00
Diego Novillo a42e054983
Update SPIRV-Tools submodule. (#5245)
This also required a fix to the unrolling loop, as the SPIRV optimizer
has changed upstream.
2023-05-30 08:14:31 -07:00
Nathan Gauër 021f8f3e12
Update SPIRV-Tools to version v2023.3.rc1 (#5219)
Signed-off-by: Nathan Gauër <brioche@google.com>
2023-05-17 14:33:38 +02:00
Nathan Gauër d04c296ad7
update SPIRV-Tools version to v2023.2.rc1 (#5097)
Rolling SPIRV-Tools to the new version.
2023-03-21 09:19:49 -04:00
Greg Roth 8d5efcae84
Silence cmake endif mismatch warning (#5005)
A careless endif in cmake to enable catching a particular compiler
warning introduced an irritating cmake warning. The corrects the
mismatched endif
2023-02-09 08:08:14 +00:00
Cassandra Beckley e0f513f748
Update submodules (#4959) 2023-01-24 08:07:35 -08:00
Diego Novillo 3333079d45
Update SPIRV-Tools submodule hash for v2023.1 release. (#4953)
The v2023.1 release has had some hiccups, so I've been needing to bump
the hashes a few times.  Hopefully, this is the last one.
2023-01-18 16:01:15 +00:00
Diego Novillo 79b24d26da
Update submodule hash for SPIRV-Tool to reflect changes to v2023.1 release (#4950) 2023-01-17 15:37:40 -05:00
Diego Novillo 3dbea8f2f6
Update submodule hash for SPIRV-Tools. (#4947)
This is in preparation for the upcoming LunarG SDK release.
2023-01-16 21:18:27 +00:00
Nathan Gauër 8ccd72f725
git: change submodule tracking from master to main. (#4934)
Khronos is master branched on SPIRV repos to main. We should start
tracking it now.
2023-01-12 10:19:44 +00:00
Nathan Gauër 60530e57eb
misc: update submodules (#4909) 2023-01-06 09:49:49 -08:00
Greg Roth 7ad9c9c032
Fallthrough (#4843)
A common source of bugs. Although many of these were harmless, some were
not. By eliminating them and enabling this warning as an error, we won't
add more in the future.


Fixed a real SPIRV bug that required a test update to expect the correct behavior.
SPIRV testing was expecting incorrect results that came from a fallthrough error
2022-12-09 10:13:56 -08:00
Cassandra Beckley e78b2dd355
Update submodules (#4847) 2022-12-05 21:28:39 +00:00
Greg Roth 14a55b7738
[linux] Enable Reflection on *nix platforms (#4810)
Needed for the impending enabling on *nix platforms

* Remove circular dependency from RDAT Dumper

A file included by the source that implemented various ToString
converters of reflection data to strings itself depended on those
declarations, which it only found because of the unique way MSVC
processes templates. By moving the definitions and declarations into
their own header and source files, everyone gets what they need
without ouroborosing.

* Create DirectX-Headers submodule

Creates the DirectX-Headers submodule and adds the needed defines to
allow them to be used. As yet makes no use of these headers

* Improve src dir finding error

The check for the file stream that is meant to represent the filechecked
source file wasn't sufficient to detect a non-existent file. By expanding
the error check, it can produce a helpful message.

Also initialize the failure code so it isn't random

* Enable reflection functionality and testing

This flips the switch, removing or repositioning many ifdefs and
including previously excluded files in the build.

* Actually add the DirectX-Headers submodule

* fix *nix build breaks caused while fixing win breaks :P

* Respond to feedback -- some of it anyway ;)

* simplify cmake file to exclude unneeded src dir

* fix cmake (again)

* Fix GCC template specialization finickiness

What compiler is overly permissive now huh? huh? (or just quick to adopt
new language features?)

* LPCBYTE isn't a thing

Loathe as I am to push one more commit onto this. I don't want to
propagate a misconception. I meant to remove this earlier and caught it
from one final self-review >:(
2022-11-23 19:10:29 -07:00
Nathan Gauër 7b5200b9fa
maintenance: update submodules (#4782)
Signed-off-by: Nathan Gauër <brioche@google.com>

Signed-off-by: Nathan Gauër <brioche@google.com>
2022-11-10 11:07:39 -08:00
Cassandra Beckley 161ddc2b7c
Update submodules (#4770) 2022-11-07 13:46:49 +01:00
Diego Novillo 8d144f450e
Update submodule hashes for SPIRV-Tools, SPIRV-Headers and re2. (#4743)
This makes DXC use the latest SDK release for SPIRV-Tools and
SPIRV-Headers.
2022-10-25 17:26:26 +00:00
Nathan Gauër fc8c775ea6
bump SPIRV-Tools to fix #4429 (#4598)
SPIRV-Tools contains a fix for copy-propagate-arrays optimization pass.

Fixes #4429

Signed-off-by: Nathan Gauër <brioche@google.com>
2022-08-18 16:43:28 +02:00
Cassandra Beckley d58442d57d
Bump SPIRV-Tools to include bugfix for #4444 (#4587) 2022-08-11 15:52:32 -04:00
Nathan Gauër b3101a2feb
Bump spirv-tools, spirv-headers, effcee & re2 (#4582)
Signed-off-by: Nathan Gauër <brioche@google.com>
2022-08-09 15:16:51 +02:00
Cassandra Beckley 396e45cbc4
Bump spirv-tools, spirv-headers, effcee, and re2 submodules (#4577) 2022-08-08 10:09:35 -04:00
Jakub Kuderski ae943bc576
Bump spirv-tools, spirv-headers, effcee, and re2 submodules (#4493) 2022-06-01 14:20:16 -04:00
Daniele Vettorel 71fbb021fa
[spirv] Update SPIRV-Tools (#4445)
This includes some fixes related to flattening resource arrays.
2022-05-10 15:03:42 -04:00
Jaebaek Seo bf9632e8c8
[spirv] run interface variable SROA if signature packing is enabled (#4442)
Based on the Vulkan spec "15.1.5. Component Assignment":

"A Component decoration must not be specified for any type that is not a
scalar or vector."

we cannot decorate `Component` for array/matrix stage variables, which
is critical for the signature packing. We conduct the scalar replacement
for the stage variables to assign `Component` all stage variables, which
allows us to reduce the number of assigned `Location`s. This commit uses
the interface-variable-scalar-replacement spirv-opt pass for the SROA.

Note that the interface-variable-scalar-replacement spirv-opt pass is
experimental. We want to avoid the side effect caused by the pass as
much as possible. Therefore, we enable the pass only when the option for
the signature packing is enabled.
2022-05-10 11:54:05 -04:00
Natalie Chouinard 20fefeb1d0
Update SPIRV-Tools submodule (#4380) 2022-04-07 13:44:20 -04:00
Natalie Chouinard b1c75bee8a
Update SPIRV-Tools submodule to canary release (#4376) 2022-04-05 12:33:32 -04:00
Jaebaek Seo 2dc067b561
[spirv] Update SPIRV-Tools and SPIRV-Headers (#4352) 2022-03-25 17:41:26 -04:00
Jaebaek Seo 9dc0937519
[spirv] Update SPIRV-Tools and SPIRV-Headers submodules (#4322) 2022-03-10 15:09:17 -05:00
Natalie Chouinard 6633191b0b
[spirv] Update SPIRV-Tools and SPIRV-Headers submodules (#4253) 2022-02-14 09:58:43 -05:00
Jaebaek Seo c3b5a62337
[spirv] propagate Volatile semantics for raytracing interface vars (#4207)
Based on Vulkan spec

> VUID-StandaloneSpirv-VulkanMemoryModel-04678
If the VulkanMemoryModel capability is not declared, the Volatile
decoration must be used on any variable declaration that includes
one of the SMIDNV, WarpIDNV, SubgroupSize, SubgroupLocalInvocationId,
SubgroupEqMask, SubgroupGeMask, SubgroupGtMask, SubgroupLeMask, or
SubgroupLtMask BuiltIn decorations when used in the ray generation,
closest hit, miss, intersection, or callable shaders, or with the
RayTmaxKHR Builtin decoration when used in an intersection shader

> VUID-StandaloneSpirv-VulkanMemoryModel-04679
If the VulkanMemoryModel capability is declared, the OpLoad
instruction must use the Volatile memory semantics when it accesses
into any variable that includes one of the SMIDNV, WarpIDNV,
SubgroupSize, SubgroupLocalInvocationId, SubgroupEqMask,
SubgroupGeMask, SubgroupGtMask, SubgroupLeMask, or SubgroupLtMask
BuiltIn decorations when used in the ray generation, closest hit,
miss, intersection, or callable shaders, or with the RayTmaxKHR
Builtin decoration when used in an intersection shader

We have to propagate the volatile semantics based on the spec. Since
adding Volatile decoration to interfaces is allowed in Vulkan 1.3 or
above, we simply add Volatile decoration for such interfaces. If it is
Vulkan 1.2 or earlier, we have to set the Volatile for OpLoad
instruction, which need the VulkanMemoryModel capability. In addition,
since Vulkan 1.1 or earlier does not have the VulkanMemoryModel
capability in the core spec, we use SPV_KHR_vulkan_memory_model.
2022-01-25 19:00:41 -05:00