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

4155 Коммитов

Автор SHA1 Сообщение Дата
Xiang Li 956fa34b4f
[ClangCL] Cleanup rest clang-cl warnings (#5847)
1. printf format mismatch.
2. avoid cast from CComPtr<IncludeHandlerVFSOverlayForTest> to
CComPtr<IDxcIncludeHandler>.
3. fix signed unsigned mismatch.
4. fix order of fields in constructor.
5. add override for override methods.
6. port
01f4209631
7. add copy assignment operator to avoid
-Wdeprecated-copy-with-user-provided-copy
8. disable -Wignored-qualifiers for taef header WexTestClass.h.
9. remove unused fields.
10. add -clang-cl for hctbuild.
2023-10-16 19:40:51 +00:00
dependabot[bot] 1306b0ce66
Bump urllib3 from 2.0.4 to 2.0.6 in /utils/git (#5839)
Bumps urllib3 from 2.0.4 to 2.0.6.

Release notes Sourced from urllib3's releases
2.0.6

Added the Cookie header to the list of headers to strip
from requests when redirecting to a different host. As before, different
headers can be set via Retry.remove_headers_on_redirect.
(GHSA-v845-jxx5-vc9f)

2.0.5

Allowed pyOpenSSL third-party module without any deprecation
warning. https://redirect.github.com/urllib3/urllib3/issues/3126

Fixed default blocksize of HTTPConnection
classes to match high-level classes. Previously was 8KiB, now 16KiB. 
https://redirect.github.com/urllib3/urllib3/issues/3066

Changelog Sourced from urllib3's changelog

2.0.6 (2023-10-02)

Added the Cookie header to the list of headers to strip
from requests when redirecting to a different host. As before, different
headers can be set via
Retry.remove_headers_on_redirect

2.0.5 (2023-09-20)

Allowed pyOpenSSL third-party module without any deprecation
warning. https://github.com/urllib3/urllib3/issues/3126

Fixed default blocksize of HTTPConnection
classes to match high-level classes. Previously was 8KiB, now 16KiB.
https://github.com/urllib3/urllib3/issues/3066

Commits
262e3e3322
Release 2.0.6

644124ecd0
Merge pull request from GHSA-v845-jxx5-vc9f</li>

740380c59c
Bump cryptography from 41.0.3 to 41.0.4 (https://redirect.github.com/urllib3/urllib3/issues/3131)

d9f85a7494
Release 2.0.5

d41f412296
Undeprecate pyOpenSSL module (https://redirect.github.com/urllib3/urllib3/issues/3127)

b6c04cb3e6
Fix a link to "absolute URI" definition (https://redirect.github.com/urllib3/urllib3/issues/3128

af7c78fa30
refactor: change double conditional to one (https://redirect.github.com/urllib3/urllib3/issues/3118

34c13c8e68
Refer to current internet standards in docs on proxies (https://redirect.github.com/urllib3/urllib3/issues/3124

a3e94f218c
Fix a name of an attribute in docs (https://redirect.github.com/urllib3/urllib3/issues/3125

da69d4f4f9
Fix docs build (https://redirect.github.com/urllib3/urllib3/issues/3123

Additional commits viewable in https://github.com/urllib3/urllib3/compare/2.0.4...2.0.6


Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-16 10:59:44 -07:00
dependabot[bot] 56962cc126
Bump cryptography from 41.0.3 to 41.0.4 in /utils/git (#5840)
Bumps cryptography from 41.0.3 to 41.0.4.

Sourced from cryptography's changelog:

41.0.4 - 2023-09-19

* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.1.3.

fc11bce693
bump for 41.0.4 
https://github.com/pyca/cryptography/pull/9629
See full diff in https://github.com/pyca/cryptography/compare/41.0.3...41.0.4

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-16 10:49:31 -07:00
Cassandra Beckley 93ad5b3131
[SPIR-V] Implement rasterizer ordered views (#5820)
Adds support for

- `RasterizerOrderedBuffer`
- `RasterizerOrderedByteAddressBuffer`
- `RasterizerOrderedStructuredBuffer`
- `RasterizerOrderedTexture1D`
- `RasterizerOrderedTexture1DArray`
- `RasterizerOrderedTexture2D`
- `RasterizerOrderedTexture2DArray`
- `RasterizerOrderedTexture3D`

Each of these types is treated and lowered as their corresponding `RW`
type, with the addition that loads and stores to values are wrapped with
`OpBeginInvocationInterlockEXT` and `OpEndInvocationInterlockEXT`. If
loads or stores to an ROV type are present, one of the

- `SampleInterlockOrderedEXT`
- `PixelInterlockOrderedEXT`
- `ShadingRateInterlockOrderedEXT`

execution modes are added to the entry function, based on semantics
inputted to the function.
2023-10-12 17:38:10 -07: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
Helena Kotas f14b0cc8c2
Direct3D WSL build header changes (#5843)
Header changes to make Direct3D WSL build work:
- Move non-WIN32 IMalloc definition back to `WinAdapter.h` (it was there
until commit 44f8833938)
- Define DEFINE_ENUM_FLAG_OPERATORS only if it was not already defined
2023-10-10 16:15:17 -07:00
Xiang Li 039094228e
[ClangCL] Fix warning for rest part except clang. (#5705)
1. add noexcept for methods with __declspec(nothrow)
2. add override for override methods.
3. add const when cast const ptr for a const argument.
4. change 0 to 0u for immediate to avoid signed unsigned mismatch.
2023-10-09 16:59:01 -04:00
Xiang Li dd8a287bec
[ClangCL] fix warning in DxbcConverter (#5694)
1. fix order of fields in constructor.
2. fix compare warning for type mismatch by cast to same type.
3. use {} instead of {0} when initialize to all zero.
4. add override for override methods.
2023-10-09 16:58:37 -04:00
Chris B 0dc8d9060d
Pull in llvm-project's clang-format check action (#5834)
This action and scripting was written by @tru for LLVM and addresses
some of the false positives we've been seeing in our action. There is
more room for improvement, but it would be better to unify than to have
divergent approaches since we're solving the same problem.
2023-10-09 14:55:39 -05:00
Antonio Maiorano 342163b24a
Disable UBSAN sanitizing alignment errors (#5803)
The remaining errors are non-trivial to fix, so let's disable this for
now.
2023-10-06 10:02:46 -04:00
Adam Yang 5ce954c284
Removing dx.temp for lib target, since it's disallowed by the validator (#5832)
This change makes `DxilFinalizeModule` remove `dx.temp` metadata
regardless of target profile.

`DxilFinalizeModule` pass removes metadata that the validator disallows
in the final DXIL. These metadata are only removed for non-lib target,
however dx.temp is something that the validator does not allow even in
lib target. There is no reason to keep this metadata because it's only
used for inserting nops and that's not something we do when linking
libraries.
2023-10-05 20:21:20 -07:00
Xiang Li 769b504be4
[ClangCL] fix warning in clang tools (#5706)
1. Remove useless argument cast for CreateBlobWith*.
2. add override for override methods.
3. remove unused field.
4. keep const when cast.
5. change to unsigned to avoid signed unsigned mismatch.
6. change (committed.prim && (tri->t >= committed.t) || -d *
computeCullFaceDir(instFlags, rayFlags) < 0) to ((committed.prim &&
(tri->t >= committed.t)) || -d * computeCullFaceDir(instFlags, rayFlags)
< 0) for -Wlogical-op-parentheses.
2023-10-04 12:12:29 -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
Xiang Li e5ce171420
[ClangCL] Fix warning for DxilDia (#5693)
1. add override for override methods.
2. remove unnecessary std::move
3. remove unused lambda capture
4. use same enum when compare.
5. fix field order in constructor.
6. add const for when cast from a const variable.
2023-10-03 19:58:13 +00:00
Xiang Li 517e702717
[ClangCL] fix warning for clang unit test. (#5708)
1. remove unused variable.
2. use 1u instead 1 to avoid signed unsigned mismatch.
3. use std::size to replace _countof.
4. Use LPCWSTR/LPCSTR instead of LPWSTR/LPSTR.
2023-10-02 13:30:22 -04:00
Xiang Li 1dac9d8f51
[ClangCL] Fix warnings in HLSLExec (#5690)
1. Missing const when cast pointer. Add const.
2. Negtive shift casted to unsigned.
3. Missing override for override functions. Add override.
4. Remove unused variable/function.
5. Add constructor for TableParameter to workaround unintialized field.
6. RawBufferLdStTestData<int32_t> first field should not have {} when
initialize.
7. memset parameter order which also fixes in
https://github.com/microsoft/DirectXShaderCompiler/pull/4516 by
gongminmin
2023-10-02 13:29:27 -04:00
danbrown-amd 6b4b0eb5f2
[SPIRV] Implements struct-to-int casting (#5492)
Allows casting a struct to an integer type of at least the same size,
which worked for the DXIL target but not previously for SPIR-V.
2023-09-29 15:32:18 -07:00
Chris B ea4aca98fa
Enable asan on our Linux Release pipeline (#5799)
Address sanitizer can detect all sorts of memory usage related bugs.
Things like overflows, underflows, use-after-free, and (on Linux) leaks.
Due to the great work by @amaiorano, DXC is now asan-clean in our test
suite. Enabling this in our PR builds will allow us to stay that way.

I've chosen the Linux builds because the Linux runtime hooks capture
more errors than on other platforms. It only runs in the Release
configuration because asan can have significant runtime overhead so
running it in a release configuration will mitigate that substantially.
I've also changed the build to use libc++ instead of libstdc++ because
the libc++ headers have additional address sanitizer annotations to
catch misuses of C++ standard library containers.
2023-09-29 12:28:26 -05:00
Antonio Maiorano 9419b9b1c7
Fix UBSAN error in DxilRootSignatureSerializer (#5795)
Fix UBSAN error:
```
lib/DxilRootSignature/DxilRootSignatureSerializer.cpp:134:5: runtime error: store to misaligned address 0x7fff812daf5f for type 'unsigned int', which requires 4 byte alignment
```

Use memcpy to write to unaligned address.

Fixes 63 of these reported from running check-all.
2023-09-29 10:28:05 -04:00
Antonio Maiorano 4c9ca1bf1d
Fix UBSAN error in iterator.h (#5794)
Fixes UBSAN error:
```
include/llvm/ADT/iterator.h:171:7: runtime error: applying non-zero offset 8 to null pointer
```

When ULE has no decls, `decls_begin` returns a null-ptr iterator, and
adding 1 to this pointer is undefined behaviour. We fix this by adding a
check that ULE actually has decls before doing this.

Fixes 332 of these reported from running check-all.
2023-09-29 10:27:55 -04:00
Kleber Garcia 7640ffa3d5
Fixing documentation code tag for BuildingAndTestingDXC.rst (#5778)
Fixing documentation code tag for BuildingAndTestingDXC.rst doc file,
Lack of new line between code and content makes the code dissapear.
Removed also new line escape.
Sample sh code is now visible.

Results:

![image](https://github.com/microsoft/DirectXShaderCompiler/assets/789671/1163357c-2e28-4726-a1bc-9b6e6c71294e)
2023-09-28 19:34:42 +00:00
Chris B fb1f3036b1
Error when declaring global operator overloads (#5796)
HLSL 2021 can't resolve calls to global operator overloads and was never
intended to support them, but it didn't error on them being declared.
This change emits a diagnostic when declaring any operator outside class
or struct scope so that users won't instead be greeted by less intuitive
errors from overload resolution.

Fixes #5792
2023-09-28 18:52:27 +00:00
Cassandra Beckley 99a8202a7f
[SPIR-V] Add error for rasterizer ordered view types (#5781)
I meant to send this a couple weeks ago. I'll be sending in a PR soon
that implements this so up to you if you think it makes sense to merge
this first.
2023-09-27 14:13:08 +02:00
Tex Riddell 8e70fa2082
Fixed QueryInterface for ID3D12ShaderReflection interface (#5445)
QueryInterface would accept any interface IID, instead of only the ones
it recognizes. Fixed by adding PublicAPI::Invalid, returned from
IIDToAPI when not one of the recognized APIs, and only accepting
IUnknown or the original interface IID provided at create time.

CreateDxil{Shader|Library}Reflection would also completely ignore IID.
Fixed by only accepting supported IIDs.

Get*ParameterDesc for signature elements also incorrectly computed
structure size (due to alignment) to memcpy for D3D11_43 version. Fixed
by copying only up to the end of the last field in the old structure
version.

CreateReflectionObjectsForSignature had a special case avoiding filling
in the MinPrecision member for D3D11_43, though this is unnecessary,
since for that API version, the struct will be truncated to exclude the
MinPrecision member when copying out the desc. Removed unnecessary
special case.

Added DxilContainerTest::CheckReflectionQueryInterface test for Create
and QI scenarios for supported and unsupported IIDs. This also tests
that the Get*ParameterDesc methods don't write beyond the structure size
for the interface version.

Fixes #3887
2023-09-27 02:20:50 +00:00
Adam Yang e4b9b88c0c
Fixed a crash in unroller when exiting blocks use switch instead of branch (#5779)
The code to structurize loop exits assumed exiting blocks always use
BranchInst and never SwitchInst. This caused a crash. This change makes
the structurizer preemptively check whether this assumption is true
before attempting.
2023-09-26 10:59:22 -07:00
Jeff Noyle 5adc7bcf67
WinPIX: Find correct filename for subroutines in included headers within namespaces (#5776)
From a customer bug report, the previous code would skip over a
DISubProgram scope if that scope was contained in a DINamespace (as in
the first test case herein, wherein an include file is enclosed in a
namespace). This would result in DXIL being attributed to the includer
file instead of the included file.
2023-09-26 09:43:08 -07:00
Minmin Gong 755d111ccd
Fix several bugs in code (#4516)
1. Wrong usage of memset
2. Member initializer list in order of declaration
3. Add explicit to MSFileSystemHandle's single parameter constructors
2023-09-25 23:11:25 -07:00
Natalie Chouinard cb6a65415f
Add missing StringRef include (#5774)
This missing include is causing some downstream build failures.
2023-09-25 09:16:40 -04:00
Minmin Gong fc05f49254
More conforming to C++ standards (#4521)
1. Can't mix char* and const char*
2. Remove redundant const and std::move
3. Use standard types and macros to replace platform dependent ones
2023-09-23 18:01:44 -04:00
Xiang Li 1a4a01b368
[ClangCL] Fix warnings on PixTest.cpp (#5689)
1. signed unisgned compare warning.
  Fixed by change 1 into 1u. Or cast directly.
2. writeable string.
  Use const char/wchar_t * instead of char/wchar_t*.
3. lost const when cast.
   Add const.
2023-09-22 15:31:16 -04:00
Chris B 508abbcf06
[NFC] Use llvm::StringSwitch (#5760)
This replaces a hand-rolled string parser with an
llvm::StringSwitch that matches full strings. This should be more
resilient and maintainable.
2023-09-22 08:17:48 -05:00
Chris B 370a89c9dd
Use GITHUB_SHA instead of GITHUB_REF (#5766)
Based on GitHubs docs, I think `GITHUB_SHA` will be the last commit from
the target ref that is included in the PR's base ref. That should be the
right compare point rather than `GITHUB_REF`, which would be the target
branch's head ref.


https://docs.github.com/en/actions/using-workflows/events-that-trigger-w
orkflows#pull_request_target
2023-09-21 18:16:42 -05:00
Chris B 8c201e0bdb
Properly escape parenthesis (#5764)
For all my testing... still a bug persistes.

Link to failing run:

https://github.com/microsoft/DirectXShaderCompiler/actions/runs/6264722103/job/17012037925?pr=5760
2023-09-21 13:02:14 -05:00
Antonio Maiorano 06d06ff46f
Fix apple-clang debug build failing to link llvm_assert (#5759)
When building with apple-clang on MacOS, we get a linker error:

ld64.lld: error: undefined symbol: llvm_assert

Because the llvm_assert implementation is missing the last parameter.
2023-09-21 13:36:35 -04:00
Chris B 1580884188
Fix the clang-format workflow (#5761)
There were a few bugs that were difficult to reproduce. The pull request
branch ref needs to be fetched and checked out manually in order to get
the PR diff to construct. This change also fixes formatting to get a
nice diff printed of the PR output.

See an example of the error output this produces here:

https://github.com/llvm-beanz/DirectXShaderCompiler/pull/2
2023-09-21 11:28:02 -05:00
Xiang Li 95253012ea
[lit] Enable exec test by default for hcttest (#5652)
Enable exec test for hcttest -all.

Fixes https://github.com/microsoft/DirectXShaderCompiler/issues/5551
2023-09-20 22:40:19 -04:00
Chris B 314d2ff95d
Add a clang-format error to force workflow failure (#5757)
This change _should_ fix the permissions issues and allow the PR format
checker to post comments into PRs on failure. The comments should
include the first 50 lines of the diff that clang-format produces and an
error with a link to the full log.

Unfortunately this can't really be tested until it is merged. The
`pull_request_target` event only occurs once the action is in the target
branch.

Parts of this change have been tested separately, but they haven't all
been tested together.
2023-09-20 18:07:22 -05:00
Helena Kotas 29e4ca2366
Fix HelperLaneTest (#5745)
Add `-opt-disable sink` to HelperLaneTest shader compilation to prevent
sinking of `ddx_fine`/`ddy_fine` intrinsics into flow control.

Separate issue has been filed to track down the root of the problem:
#5744: Intrinsics ddx_fine/ddy_fine should not be allowed to sink into
flow control
2023-09-20 15:50:25 -07:00
Helena Kotas cf58486887
Remove placeholder implementation of IsHelperLane() (#5743)
It is no longer needed.
2023-09-20 22:46:10 +00:00
Antonio Maiorano f3ad60e282
Fix cross-compile from non-Windows to Windows (#5754)
When cross-compiling from Linux/MacOS targeting Windows, the #include of
"Intrin.h" ends up including the one from the Windows SDK because the
host OS is case-sensitive, rather than "intrin.h" from the host standard
library. Fix this by renaming the include with the correct
case-sensitive name.
2023-09-20 15:32:59 -04:00
Chris B 5d75ec908a
Add clang-format checker GitHub action. (#5753)
This relands #5746.

The initial addition of this action failed due to a permissions issue.
The addition of the permissions entry in the workflow should resolve
that issue.

This reverts commit d949f78f69.
2023-09-20 12:17:26 -05:00
Chris B 589a48d6f6
[NFC] Fix clang-formatting generated sources (#5755)
Clang-format determines if a header is the "main" header by looking at
the header name without the last extension and matching it against the
source file (with some extra handling for cuda files).

The automation generating temporary files with a `.tmp` suffix tripped
this up so it wasn't matching the "main" header when sorting includes.

This corrects the issue by writing temporaries to a tmp directory
instead of munging the suffix.
2023-09-20 12:17:10 -05:00
Helena Kotas 7b1c535a67
Execution tests: allow sharing of compile arguments (#5742)
Allow sharing of shader compile arguments by referencing Arguments
attribute from other shaders like this:

```
      ...
      <Shader Name="PS" Target="ps_6_0" EntryPoint="PSMain" Text="@CS" Arguments="@CS"/>
      <Shader Name="CS" Target="cs_6_0" EntryPoint="CSMain" Arguments="/Od">
        <![CDATA[
      ...
```
2023-09-19 10:27:10 -07:00
Minmin Gong b157edec90
Fix build on ARM with non-VS generator (#5684)
CMAKE_GENERATOR_PLATFORM is not widely available. For example, Ninja
generator doesn't define it. Use CMAKE_C_COMPILER_ARCHITECTURE_ID to
avoid this problem.
2023-09-19 11:51:38 -04:00
Minmin Gong c22d103059
Fix compilation issues on clang (#5683)
ErrorOr has a implicit constructor. A move is required for construct an
ErrorOr object. Then it's returned by the function. Write the
construction explicit to fix the compilation on clang, and reduce the
confusion.
2023-09-19 11:45:55 -04:00
Chris B 37ed613864
[NFC] Clang-format DXC sources (#5602)
This change applies clang-format to all of the sources added in DXC that
were not part of the original LLVM/Clang 3.7 release when DXC forked.
This provides consistent code formatting across the codebase.

Fixes #5591.
2023-09-19 07:49:22 -05:00
Chris B d949f78f69
Revert "Add clang-format checker GitHub action." (#5746)
Reverts microsoft/DirectXShaderCompiler#5617
2023-09-18 21:21:30 -05:00
Chris B 2431f3f0a5
[NFC] Integrate clang-format to hctgen (#5732)
This integrates formatting generated sources with clang-format with the
hctgen generation process.

This change makes a few small adjustments to how the build-time header
generation works. This change, disables automated build-time generation
for C++ sources if you don't have clang-format available on your system.

CMake can automatically detect clang-format installed as part of Visual
Studio, or based on your PATH. You can also explicitly set
`CLANG_FORMAT_EXE` when configuring to manually override. **Developers
on macOS** will need to install clang-format manually and place it on
their path to generate DXC's generated sources.

If clang-format cannot be found and `HLSL_COPY_GENERATED_SOURCES` is On
a fatal error will be reported at configuration time.

This change _does not_ make clang-format a requirement to build DXC, but
it does make it a requirement if you are modifying the generated
sources.
2023-09-18 21:10:30 -05:00
Chris B d4b3cb6788
Add clang-format checker GitHub action. (#5617)
This action runs clang-format-diff on the difference between the head
and the merge base to identify introductions of clang-format violtions
in changed code.
2023-09-18 21:09:59 -05:00
Greg Roth 4d132f95ff
[lit] allow for spaces in taef commands (#5720)
The way taef tests were gathered and executed previously flattened the
list of arguments to a string. This allowed the weird /select: flag to
work correctly, but if any of the arguments had spaces, they were
misinterpretted having lost the implicit quotes around each.

By removing the flattening, putting a space between the flag and the
argument for /select: and removing the explicit quotes around that
argument, the command executes properly whether there are spaces or not

Additionally added a way to detect when these commands failed since they
were silently failing and skipping a large swath of testing when spaces
were present.

Fixes #5719
2023-09-18 19:58:04 +00:00