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

1057 Коммитов

Автор SHA1 Сообщение Дата
Xiang Li 357803d342
Don't sink sample coordinate into control flow. (#1188) 2018-03-29 16:33:59 -07:00
Ehsan 677eaa83cb
[spirv] Update SPIR-V Tools. (#1185) 2018-03-29 12:32:33 -04:00
Lei Zhang 241d32c810
[spirv] Allow explicitly controlling SPIR-V extensions (#1151)
Added FeatureManager to record all extensions specified from
the command-line and emit error if trying to use one not permitted.

Added command-line option -fspv-extension= to specify
whitelisted extensions.
2018-03-27 17:42:16 -04:00
Lei Zhang 725ecab3b9
[spirv] Add support for arrays of resources (#1184)
An array of resources will be translated into an SPIR-V array
behind one single descriptor.
2018-03-27 17:20:14 -04:00
Marcelo Lopez Ruiz 7dcbce5b5f
Adds support for an external viewer to dndxc (#1181)
This is configurable via Tools | Options. The '%in' string will be replaced with the path to a temporary file with the rewritten XML, with the shaders within their respective nodes.
2018-03-27 12:33:16 -07:00
Ehsan 4e5e56d0cd
[spirv] Update SPIR-V Tools and Fix Builtin usage. (#1183)
Support uint/uint2 for DispatchThreadID
Support uint/uint2 for GroupThreadID
Support uint/uint2 for GroupID

Also updated SPIR-V Tools.
2018-03-27 13:06:27 -04:00
Sebastian Tafuri 44dff38588 Silence unusued variable warning when building without asserts (#1073)
* Silence unusued variable warning when building without asserts

* Spaces instead of tabs

* Replaced DXASSERT with DXASSERT_LOCALVAR instead
2018-03-27 09:27:17 -07:00
Lei Zhang 236cdc1cdf
Hook up --help-hidden with PrintHelp() (#1060)
We have defined --help-hidden in HLSLOptions.td but the compiler
is not set up to respect it. This commit hooks up them.
2018-03-27 12:08:11 -04:00
Lei Zhang 31b29d89c0
[spirv] Skip all TypeDecls when calculating memory layouts (#1179) 2018-03-27 09:06:21 -04:00
Lei Zhang 18f9bea95e
Require ConstantBuffer/TextureBuffer arguments to be structs (#1177)
fxc errors out if the template argument for ConstantBuffer or
TextureBuffer is not a struct type with "D3D12 constant/texture
buffer template element can only be a struct". This commit
enforces that behavior on dxc.
2018-03-27 08:02:02 -04:00
Marcelo Lopez Ruiz 6a508e3b7a
Adds support for HS/DS/GS to shader tests and dndxc. (#1180) 2018-03-26 21:44:28 -07:00
Helena Kotas 334358f898 Allow void in function parameter list
Fixes #1064
2018-03-26 14:59:56 -07:00
Helena Kotas 4eceb6331c Unify HLSL Change comments 2018-03-26 14:59:56 -07:00
Xiang Li 9476863370
Use lshr for uint vectors and remove the and for shift. (#1174) 2018-03-26 09:57:50 -07:00
Marcelo Lopez Ruiz 8e71204325
Fixes failures in two execution tests that used SRVs (#1175)
Longform explanation:
Views/descriptors over resources may specify some non-default properties.

The prior implementation was trying to check values and infer whether
they had been set or were forcibly needed. For starters, this wasn't
always properly initialized, so results were not consistent. Guessing
at this point is a bad idea in any case, so the new implementation
keeps track of whether anything was in fact specified (and if so, values
should have been initialized by the reader, although that is still WIP
for some cases).
2018-03-24 11:56:16 -07:00
Helena Kotas 4e1fd2f245
Add 'implicit truncation of vector type' warning (#1173)
* Add 'implicit truncation of vector type' warning

There was no warning when the truncation happened
due to a binary operation.

Fixes #1159

* Whitespace fix
2018-03-23 17:13:07 -07:00
Ehsan c66c37cfa1
[spirv] Add support for DeviceIndex builtin. (#1171) 2018-03-23 10:40:02 -04:00
Young Kim c5bdb33922
fix check ddi version for < rs3 (#1169) 2018-03-22 16:51:53 -07:00
Helena Kotas 841e0d470b
Matrix and vector binary operations and conversions fix (#1170)
The compiler was crashing on binary operations used on vectors and
matrices of varying sizes. This fix aligns the matrix/vector conversion
behavior and allowed combinations with FXC.

Vector initialization from matrices of equivalent dimensions now works
as well.

Fixes: #1090, #1157
2018-03-22 13:16:06 -07:00
Ehsan 3c511a0959
[spirv] Support TextureBuffer/ConstantBuffer arrays. (#1166) 2018-03-22 13:53:24 -04:00
Lei Zhang 66a8998f87
[spirv] Translate SV_InnerCoverage into FullyCoveredEXT (#1165)
Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/999
2018-03-22 10:08:43 -04:00
Shawn Farkas 368aead044
Add an isAlwaysUniform property to instructions (#1168)
Add an isAlwaysUniform property to instructions
2018-03-21 18:51:00 -07:00
Young Kim 1a5cb0fbe2
skip debugname part adding test for 1.3 (#1167) 2018-03-21 18:00:04 -07:00
Marcelo Lopez Ruiz 1fea2b7162
Adds support for basic SRV resources and some help to dndxc. (#1160)
Add an optional extended description…
2018-03-21 16:18:05 -07:00
Lei Zhang 01fb45c865
[spirv] Unify checks for skipping struct fields in layout (#1164) 2018-03-21 15:44:22 -04:00
Ehsan e2f2942a45
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#1163) 2018-03-21 13:54:56 -04:00
Lei Zhang d6dfe83f0a
[spirv] Skip cbuffer/tbuffer when creating $Globals (#1162) 2018-03-21 12:48:20 -04:00
Lei Zhang 4cfcdf3239
[spirv] Emit single store for cross-storage-class composite types (#1158)
Previously we emit a store for each sub-element, which is not
friendly to SPIR-V transformations. This commit converted that
into first constructing a temporary value of the target storage
class, and the store once.
2018-03-21 10:55:43 -04:00
Lei Zhang 9b0167be56
[spirv] Add support for :packoffset() (#1156) 2018-03-20 12:18:31 -04:00
Xiang Li a489c2ec25
Transform mad(a, 0, b) into b. (#1150) 2018-03-19 18:04:56 -07:00
Lei Zhang 5a4987c664
[spirv] Update SPIRV-Headers & SPIRV-Tools (#1154)
* SPIRV-Tools now uses unified grammar tables.
* SPIRV-Tools merge return pass now can handle structured CFG.
2018-03-19 17:36:33 -04:00
Lei Zhang 0d8a15a61a
[spirv] Better reflection support via new extensions (#1111)
This commit uses the HlslCounterBufferGOOGLE decoration to link
the main RW/Append/Consume StructuredBuffer with its associated
counter buffer. It also uses HLSLSemanticGOOGLE to decorate
stage IO variables with their semantic strings from the source code.
2018-03-17 13:05:31 -04:00
Young Kim f174990c6e
Fix checking LoadInput for GetAttributeAtVertex for no Opt (#1149) 2018-03-17 08:45:46 -07:00
Lei Zhang cfd787a18e
[spirv] Cull RHS of shift operations (#1148)
In SPIR-V, if shifting a value by an amount that is greater than
the value's bitwidth, the result is undefined.

FXC and DXC/DXIL performs a bitwise and over the RHS of the shift
operation to only consider its (n - 1) least significant bits,
where n is the bitwidth of LHS.
2018-03-16 20:19:20 -04:00
Ehsan be8c74dd4f
[spirv] Booleans do not have a physical layout. (#1140)
* [spirv] Booleans do not have a physical layout.

Addresses issue #1136.
2018-03-16 17:58:08 -04:00
Grant 18138ff8cf Handle more complex addressing modes (#1147)
Fix HoistConstantArray pass to recognize more complex load & store patterns.

Previously it was expecting no nesting and just a simple list of GetElementPtr's that fed loads or stores. Now it can accept a tree (DAG) of GetElementPtrs that feed leaf node loads or stores.
These patterns cannot be directly derived from HLSL, however they can occur due to previous optimizations that transform the array accesses (like a partial CSE or similar).
2018-03-16 14:29:36 -07:00
Lei Zhang 5d557ccb34
[spirv] Revamp matrix majorness handling (#1144)
Previously we use an additional parameter to translateType()
to convey the matrix majorness info. It causes lots of type
inconsistency issue.

Now the majorness info is queried directly from the QualType.
This should be more robust.
2018-03-16 15:15:28 -04:00
Lei Zhang f6f79e744d
[spirv] Emit OpSource debug instruction (#1145) 2018-03-16 13:40:00 -04:00
Ehsan 3dea2cbcc4
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#1143) 2018-03-15 14:00:41 -04:00
Lei Zhang e3662ff353
[spirv] Collect global non-resource variables into $Globals (#1138)
This commit changes the behavior of how to handle externally-visiable
non-resource-type stand-alone variables. Previously they are emitted
as stand-alone SPIR-V variables. Now they are grouped into a cbuffer
that named as $Globals. This is more aligned with how DirectX handles
them.
2018-03-14 11:15:14 -04:00
Lei Zhang cac1bd02a5
[spirv] Refresh external projects (#1139) 2018-03-13 17:17:03 -04:00
Lei Zhang c133d935eb
[spirv] Support SM6.0 wave ops using Vulkan 1.1 (#1118)
Support promoting to SPIR-V 1.3 when necessary

Support SM6.0 wave query and vote ops

* WaveIsFirstLane
* WaveGetLaneCount
* WaveGetLaneIndex
* WaveActiveAnyTrue
* WaveActiveAllTrue
* WaveActiveBallot

Support SM6.0 wave reduction ops

* WaveActiveAllEqual
* WaveActiveCountBits
* WaveActiveSum
* WaveActiveProduct
* WaveActiveBitAnd
* WaveActiveBitOr
* WaveActiveBitXor
* WaveActiveMin
* WaveActiveMax

Support SM6.0 wave scan/prefix ops

* WavePrefixSum
* WavePrefixProduct
* WavePrefixCountBits

Support SM6.0 wave broadcast ops

* WaveReadLaneAt
* WaveReadLaneFirst

Support SM6.0 quad-wide shuffle ops

*  QuadReadAcrossX
*  QuadReadAcrossY
*  QuadReadAcrossDiagonal
*  QuadReadLaneAt
2018-03-13 15:24:48 -04:00
Helena Kotas 20353da208
Fix anonymous struct cbuffer (#1134)
Anonymous structures were not added to $Globals because they are
not externally visible.

Fixes #1075: dxcompiler drops anonymous struct cbuffer
2018-03-13 12:23:22 -07:00
Xiang Li d66d48721f
Set default input control point count to 1. (#1135) 2018-03-13 11:06:30 -07:00
Lei Zhang c859bb040f
[spirv] Support SPV_KHR_shader_draw_parameters (#1127)
Added support for the following SPIR-V builtins exposed in
SPV_KHR_shader_draw_parameters:
* BaseVertex
* BaseInstance
* DrawIndex
2018-03-13 10:07:54 -04:00
Tex Riddell 9beafa70b4
Skip deadInsts in SimpleTransformForHLDXIR to prevent AV (#1129) 2018-03-12 12:59:32 -07:00
Tex Riddell dcaad9e14c
Fix scalarizer for shuffle on vector produced later (#1128) 2018-03-12 12:58:48 -07:00
Tex Riddell c842450dfd
DxcOpts: init flags, FileCheckerTest: fix error handling for ReadDxcOpts. (#1126) 2018-03-12 12:57:03 -07:00
Tex Riddell d2f227b210
hctstart.cmd - flexible SDK detection using min version (#1121)
- match method and reg keys used by cmake script
2018-03-12 12:56:17 -07:00
Tex Riddell 571ff78e00
DPF on llvm_assert. (#1115) 2018-03-12 12:55:31 -07:00