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

123 Коммитов

Автор SHA1 Сообщение Дата
Lei Zhang 1f4d17985a
[spirv] Update SPIRV-Tools for bug fixes (#1580) 2018-10-02 09:40:55 -04:00
Lei Zhang 8e6b468c4d
[spirv] Fix Wave*CountBits() and improve compilation time (#1574)
Fixed the compilation time regression introduced by loop
unrolling by updating SPIRV-Tools.
2018-09-27 12:20:23 -04:00
Lei Zhang de2736fe9a
[spirv] Enable loop unrolling in legalization (#1553) 2018-09-20 10:18:15 -04:00
Lei Zhang 1d850724c3
[spirv] Update external projects (#1546) 2018-09-18 15:47:41 -04:00
Lei Zhang 815c450f56
[spirv] Update SPIRV-Tools for bugfixes and workarounds (#1510) 2018-08-23 16:39:14 -04:00
Lei Zhang 4723ad416e
[spirv] Update SPIRV-Tools for fixes (#1507) 2018-08-21 14:11:02 -04:00
Lei Zhang 698dadd629
[spirv] Refresh dependencies & disable validation before optimization (#1504) 2018-08-20 16:48:54 -04:00
Lei Zhang b0366437d1
[spirv] Update SPIRV-Tools (#1482) 2018-08-02 14:44:00 -04:00
Ehsan 90103b38c2
[spirv] Expose -Oconfig for running custom optimizer recipes (#1466) 2018-07-31 13:49:19 -04:00
Lei Zhang 12c5b89389
[spirv] Fix constant type mismatch in SPIRV-Tools (#1427) 2018-07-16 15:15:41 -04:00
Lei Zhang 01aad25f44
[spirv] Pull in vector shuffle fixes in SPIRV-Tools (#1424) 2018-07-13 19:09:11 -04:00
Lei Zhang 56ffc8a239
[spirv] Fix Vulkan layout struct member alignment error (#1418)
For VK_HKR_relaxed_block_layout, a vector inside structs can have
its offset as a multiple of its base element type's alignment.
But the vector's alignment is unaffected, esp. when used for
calculating the alignment of the whole enclosing struct.

Also enables SPIRV-Tools validation on block layouts.
2018-07-12 11:50:16 -04:00
Lei Zhang a2dc672b9d
[spirv] Update SPIRV-Headers & SPIRV-Tools (#1404) 2018-07-05 15:28:32 -04:00
Lei Zhang f13e38579d
[spirv] Pull in optimization fix for un-merging struct types (#1395) 2018-06-29 17:10:23 -04:00
Lei Zhang f21c44400a
[spirv] Update SPIRV-Tools for not merging resource types (#1385)
Keeping the original struct type is important for some reflection
workflows.

The validation check for layout is alo included. But we disable
it for now and will re-enable it after fixing all the failures.

Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/1364
2018-06-27 20:54:38 -04:00
Lei Zhang e142881084
[spirv] Update external dependencies (#1355) 2018-06-19 20:04:22 -04:00
Ehsan eb37d4ae2b
[spirv] Update SPIRV-Tools. (#1348) 2018-06-12 15:00:48 -04:00
Greg Roth f8fa9c92a0 [linux-port] disable covered-switch-default warning (#1332)
Defaults in switch statments can mask warnings that might
indicate that a new enum value was added and corresponding changes
to a switch statement that relies on that enum are missed. For this
reason, clang reports when switch statements that fully define case
statements for all possible enum values contain default: statements.

However, this is a warning of a potential problem that might arise
from future changes to the code rather than anything that might be
wrong now. Additionally, while unlikely that an enum switch might
be presented with a value that isn't valid for that enum, it isn't
impossible. So rather than respect this warning, we will silence it.
It's not included by default. LLVM wanted it. We don't, so it's
removed. This makes the earlier external cmake change unnecessary.
Ignores 34 clang warnings
2018-06-04 05:53:02 +08:00
Greg Roth 4aa0f706c8 [linux-port] Fix spirv test warnings (#1337)
clang-spirv-tests uses a lot of external projects that keep
themselves clean with different standards of warnings flags.
This alters the appropriate cmake files to disable flags that
the DXC build enables.
Fixes 72 gcc and 166 clang warnings.

Additionally catch some sign mismatch comparisons in tests
built as part of clang-spirv-tests.
Fixes 2 gcc and 2 clang warnings, but one of them has multiple sources
So it's kind of a lot more.
2018-06-02 04:16:29 -04:00
Ehsan fb581f6228
[spirv] Update SPIR-V Tools. (#1334) 2018-06-01 12:45:40 -04:00
Ehsan 37c35f2f6e
[linux-port] Update CMake files. prepare for Linux. (#1312)
This CL makes changes to CMake files in order to:
1- disable things that are not supported on non-Windows platforms.
2- make cross-platform compilation possible.

It also brings back LLVM's config.guess (mirrors:
https://github.com/llvm-mirror/llvm/blob/master/cmake/config.guess)
2018-05-29 15:19:37 -04:00
Lei Zhang 24dcc8c8bc
[spirv] Update external projects (#1303) 2018-05-23 15:23:17 -04:00
Lei Zhang d849dc2b86
[spirv] Support ViewportIndex & Layer in VS and DS (#1290)
Using SV_RenderTargetArrayIndex (translated into Layer builtin)
and SV_ViewportArrayIndex (translated into ViewportIndex builtin)
in VS and DS output requires the SPV_EXT_shader_viewport_index_layer
extension.
2018-05-16 15:01:46 -04:00
Lei Zhang f1a032e946
[spirv] Update external dependencies (#1286)
* ConstOffsets now requires ImageGatherExtended capability
* This reverts commit ea1bf8d24c.
2018-05-14 16:48:20 -04:00
Greg Roth e7973d1525 Match throws and use standard string exception (#1264)
Some compilers require function prototypes and bodies to match with
throw() attributes. This corrects them.

Additionally, it replaces thrown std::exceptions with a string
parameter with runtime_errors, which can take a string on any
system.

Finally, I moved GetPosition in FileIOHelper.cpp to its proper
place with the rest of the AbstractMemoryStream implementation
instead of grouping it with the IDxcBlob implementation

Nonfunctional change. Just inching toward cross platform compatibility
2018-05-08 15:06:07 -04:00
Lei Zhang 534609c016
[spirv] Refresh SPIRV-Tools (#1262) 2018-05-07 13:01:19 -04:00
Lei Zhang b999582c7b
[spirv] Update external projects (#1255) 2018-04-27 16:59:55 -04:00
Ehsan a532921034
[spirv] Update SPIR-V Tools. (#1252) 2018-04-26 16:04:32 -04:00
Ehsan ed3628ccd0
[spirv] Update SPIR-V Tools. (#1247) 2018-04-24 16:48:36 -04:00
Lei Zhang 72af488d75
[spirv] Update SPIRV-Tools for compilation speed improvements (#1240) 2018-04-18 18:39:36 -04:00
Lei Zhang c2993ddf37
[spirv] Stop emitting SPV_GOOGLE_decorate_string (#1229)
Its functionality is subsumed by SPV_GOOGLE_hlsl_functionality1.

See https://github.com/KhronosGroup/SPIRV-Registry/pull/4
2018-04-16 10:19:51 -04:00
Lei Zhang db417e9ad5
[spirv] Update external projects (#1205) 2018-04-09 10:10:49 -04:00
Lei Zhang 3a6c072fd1
[spirv] Refresh SPIRV-Tools (#1197)
* Canged to use max_digits10 for float precision
* Fixed bugs regarding OpImageTexelPointer

Fixes https://github.com/Microsoft/DirectXShaderCompiler/issues/1194
2018-04-05 12:41:26 -04:00
Ehsan 677eaa83cb
[spirv] Update SPIR-V Tools. (#1185) 2018-03-29 12:32:33 -04: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
Ehsan e2f2942a45
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#1163) 2018-03-21 13:54:56 -04: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
Ehsan 3dea2cbcc4
[spirv] Update SPIRV-Tools and SPIRV-Headers. (#1143) 2018-03-15 14:00:41 -04:00
Lei Zhang cac1bd02a5
[spirv] Refresh external projects (#1139) 2018-03-13 17:17:03 -04:00
Lei Zhang 89bc301735
[spirv] Refresh external projects for SPIR-V 1.3 (#1117) 2018-03-07 14:07:48 -05:00
Lei Zhang 8bfb20d76d
[spirv] Update SPIRV-Tools (#1102) 2018-02-27 15:50:39 -05:00
Lei Zhang 5c4ca12efc
[spirv] Update doc and SPIRV-Tools (#1088)
Add explanation of legalization, optimization, validation in doc.
2018-02-21 14:12:01 -05:00
Lei Zhang 4221a698e1
[spirv] Support WaveGetLaneCount() and WaveGetLaneIndex() (#1077)
They are translated into SPIR-V builtin varibles. The translation
requires the SPV_KHR_shader_ballot extension.
2018-02-21 10:34:01 -05:00
Lei Zhang db62d63125
[spirv] Update SPIRV-Tools (#1084)
This is for both bugfixes and performace improvements.
2018-02-20 16:35:20 -05:00
Lei Zhang a19e61696e
[spirv] Update SPIRV-Tools to pull in fixes (#1076) 2018-02-15 13:20:05 -05:00
Lei Zhang ae8c5febf7
[spirv] Turn on legalization for invalid opcode (#1058)
Certain opcodes are not available in non-pixel stages.
Call the pass to replace them.
2018-02-06 15:32:53 -05:00
Lei Zhang 67770e37d4
[spirv] Use invalid instruction replacement legalization pass (#1051) 2018-02-02 12:20:34 -05:00
Lei Zhang 14c3c0d92c
[spirv] Add initial support for specialization constant (#1009)
This commit add support for generating OpSpecConstant* instructions
with SpecId decorations. Spec constants are only allowed to be of
scalar boolean/integer/float types. Using spec constant as the array
size does not work at the moment.
2018-01-22 15:36:14 -05:00
Jeff Noyle ad3e51b1dd
New pass for PIX "shader access tracking" (#998)
* py changes

* checkpoint

* wrong overloads for a couple ops

* Correct out-of-range checking

* test

* RTV

* Add shader access tracking and reportage of dynamically indexed registers

* Uniquify and encode proper register index!

* remove unncessary noise

* rename a var
2018-01-19 14:47:06 -08:00
Lei Zhang 8ba5715c81
[spirv] Use unified1 grammars and headers in SPIRV-Headers (#1007)
This requires us to regenerate the InstBuilder class and also
manually pin the SPIR-V version as 1.0 instead of relying on
spv::Version.

Also refreshed SPIRV-Tools
2018-01-18 15:14:05 -05:00
Lei Zhang 4b2cbf2167
[spirv] Legalization: associated counters in implicit objects (#1002)
An implicit object is translated into the first argument to the
method call. If the implicit object is of struct type and its
fields have associated counters, we need to assign its associated
counters accordingly like other normal arguments.

For each such method, we generate associated counters for its
implicit object. At a call site, we assign the associated counters
from the real object to the ones associated with the method implict
object.

Also refreshed SPIRV-Tools
2018-01-15 17:10:28 -05:00
Lei Zhang 6b2ad7fafb
[spirv] Fix array of non-matrix with -Zpr (#984)
Previously we will return defaultRowMajor as long as the type
is an array. That will hit an assertion failure in translateType()
for arrays of non-matrices.

Also refreshed SPIRV-Tools
2018-01-10 10:27:12 -05:00
Lei Zhang faf46e28be
[spirv] Fix bugs and re-enable CCP optimization pass (#977) 2018-01-08 17:37:31 -05:00
Lei Zhang 02bc6fae08
[spirv] Legalization: validate with relaxed logical pointer (#975)
We still want to make sure that the generated raw SPIR-V does not
have other validation errors except for allocating variables
containing pointers and returning pointers.
2018-01-08 14:08:48 -05:00
Lei Zhang 2387f691e2
[spirv] Pull in bug fixes and disable CCP in optimization (#971) 2018-01-05 20:21:13 -05:00
Lei Zhang 7ff9ae75e8
[spirv] Refresh dependencies and fix ldexp() translation (#962)
We cannot use GLSL extended instruction Ldexp for ldexp() since
they have different type requirements on the exponent parameter.
2018-01-04 14:34:36 -05:00
Lei Zhang 4bee20cac9
[spirv] Legalization: use CCP and enable on HS/DS/GS (#948) 2017-12-21 16:20:52 -05:00
Lei Zhang dfa66b6b9a
[spirv] Refresh SPIRV-Tools and update legalization pass recipe (#946) 2017-12-21 10:44:56 -05:00
Lei Zhang 674aa26115
[spirv] Refresh external dependency SPIRV-Tools (#910) 2017-12-12 13:34:32 -05:00
Lei Zhang ea1bf8d24c
[spirv] Silence GoogleTest std::tr1 deprecation warnings (#894) 2017-12-07 11:01:49 -05:00
Lei Zhang fb377afe5a
[spirv] Add missing capability for storage image read/write (#870)
Refreshed SPIRV-Tools and re-enabled all validations for texure/
buffer methods.

Also added support for -Cc to color the disassembly.
2017-12-01 17:28:56 -05:00
Lei Zhang 05057495e8
[spirv] Adopt new changes in SPIRV-Tools (#846)
Uses the legalization pass recipe from SPIRV-Tools.

Also change -fcgl to disable both legalization and optimization.

Validation on some tests are turned off because of new image
instruction checking in SPIRV-Tools. Enabling them is a TODO.
2017-11-23 22:30:49 -05:00
Lei Zhang ac8618ab07
[spirv] Update SPIRV-Tools and mark resource write legalization (#839) 2017-11-22 13:59:27 -05:00
Lei Zhang 3caadf5001
[spirv] Update external dependencies (#779) 2017-11-09 10:26:33 -05:00
Lei Zhang 4046ce318a [spirv] Update dependencies and use two new opt passes (#735) 2017-10-25 16:43:54 -04:00
Lei Zhang 62629d982a [spirv] Call SPIR-V legalization passes from SPIRV-Tools (#655)
When seeing opaque types within structs in function parameter,
function return, and variable definition, invoke SPIRV-Tools
legalization passes.

Also refreshed external projects
2017-09-27 16:04:35 -04:00
Lei Zhang f96f92d711 [spirv] Update SPIR-V dependencies and disable debug iterators (#574) 2017-08-16 21:11:48 -07:00
Lei Zhang 265c8db219 [spirv] Use EXCLUDE_FROM_ALL to ignore unused external targets (#489)
With this change, targets in the subdirectory will not be included
in the ALL target of the parent directory by default, and will be
excluded from IDE project files.
2017-07-31 10:52:09 -07:00
Lei Zhang bd2371f900 [spirv] Use git submodules for SPIR-V dependency projects (#455) 2017-07-24 13:12:48 -07:00
Ehsan aa2751504e [spirv] Effcee test fixture and a sample test. (#452)
* Added effcee and its dependencies (re2) to the project.
* Introduced FileTest that uses effcee to perform checks.
* Added a sample test (check-entrypoint.hlsl)
* Refactored code so WholeFileTest and FileTest can reuse code.
2017-07-24 09:03:31 -07:00
Ehsan 3e84980892 [spirv] Adding test fixture for HLSL to SPIRV codegen flow (#383)
This change enables CodeGenSPIRV test flow.

New tests can be added by simply adding the test file to
`tools/clang/test/CodeGenSPIRV/` directory and running:

```cpp
TEST_F(WholeFileTest, NewTest) {
  EXPECT_TRUE(runWholeFileTest("new-test-name"));
}
```

The input file with the format described in `WholeFileCheck.h` is read in;
the HLSL portion is passed to the compiler with SPIR-V codegen enabled.
The resulting SPIR-V binary is disassembled and compared to the expected
result in the input file.
2017-07-06 17:00:59 -07:00
Lei Zhang 3c6537a7d5 [spirv] Add GoogleTest as an external dependency (#285)
GoogleTest will be used for unit testing and codegen testing for
SPIR-V.

* Added SPIRV_BUILD_TESTS option in CMake to control building
  of SPIR-V tests.
* Added "-spirvtest" into hctbuild to enable it.
* Added "spirv" and "spirv_only" targets for hcttest.

Running `hcttest spirv` will run ALL tests including SPIRV tests.
Running `hcttest spirv_only` will ONLY run SPIRV tests.

The default behavior of hctbuild and hcttest is not changed.
2017-05-22 12:02:23 -07:00
Lei Zhang 1e58245a73 [spirv] Add SPIRV-Headers and SPIRV-Tools as external dependencies (#280)
We need SPIRV-Headers for spirv.hpp11 and SPIRV-Tools for SPIR-V
diassembling.
2017-05-09 18:33:24 -07:00