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

2219 Коммитов

Автор SHA1 Сообщение Дата
Adam Yang e32833cac7
Loop count for all trivial form loops. Mem2Reg only when necessary. (#2250)
* Comments and small adjustments

* Deleting loops from scalar evolution correctly

* Better error/warning message
2019-06-07 18:40:43 -07:00
Tristan Labelle f749543a76
Fix buffer overflow in debug printing. (#2248) 2019-06-07 11:58:36 -07:00
JasperNV 4f487432ad [spirv] Add support for SV_ShadingRate as a PS input (#2226)
* Add support for SV_ShadingRate as a PS input

Solves a portion of #2208.

* Fix small typo in error message
2019-06-06 17:15:21 -04:00
Adam Yang bbf44f7a22
Fixed a crash with passing struct array element to functions (#2245) 2019-06-05 17:09:25 -07:00
Adam Yang dc6203ad5b
unroll(n) can now override loop bound. unroll(negative) now fails correctly (#2241) 2019-06-05 13:34:17 -07:00
Jaebaek Seo 213de5049f
[spirv] same variable for legalization and before-hlsl-legal (#2244)
We should have the same decision for HLSL legalization of spirv-opt
and --before-hlsl-legalization option of spirv-val.
2019-06-05 12:06:37 -04:00
Xiang Li c41ab4fe6c
Don't generate cond branch for scalar ternary conditional operator. (#2239) 2019-06-04 15:33:29 -07:00
Jaebaek Seo 6422947c35 [spirv] add unittest for sizeof() (#2231) 2019-06-04 17:50:22 -04:00
Jaebaek Seo b61633ad00 [spirv] fix vector size 1 argument bug of seturate() (#2228)
Fixes #2223
2019-06-04 17:49:46 -04:00
Tim Jones 9d31464b57 Expose code completion API (#2222)
Initial code completion API implementation
2019-06-04 08:01:42 -07:00
Ehsan 101730c57b
[spirv] Respect the -auto-binding-space option in SPIR-V backend (#2211)
* [spirv] Respect the -auto-binding-space option in SPIR-V backend.

* [spirv] Use default space if vk::binding doesn't provide dset.

* Address code review comments.
2019-06-04 09:35:04 -04:00
alelenv 196b1ac14b Remove unused enum ContextUsageKind from SpirvInstruction. (#2232) 2019-06-03 15:07:00 -04:00
Ehsan cc175db5c1
[spirv] Remove SpirvEvalInfo which is not used any longer. (#2227) 2019-05-31 16:21:24 -04:00
Helena Kotas 53e49d7289
Move nuget.config and packages.config to hct directory (#2225)
Remove files that are no longer needed and delete pkges directory
2019-05-31 13:08:41 -07:00
Helena Kotas bbdf4ee1fe
hctstart.cmd - look for Python 3 instead of Python 2 if python.exe is not on the path (#2224) 2019-05-31 13:07:57 -07:00
Adam Yang 8da9314cb1
Fixed a compiler warning with unsigned/signed mismatch (#2221) 2019-05-30 15:58:39 -07:00
Jaebaek Seo 3333e4e1f8
[spirv] --relax-logical-pointer to --before-hlsl-legalization (#2220) 2019-05-30 15:13:03 -04:00
Adam Yang 2dec1cd0df
Putting debug info in PDB container (#2215) 2019-05-29 16:29:58 -07:00
Ehsan 4ff3229f68
[spirv] Add OpName for specialization constants. (#2216) 2019-05-29 13:48:23 -04:00
Greg Roth 8ebb86399d Hide Unix symbols by default (#2213)
* Hide Unix symbols by default

Using the -fvisibility=hidden by default only exposes symbols that have
the __attribute__((visibility("default"))) attribute applied to them.
There are only a couple of functions that are meant to be exposed from
libdxcompiler. To expose the proper functions, the macros used to create
the UUIDs for class types are redefined with the attribute and
DXC_API_IMPORT is defined with the attribute above for non-windows
platforms.

Since we're hiding everything now, the portions that were explicitly
hidden to make MacOS work are removed.

This exposed a number of missing dependencies of libraries and unit
tests. Namely clang-hlsl-tests, clang-spirv-tests, and libclangCodeGen.

Resolves #2203

* Remove explicit marking of DxcThreadMalloc hidden

This was a workaround that is not longer necessary since all symbols are
hidden by default on Unix platforms now.
2019-05-29 12:56:02 -04:00
Jaebaek Seo c9b258a40c
[spirv] allow illegal storage/isomorphic function arg (#1991)
Before this change, decision of creating temporary variables for
function arguments were affected by three things: storage class,
param type, out or inout keyword. For example, if storage class of
a function arg is different from the param, we create a temporary
variable whose storage class is the same with the param and store
the function arg before the function call. After the function call
we store the value to the actual arg if needed.

Now based on HLSL legalization supported by spirv-opt, we do not
need to consider storage class. Similarly, we do not need to
consider type difference between arg and param if they have an
isomorphic type e.g., same structure but different names.
2019-05-27 17:11:10 -04:00
Tex Riddell 1d72beb39c
Add shader hash blob part (#2212)
- Change default to hash/name based on binary, not source
- Allow inclusion of hash/name without debug info (/Zi)
2019-05-24 17:17:12 -07:00
Tex Riddell 946993c010
Merge pull request #2209 from microsoft/dxil-1-5
Merge Dxil 1.5 branch to master
2019-05-24 15:34:55 -07:00
Tex Riddell af50891d4c
Build: Fix break with clang/gcc (#2210) 2019-05-24 14:33:24 -07:00
Tex Riddell a3d0bf98c2
Merge pull request #2204 from tex3d/dxil-1-5
Merge changes from master to dxil-1-5
2019-05-24 11:08:25 -07:00
Jaebaek Seo 8ebb274f32
[spirv] Emit better line info (#2127) 2019-05-24 12:18:04 -04:00
Minmin Gong 2dc416fc6b Enable to detect DIA SDK in VS2019 (#2136) 2019-05-23 11:25:14 -07:00
Tex Riddell 04fb1d6468 Merge remote-tracking branch 'ms/master' into dxil-1-5 2019-05-22 15:34:19 -07:00
Tex Riddell dfae866e19 Build: Update NumOpCodes static_assert in PIX pass 2019-05-22 15:30:47 -07:00
Jaebaek Seo a56693ee05
[spirv] update SPIRV-Tools and SPIRV-Headers (#2199) 2019-05-22 09:41:16 -04:00
JasperNV cc64a35288 hctgettaef: Update for Python 3 (#2195)
Python 2 was dropped from the project, but this utility still required it.
2019-05-21 11:01:45 -07:00
John Porto c9b9676c5d
User/joporto/dxcmem refactor (#2196)
* Moves the implementation of DxcThreadMalloc to dxcmem.cpp; removes DxcSwapThreadMalloc

* Remove DxcSetThreadMalloc(OrDefault) -- they were always been used for installing the default allocator

* Deletes copy and move ctors and assignment

* stores the allocator in the TLS slot.

* DxcSwapThreadMalloc should be able to install a null allocator

* Marks the DxcThreadMalloc members as hidden (linux only)
2019-05-20 20:52:10 -07:00
Tex Riddell ba668cf13e Merge remote-tracking branch 'ms/master' into dxil-1-5 2019-05-20 11:49:53 -07:00
Tristan Labelle c9aa79b127
Fix tests which /Zi makes trivially succeed (#2171)
/Zi should be used with much care in FileCheck tests, because the contents of the test file gets embedded into the output, so any CHECK: lines will match by default because they will match themselves in the quoted source file.

This change removes /Zi from most tests which should not have it anyways. Several tests had to be updated or deleted because they weren't actually passing. All tests with /Zi remaining are now under the debug subfolder and reference the readme file that explains the gotcha.
2019-05-20 10:55:49 -07:00
Adam Yang f240070cf1
Fixed issues that change codegen when there's debug info. (#2190) 2019-05-17 13:35:08 -07:00
Tristan Labelle d7f794c3c5
Fix a crash and bad codegen with operators on vectors (#2192) 2019-05-17 12:08:17 -07:00
Helena Kotas fdd4e3b0e6
Update version to 2019.05.00 (#2194) 2019-05-16 11:39:39 -07:00
alelenv b830b09bc5 [spirv] Add support for [[vk::shader_record_nv]] (#2179)
* Add support for [[vk::shader_record_nv]]

* Fixes after first review of ehsannas.
2019-05-16 00:36:28 -04:00
Tristan Labelle 347c04d51c
Split DxilGenerationPass.cpp into several files for its several passes (#2180) 2019-05-15 08:59:16 -07:00
Jaebaek Seo dd183fec9f
Force cmake to use python3 (#2187)
Force cmake to use python3
2019-05-15 09:56:11 -04:00
Adam Yang 716a113650
Fixed a bug where necessary code gets deleted with library shaders. (#2185)
Deleted some old code where we manually delete users of resource GV's while stripping debug modules. This is normally unnecessary but harmless, because we are guaranteed to have reduced all resource variables, and any failure to do so would result in a validation failure. However, library shaders can have resource variables. Removing the instructions here would result in incorrect code.
2019-05-14 11:10:46 -07:00
Adam Yang 24e71b12e5
Fixed a validation failure with stripping reflect with library shaders. (#2182) 2019-05-14 08:00:08 -07:00
Tristan Labelle a6776de932
Support operator sizeof (#2178)
To complement the new [RW]ByteAddressBuffer.Load/Store<T> feature, it's useful to have operator sizeof to compute offsets. This supports both type and expression forms of the operator, as in C++. The size returned is consistent with struct layouts in StructuredBuffer, but not necessarily with that of constant buffers, which use different rules. Using sizeof on resources or aggregates containing resources will result in a compile-time error. It is only supported for "blittable" types.
2019-05-10 13:50:37 -07:00
John Porto 0e704e1ea2
DxilDia uses factories (not lambdas) for symbol creation (#2177)
* Modifies DxilDia's to use factories instead of lambdas for creating symbols

DxilDia used to hold a vector of lambdas -- constructors -- for the symbols
it knew about. When the user requested a symbol, said constructor was to be
invoked, creating a brand new symbol.

C++ lambdas can be hard to debug (i.e., how does one inspect the lambda's
state?), so the library is modified to hold a vector of factories -- i.e.,
objects with fields and a CreateSymbol method.

* fixes typo when creating Typedef symbols

* caches the VarInfo when creating the LocalVariable factories
2019-05-10 11:00:24 -07:00
Tristan Labelle 17624a864b
Support space-only resource register annotations (#2163)
This change adds support for : register(spaceN), where a space is specified but no register, such that the resource allocator runs on the given space.

For backwards compatibility, -auto-binding-space applies to resources without register bindings but not to those with an explicit register assignment like : register(t0) - those always go in space 0. To support this, I had to add state to represent "unspecified space". In the UnusualAnnotation, it's a Optional<uint32_t>. In the DxilResource, it's UINT_MAX, like we do for unspecified registers.
2019-05-09 12:15:05 -07:00
Tristan Labelle f89e3b7150
Add support for RWRawByteBuffer.Store<T> (#2176)
Adds support for templatized RWRawByteBuffer.Store<T>. To avoid SROA making us lose the original layout of any struct arguments, a new pass runs before SROA and breaks down such cases into per-element stores. So better be careful with the likes of buf.Store(0, (int[65536])0);...
2019-05-09 11:51:38 -07:00
Tristan Labelle 7dace2aa44
Support %dxilver in filerun commands for CodeGenHLSL tests. (#2174)
Several tests could not be added to the batch run folder because they had a SkipDxilVersion test. This change allows this test to be performed in a // RUN: line, so that the tests can be moved to the batch folder. It also includes a small refactoring of FileRunCommandPart
2019-05-09 11:49:51 -07:00
Helena Kotas ed44f7ff70
Add TablegenHLSLOptions dependency to dxcompiler (#2175)
Fixes build break in parallel builds
2019-05-08 13:41:58 -07:00
Tristan Labelle 3a7e6d38de
Add support for generalized templated byte address buffer loads (#2159)
Implements [RW]ByteAddressBuffer.Load<T> for all numerical or aggregate of numerical Ts, leveraging the same code from StructuredBuffer<T>.Load.
2019-05-08 11:39:25 -07:00
Tristan Labelle 7342a3b9be
Added missing semicolon in struct layout output (#2173) 2019-05-07 15:34:52 -07:00