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

144 Коммитов

Автор SHA1 Сообщение Дата
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
Jaebaek Seo 833aee5446
[spirv] use OpDemoteToHelperInvocation for discard in vk1.3 (#4162)
In Vulkan1.3/SPIR-V1.6, we default OpDemoteToHelperInvocation
instruction for the discard statement. Unlike previous Vulkan versions,
we do not need to enable SPV_EXT_demote_to_helper_invocation extension.

This commit enables `-fspv-target-env=vulkan1.3` flag, but supporting
Vulkan1.3/SPIR-V1.6 is still WIP.
2022-01-05 09:59:01 -05:00
Jaebaek Seo 1941f3fdc5
[spirv] Update SPIRV-Tools and SPIRV-Headers submodules (#4144) 2021-12-14 17:06:15 -05:00
Jaebaek Seo a19c02d182
[spirv] allow cmake to use external SPIRV-Tools/Headers (#4143)
Without this change, setting the path of SPIRV-Tools with an arbitrary
path causes cmake error that the binary path of SPIRV-Tools is not
specified. This commit sets the binary path of SPIRV-Tools/Headers
even when they are out of DXC code base.
2021-12-14 13:45:46 -05:00
Natalie Chouinard 62ddc871bb [spirv] Update SPIRV-Tools and SPIRV-Headers submodules
Fixes #3705 with KhronosGroup/SPIRV-Tools@d0a827a
2021-11-30 09:31:54 -05:00
Jaebaek Seo 0c53d74705
[spirv] test preservation of RelaxedPrecision for resource in struct (#4064)
spirv-opt desc-sroa pass recently handles OpMemberDecorate by adding
OpDecorate instruction for the corresponding element of the resource
array. This commit uses it to preserve RelaxedPrecision decoration used
for resource variables in struct.
2021-11-05 16:43:12 -04:00
Jaebaek Seo e343bec685
[spirv] Support flattening descriptor array accessed by var index (#4042)
The existing DXC cannot a flatten descriptor array when an instruction
accesses it using a variable index, because spirv-opt
--descriptor-scalar-replacement pass did not support it. spirv-opt
recently added --replace-desc-array-access-using-var-index that replaces
accesses to descriptor arrays using variable indices with accesses to
constant elements using switch statements. This commit uses the newly
added pass to support flattening all descriptor arrays.
2021-10-28 10:16:05 -04:00
Chris B 4ca3a04252
Restore LLVM Testing Infrastructure (#4012)
* Restore lit and googletest sources from LLVM 3.7.0

This commit just re-adds sources that were removed somewhere along the
way.

* Pull in googletest & googlemock from LLVM 4.0

Googlemock was introduced in LLVM 4.0, and is used by SPIR-V's tests.
This pulls in the LLVM 4.0 version of GoogleTest and GoogleMock to
replace the external submodules.

LLVM's version of GoolgeTest and GoogleMock have some minor extensions
to work better with LIT for error reporting and producing cleaner test
output.

* Remove external googletest

* Fix lit to handle comment in gtest names

This fix came into LLVM with the updated googletest in a977582dead2

* Ignore raw_fd_ostream errors when not closing

There's some odditites with the changes in the filesystem code that
cause this to error sometimes in unit tests. Until we can dedicate time
to looking into the filesystem code, just swallow that error...

* Fix bot failure

Missed an option change.

* Fixing MSVC build failure

* A cleaner build fix

This should address issues with VS 2019 in a cleaner way.

* Fix build
2021-10-19 15:24:11 -05:00
Jaebaek Seo ebdf8fbdb4
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#4010) 2021-10-14 16:54:24 -04:00
Jaebaek Seo 71cffd43e2
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#3979) 2021-09-30 10:23:47 -04:00
Jaebaek Seo 555f813c4f
[spirv] add -fspv-reduce-load-size option (#3931)
Since loading a big object takes the memory pressure, reduction of the
load size can have some performance benefit. In particular, it is
useful for mobile GPUs. `-fspv-reduce-load-size` removes
OpLoad/OpCompositeExtract of struct/array types by running spirv-opt
--reduce-load-size pass.

Fixes #3889
2021-09-07 23:32:16 -04:00
JiaoluAMD 28e1f9f465
[SPIRV] Update the spirv tools to the later commit (#3923)
The spirv tools need to update to support the Link Attributes of the
Linkage capability
2021-09-01 10:32:34 -04:00
Jaebaek Seo 096afe6e6a
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#3909) 2021-08-19 10:44:07 -04:00
Jaebaek Seo 9972b664a3
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#3878) 2021-07-14 10:46:54 -04:00
Jaebaek Seo cef61b56ec
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#3817) 2021-06-09 20:22:20 -04:00
Jaebaek Seo 377fd9d061
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#3788) 2021-05-20 12:53:07 -04:00
Jaebaek Seo 2501f89613
[spirv] update SPIRV-Tools submodule (#3719) 2021-04-28 10:46:42 -04:00
Jaebaek Seo f66b04f584
[spirv] update SPIRV-Tools submodule (#3718) 2021-04-27 17:11:25 -04:00
Jaebaek Seo 3be3d15fc6
[spirv] update SPIRV-Tools submodule (#3694) 2021-04-20 13:17:41 -04:00
Jaebaek Seo dd8db73da5
[spirv] update SPIRV-Tools and SPIRV-Headers (#3689) 2021-04-15 09:38:36 -04:00
Jaebaek Seo e1915586d2
[spirv] update SPIRV-Tools and SPIRV-Headers (#3597) 2021-03-18 10:51:25 -04:00
seppala2 03cc4f8663
[spirv] Add vk::image_format attribute for Buffers, RWBuffers and RWTextures (#3395)
According to Vulkan specification when using `OpImageRead/OpImageWrite`, the `OpTypeImage` (`Buffers`, `RWBuffers`, `RWTextures`) must have a format that matches the format on the API side, unless the StorageImageReadWithoutFormat/StorageImageWriteWithoutFormat is added and `Unknown` is used as the format.

This pull request addressess #2498 for the format part by adding an attribute `[[vk::image_format("<image format as spelled in SPIR-V spec>")]].` Example of the syntax:

```
[[vk::image_format("rgba8")]]
RWBuffer<float4> Buf;

[[vk::image_format("rg16f")]]
RWTexture2D<float2> Tex;

RWTexture2D<float2> Tex2; // Works like before
```

The `image_format` only applies to **global variables** of type `Buffer`, `RWBuffer`, `RWTexture`. For variables and function parameters it is propagated by the inlining pass in legalization. This required a small change to one of the passes in SPIRV-Tools, that should be also checked by someone more familiar with the codebase: https://github.com/KhronosGroup/SPIRV-Tools/pull/4126

Note that this does not fix the handling of unspecified format (that case still works like before, using `R32f`, etc. based on the type in shader), although it should be still fixed to add the
StorageImageReadWithoutFormat and/or StorageImageWriteWithoutFormat and use Undefined. But I think the ability to specify the format is more urgent.

Design note from Jaebaek:
Since the `image_format` attribute only applies to **global variables**, under the DXC architecture
only `DeclResultIdMapper` can check the attribute when it handles `VarDecl`s. It means
we have to pass the `image_format` information to `LowerTypeVisitor` because it cannot access to
`VarDecl`. In order to pass the `image_format`, we use `SpirvContext` that can be accessed by
`SpirvEmitter` and all visitors. We use `SpirvVariable` to `spv::ImageFormat` mapping because the
attribute only applies to **global variables** (not to image types).
See how we use `llvm::DenseMap<const SpirvVariable *, spv::ImageFormat> spvVarToImageFormat`.
2021-03-01 10:07:40 -05:00
Jaebaek Seo 5bdb83bd4a
[spirv] update SPIRV-Tools and SPIRV-Headers submodules (#3450) 2021-02-18 17:48:27 -05:00
Ehsan 0ec5839e5e
[spirv] Update SPIRV-Tools. (#3365) 2021-01-21 10:22:25 -06:00
Ehsan cc43bc82b9
Update SPIRV-Tools (fix for raytracing termination instructions). (#3306) 2020-12-07 11:28:16 -06:00
Ehsan f28bb1ae4e
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#3296)
Picks up more KHR ray tracing changes.
2020-12-03 11:43:58 -06:00
JiaoluAMD 4ced9bdf05
[SPIRV]Updates to final RayTracing semantics (#3279)
1. Add OpTraceRayKHR
2. Remove "provisional" in files
3. Update the SPIRV Headers/Tools to latest version
2020-11-24 10:03:41 -06:00
Jaebaek Seo 8fea615e3c
[spirv] wrap instructions with OpNoLine (#3229)
The current DXC emits `OpLine` for the first instruction in the location
and does not emit the same `OpLine` for the following instructions.
However, it does not specify the end of the effectiveness of the
`OpLine`, which is technically wrong based on the spec of OpLine and
OpNoLine. We have to specify the `OpLine` is not applied to the
following instructions when we meet an instruction without the location
information.
2020-11-02 14:11:29 -05:00
Jaebaek Seo 12fa61c61b
[spirv] allow debug info generation to use full optmization (#3201)
As SPIRV-Tools supports the debug info preservation for the full
optimization, we want to allow DXC users to use the full optimization
for the debug info generation.

This change updates SPIRV-Tools and SPIRV-Headers.
2020-10-15 12:04:39 -05:00
Ehsan 4f7da65200
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#3156) 2020-09-25 13:58:07 -05:00
Jaebaek Seo 7f985ff472
[spirv] generate OpenCL.DebugInfo.100 instructions (#3155)
OpenCL.DebugInfo.100
is a SPIR-V extended instruction set that provides DWARF style debug information.
This PR allows DXC SPIR-V backend to generate the rich HLSL debug information
using OpenCL.DebugInfo.100 instructions.
2020-09-22 16:50:29 -04:00
alan-baker 711e5e2969
[spirv] Update SPIRV-Tools and SPIRV-Headers (#3074)
* Update SPIRV-Tools and SPIRV-Headers

* SPIRV-Tools build has changed slightly
  * SPIRV-Tools-static is now the target to use instead of plain
    SPIRV-Tools

* Update SPIRV-Tools further
2020-08-11 21:35:19 -05:00
Jaebaek Seo 7c3fa86b07
[spirv] Update SPIRV-Tools (#3015) 2020-07-02 10:01:01 -05:00
Ehsan 2226112125
[spirv] Update SPIRV-Tools (#3007)
* Update SPIRV-Tools.

* [spirv] Update SPIRV-Tools.

* [spirv] Temporarily don't run spirv-val on some tests.
2020-06-29 13:46:47 -05:00
Greg Roth dd27189bab
Enable recompile of shaders with includes in dxc (#2996)
* Enable recompile of shaders with includes in dxc

When recompiling, the dxc executable stores all file blobs under names
that use backslashes. However, when recompiling, the filenames of the
includes in a shader are joined with the directory using a forward
slash. In addition, many authors use forward slashes to separate
subdirectories in these includes. Because of this, no includes could
ever match.

By converting all / in the path to \ just before trying to retrieve the
associated pseudo-file, the file is found. Recompilation is only
supported on Windows presently, so other OS path dividers needn't be
considered. The same native() call that generates the keys originally is
used to generate the keys to retrieve them.

Modify smoke.hlsl to verify that recompilation works
2020-06-26 11:20:56 -07:00
Ehsan fff78ef621
Update SPIRV-Tools. (#2993) 2020-06-24 15:31:55 -05:00
Ehsan a0b812e0fe
[spirv] Update SPIRV-Tools. (#2987) 2020-06-19 12:28:45 -05:00
Ehsan 2f9ad50cab
[spirv] Update SPIRV-Tools. (#2980) 2020-06-17 09:39:02 -05:00
Ehsan e0cde072b0
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#2915) 2020-05-27 16:27:25 -05:00
Minmin Gong a5365731f0
Change HLSL_DISABLE_DEBUG_ITERATORS to more natural HLSL_ENABLE_DEBUG_ITERATORS and flip the default value (#2885) 2020-05-14 10:29:56 -05:00
Minmin Gong 318e625924
Add an option to turn on/off debug iterators (#2879)
Add option to turn on/off debug iterators for more performant or more helpful debug builds
2020-05-13 11:00:35 -07:00
Jaebaek Seo 44fc51f304
[spirv] Update SPIRV-Tools submodule (#2794) 2020-03-26 18:16:34 -05:00
Ehsan 2c6afe2f1b
[spirv] Update SPIRV-Tools and SPIRV-Headers (#2771) 2020-03-18 12:21:35 -05:00
Jaebaek Seo 798b714518
[spirv] update spirv-tools and spirv-headers (#2723) 2020-02-28 09:30:59 -05:00
Jaebaek Seo 80ec7c6bc7
[spirv] update SPIRV-Tools and SPIRV-Headers (#2647)
Fixes #2625
2020-01-15 08:37:14 -05:00