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

4756 Коммитов

Автор SHA1 Сообщение Дата
Cooper Partin 3546bde202
Increase filter time value for failing ftime-trace-granularity test (#6532)
ftime-trace-granularity test was failing in test runs due to the
configured time filter value being too small. The latest test run was
recording duration times of 322308 which is larger than the test's
specified filter value of 99999 causing timings to not be filtered out.

The test is now updated to have a filter value of 999999, which should
properly filter out timings.

Fixes #6528

---------

Co-authored-by: Cooper Partin <coopp@ntdev.microsoft.com>
2024-04-15 16:04:33 -07:00
Cassandra Beckley d60dffef1a
[SPIR-V] Implement SpirvType and SpirvOpaqueType (#6156)
Implements hlsl-specs proposal 0011, adding `vk::SpirvType` and
`vk::SpirvOpaqueType` templates which allow users to define and use
SPIR-V level types.
2024-04-15 20:58:49 +00:00
David Neto dc84d72d18
Fix recursive zero replacement bottoming out in scalars. (#6516)
During memcpy replacement, the scalarrepl-param-hlsl pass will replace
certain uses of a zero-initialized global variable. The pass uses a
recursive algorithm to replace uses of that global by a zero value. The
current code expects the recursion to bottom out in an aggregate type.
But it can bottom out in a scalar integer or scalar float.

This patch fixes the scalar cases.

Lit-based pass tests are included.
2024-04-12 11:02:20 -04:00
Chris B b065a0d9c5
Add CODEOWNERS to main (#6520)
In release branches we've added enforcement of AskMode where approval is
required before merging. This just adds the requisite file to the `main`
branch so that it will appear in future release branches. It DOES NOT
apply the branch protection policy, which is a setting controlled in
GitHub.

There is no policy change to contributions to main with this change.
2024-04-10 18:29:05 -05:00
Tex Riddell fe393e09d7
Add barrier MemoryTypeFlags and SemanticFlags diagnostics (#6513)
Context-specific diagnostics are warnings with DefaultError, since in
theory they could be dead code at this stage.

There were some changes to existing Sema diagnostic hooks along the way.

SemaHLSLDiagnoseTU.cpp - HLSLMethodCallDiagnoseVisitor
- extend to non-method calls and pass CallExpr
- instead of skipping when call reached from multiple entry/export
functions, pass locallyVisited flag for skipping of redundant diags not
dependent on entry properties.
- use llvm::SmallPtrSet for DiagnosticCalls
- capture launch type for entry and pass it down

Replace DiagnoseHLSLMethodCall hook with CheckHLSLFunctionCall:

Move hook into Sema::CheckFunctionCall in SemaChecking.cpp to be general
to either a function call or a method call.
Refactor existing code in DiagnoseHLSLMethodCall into
CheckFinishedCrossGroupSharingCall called in the hook for this method.
Add CheckBarrierCall for context-free flag validity check, called by
CheckHLSLFunctionCall.

Refactor CalculateLOD checking into more generic parts, dispatched based
on IntrinsicOp from top-level DiagnoseReachableHLSLCall function.

Switch to using new note: "entry function defined here", instead of
"declared here".

Fix intrinsic checking to use IsBuiltinTable on the intrinsic
attribute's group.

**Preparation Changes**
While these could be broken out, the barrier diagnostic changes are
dependent on them, and testing for some of these is dependent on the
other parts of the barrier diagnostic changes.

Correct errors in tests, check MaxRecords for EmptyNodeOutput in AST
Note that Barrier(..., 3) means SemanticFlags: GroupSync | GroupScope.
These are only valid in a shader with a visible group, and GroupSync on
memory with at least group scope, so they have been changed to 0 in
specific cases in these tests.

Make DiagnoseSVForLaunchType a static function, add FIXME notes.

Use StringRef for IsBuiltinTable, compare strings instead of pointers.

Fix FileCheckerTest for -verify output.

New ShaderModel::HasVisibleGroup uses ShaderKind and NodeLaunchType to
determine whether shader type has a visible group.
2024-04-10 14:44:37 -07:00
Antonio Maiorano fa39b3984f
Replace dynamic_cast with virtual call (#6515)
Make TextDiagnosticPrinter::setPrefix a virtual function in base class
DiagnosticConsumer. This allows us to avoid using dynamic_cast in
BackendConsumer::DxilDiagHandler, required for codebases that do not
enable RTTI. This is also the only place in the codebase that uses RTTI
(AFAICT).
2024-04-10 20:10:49 +00:00
Cooper Partin 422a60e6d0
Update locale setting logic to support UTF-8 only for Apple and Linux distros (#6488)
This commit fixes the setlocale( ) logic to include the UTF-8 supported
string value for Mariner distros.

It also introduces a new RAII class `ScopedLocale' which ensure that the
locale setting is set/reset during string conversion operations.

Fixes: #6201

---------

Co-authored-by: Cooper Partin <coopp@ntdev.microsoft.com>
Co-authored-by: cooppunix <cooppunix&mariner.com>
2024-04-10 10:04:32 -07:00
Nathan Gauër 0781ded87b
[SPIR-V] Emulate OpBitFieldInsert for type != i32 (#6491)
SPIR-V supported OpBitFieldInsert on all integer types. But Vulkan
requires the operands to be 32bit integers.
This means we need to emulate this instruction for types other then i32.

This PR only adds emulation for OpBitFieldInsert. The next PR will add
support for emulating OpBitFieldExtract,

Related to #6327

---------

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-04-09 14:06:37 +02:00
Xiang Li 8b5b6c6add
[ClangCL] fix x86 only warning (#6504)
SIZE_T is unsigned long for x86 while size_t is unsigned int for x86.
Cast SIZE_T to size_t to avoid integer mismatch warning.
2024-04-08 12:26:38 -07:00
Helena Kotas 14ec4b49d4
DerivativesTest: Remove invalid thread group size test cases (#6496)
Invalid thread group size testing is included in the compiler/validator
tests (PR #6332, commit 696a13a). It does not belong in the execution
tests because is it not verifying the driver execution results. The
shaders with invalid thread group sizes fail validation and cannot be
executed.

Also fixing compile warning and override defines in the derivatives test
HLSL code.

Note that the test is incorrectly using the term `dispatch size` instead
of `thread group size`.

Fixes internal bug #49806539. Reported from RITP pass.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-04 17:37:39 -07:00
Nathan Gauër aa4d3746e0
[SPIR-V] fix silent failure if disassembly fails (#6490)
When codegen is broken, and spirv-dis fails, DXC doesn't return any
error, and simply displays nothing, and returns 0.

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-04-04 10:42:56 +02:00
Helena Kotas 5e0bb1452b
Set supported validator version on DXC/disable_paq.hlsl (#6493)
This test is failing in the internal validator back-compat suite because
the feature is not supported on older validators.
2024-04-03 18:03:41 -07:00
Xiang Li 8322cabfc0
[ClangCL] fix clang-cl build warning. (#6492)
Fix sign-compare warnings.
2024-04-03 12:20:49 -07:00
Nathan Gauër 27b87b7593
[SPIR-V][Sema] Requires nointerpolation on GetAttributeAtVertex param #0 (#6453)
This commit adds new sema checks for SPIR-V to restrict the scope of the
feature: the `nointerpolation` attribute is now required on all
parameters used in GetAttributeAtVertex, and doesn't propagage magically
to parent/child functions.

The current accepted cases this now blocks were mostly broken later in
the codegen, so this should be an acceptable 'regression'.

Related to #6220
Fixes #6384, #6383, #6382

---------

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-04-03 16:17:33 +00:00
Xiang Li 06e706cf6e
[Test] skip test for older validator which check different value. (#6477)
Error message was updated in #6196 which cause test fail on older
validator.

Since this issue is only caused by error message update, the validation
itself is still the same.
The compiler didn't generate anything that behaves badly with older
validators.

So just limit these tests to sm6.8+ to make it work on older validator.
2024-03-29 21:13:51 +00:00
Helena Kotas dd981450f3
dxexp: add support for mesh shaders, derivatives in mesh/amp shaders and wave matrix (#6355)
These features were not included in the dxexp output and they are
important to query for HLK test reports.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-29 12:15:56 -07:00
Nathan Gauër a9b5e725aa
[SPIR-V] Fix crash in GetAttributeAtVertex impl. (#6459)
Some SPIR-V types are not direct translations of an AST type, hence they
don't have an AST type attached to it.
The code didn't checked for this possibility when visiting all
variables.

Fixes #2955

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-29 11:25:00 +01:00
Nathan Gauër bb9ec0fb56
[SPIR-V] Fix struct size computation with bitfields (#6471)
The struct size & alignment computations were wrong when
bitfields were in use. This was due to a mismatch between size
computations at the AST level, and at the SPIR-V level.

This commit adds logic to correctly compute bitfields offsets on
an AST struct.

**note: there are 2 commits in this PR, one that moves code around with
no change, and one that adds the logic. To help you review.**

Fixes #5648

---------

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-29 11:21:37 +01:00
Cassandra Beckley 7e40ead3c7
[SPIR-V] Fix test runline (#6474)
Our internal tests were failing due to this.
2024-03-29 11:13:46 +01:00
Nathan Gauër 3aabc019ec
[Sema] Move outputcontrolpoints check to Sema (#6460)
DXIL had a check in the backend for those values.
Moving it to Sema to share it between DXIL and SPIR-V.

Fixes #6387

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-29 11:13:31 +01:00
Fumitoshi Ukai 773246eddc
fix #include path separator from backslash to slash (#6379)
backslash is not portable, so use slash instead.
2024-03-28 09:34:03 -07:00
Greg Roth dd14fe5a53
Allow disabling payload access qualifiers in 6.8+ (#6468)
The original payload access qualifiers change disallowed disabling them
on 6.8+ versions. This wasn't an intended feature of 6.8. We'd prefer to
maintain the ability to disable these when needed to avoid issues that
might crop up.

This change extends respect of the disable-payload-qualifiers flag for
all versions. It rewords the warning that is produced when they are
encountered when disabled to be more applicable. Tests are also added to
verify that the implicit enabling in 6.7+ works in the basic cases and
also that disabling in the 6.7+ cases works as well.

Fixes #6462

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-28 01:38:05 -07:00
Nathan Gauër 4386e4b851
[SPIR-V] Fix bitfields with RWStructured & Push-constants (#6463)
When implementing bitfields, we miss a code path which lowered the AST
type to the SPIR-V type, and thus failed to propagate the bitfield
information.
This commit addresses that.

Fixes #6409

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-27 11:44:21 +01:00
Helena Kotas e2fb8b33b2
Remove -spirv from new HLSL Sema tests (#6467)
These are semantic verification tests, the `-spir-v` option is not
necessary.
It also breaks our internal test passes for builds that do include
SPIR-V backend.
2024-03-26 22:35:14 +00:00
Antonio Maiorano 63ebbb1430
Fix ASAN use-after-free on unreferenced self-assignment of struct instance (#6466)
When deleting an unused memcpy, ScalarReplAggregatesHLSL was attempting
to delete both the target and the source of the memcpy without first
checking if they were both same, resulting in a double-delete.
2024-03-26 21:48:40 +00:00
Fumitoshi Ukai e4fa1c5184
fix non-portable include path (#6380)
d3dcommon.h seems to be canonical path name in Win SDK

Windows Kits/10/Include/10.0.22621.0/um/d3dcommon.h

so use d3dcommon.h rather than D3Dcommon.h
2024-03-26 09:44:44 -07:00
Natalie Chouinard b451a409e1
[SPIR-V] Implement dot2add intrinsic function (#6445)
Add support for the Shader Model 6.4 intrinsic dot2add which was missing
from the SPIR-V backend.

Fixes #6442
2024-03-26 15:43:46 +00:00
Natalie Chouinard 989a4d0c06
[SPIR-V] Fix test (#6456)
This test landed after #6196 was created but before it was merged, and
had an invalid attribute that is now caught and causing test failures at
head.
2024-03-26 13:47:45 +01:00
Chris B 88eb617b8c
Add User Support issue template. (#5651)
This adds a new issue template for user support issues. These are
distinct from bug reports because they may not be bugs and might just be
users needing help.
2024-03-25 16:32:31 -05:00
Natalie Chouinard 122464aeef
Require valid outputcontrolpoints on Hull shader (#6196)
According to the documentation: "A hull shader is implemented with an
HLSL function, and has the following properties: [...] The shader output
is between 1 and 32 control points".


https://learn.microsoft.com/en-us/windows/win32/direct3d11/direct3d-11-advanced-stages-tessellation#hull-shader-stage

This change adds a check to verify that the outputcontrolpoints
attribute is set on Hull shaders and has an argument in the valid range.

Fixes #3733 (by making the error consistent between backends)
2024-03-25 13:41:12 -04:00
Nathan Gauër eee0416c77
Sema: warn when POSITION[0] is used intead of SV_Position (#6401)
Before SM4, POSITION was equivalent to today's SV_Position. However, as
HLSL moved to system semantics (SV_), the support for those old
semantics has been deprecated.
Some like VFACE are now completely forbidden, but others like POSITION
or COLOR have been handled differently by FXC and DXC.

Today, usage of POSITION in place of SV_Position is probably a mistake
as POSITION is now considered to be a user-defined semantic.

This commit adds a warning when POSITION is used as an output semantic
for a vertex shader, as most cases should be the result of a mistake. If
this is expected, the warning can be disabled by using
`-Wno-dx9-deprecation`.

Fixes #3742

---------

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-25 15:18:43 +01:00
Natalie Chouinard 8de82c9415
[SPIR-V] Add support for Denorm Mode (#6435)
The -denorm option allows the shader to select the desired behavior with
respect to denormal values.

Note that this can't take advantage of the SPIRV-Tools capability
trimming pass for the same reasons as described in:
https://github.com/microsoft/DirectXShaderCompiler/pull/6248#discussion_r1481073348

Fixes #6434
2024-03-25 11:42:53 +01:00
Antonio Maiorano 40e27eb4e9
azure-pipelines: Fix the fact that neither asan+ubsan were not actually enabled (#6428)
Also make the message about the unsupported value of LLVM_USE_SANITIZER
an error rather than a warning, so we don't make this mistake in the
future.
2024-03-22 17:49:37 -04:00
Antonio Maiorano dab30b929a
Disable "downcast of address" UBSAN runtime error (#6448)
This is a temporary workaround until we fix:
https://github.com/microsoft/DirectXShaderCompiler/issues/6446

This should allow us to enable asan/ubsan checks:
https://github.com/microsoft/DirectXShaderCompiler/pull/6428

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-22 15:57:21 -04:00
Xiang Li 7581ff4d29
[Sema] Check FunctionDecl has identifier before getName. (#6439)
Use identifier name without check the identifier exists will cause
crash.

Fixes #6426

---------

Co-authored-by: Tex Riddell <texr@microsoft.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-21 10:36:49 -07:00
Xiang Li 7f12aa6526
[ClangCL] Fix warning in PixDiaTest.cpp (#6440)
Remove unused variable.
2024-03-20 19:22:44 -07:00
Chris B 42294bff98
Fix HLMatrixLowerPass leaving call to dangling FunctionVal (#6441)
When lowering an hl.cast, when the operand was an undef matrix, the pass
would insert a call to a mat2vec stub, but since the undef value is not
an alloca, it never gets handled, and the call to the temporary stub
remains. Since the stub FunctionVal gets deleted, when the instruction
is accessed in a future pass, it reads a dangling pointer.

The fix is to handle undef similarly to how constant 0 is handled, and
to return an undef vector from lowerHLCast.

---------

Signed-off-by: Chris Bieneman <cbieneman@microsoft.com>
Co-authored-by: Antonio Maiorano <amaiorano@google.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-21 00:03:41 +00:00
Antonio Maiorano 10727e8292
Disable ubsan alignment errors properly (#6431)
This adds the same 'no-sanitize=alignment' option in the branch for both
asan and ubsan that I missed as part of this PR:
https://github.com/microsoft/DirectXShaderCompiler/pull/5803
2024-03-20 15:43:18 -04:00
Antonio Maiorano 4c37fb33c2
Fix asan heap overflow in PixTests (again) (#6430)
Use BlobToUtf8 which handles the case of InternalDxcBlobEncoding_Impl
not having a null-terminated pointer when converting to string.

Effectively a repeat of this PR:
https://github.com/microsoft/DirectXShaderCompiler/pull/5973
2024-03-20 15:43:09 -04:00
Antonio Maiorano 227ea3d488
Fix ubsan failure on uninitialized read of bool param to WideCharToMultiByte (#6429)
If last arg lpUsedDefaultChar is non-null, the function must set this
value to true or false. WideToEncodedString conditionally passes in a
pointer to 'usedDefaultChar', which was not getting written to, and
causing ubsan to fail on reading an invalid boolean value:
```
.../lib/DxcSupport/Unicode.cpp:156:14: runtime error: load of value 208, which is not a valid value for type 'BOOL' (aka 'bool')
```
2024-03-20 15:42:01 -04:00
Cassandra Beckley 6f4f758e9b
[SPIR-V] Allow evaluating enum values to APInt (#6424)
Use `isIntegralOrEnumerationType` instead of `isIntegerType` in a couple
places so that enum values can be evaluated to `SpirvConstantInteger`

Fixes #6421
2024-03-18 08:56:23 -07:00
Nathan Gauër 43d11d180e
[SPIR-V] Only allow GetAttributeAtVertex in PS (#6422)
This builtin should only be called from a pixel shader.

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-18 13:25:11 +01:00
Nathan Gauër d9bd2a706c
[SPIR-V] Fix list initializer code (#6408)
The list initializer code was not always checking the initializer list
size before reading it, causing crashes.
Checking the list size led me to discover paths in which the code could
crash by dereferencing null pointers.

Added a few guards to check if a subpath failed before continuing.

Fixes #6143

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-14 11:43:44 +01:00
dependabot[bot] 5852de760b
Bump cryptography from 41.0.6 to 42.0.4 in /utils/git (#6339)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.6
to 42.0.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst">cryptography's
changelog</a>.</em></p>
<blockquote>
<p>42.0.4 - 2024-02-20</p>
<pre><code>
* Fixed a null-pointer-dereference and segfault that could occur when
creating
a PKCS#12 bundle. Credit to **Alexander-Programming** for reporting the
  issue. **CVE-2024-26130**
* Fixed ASN.1 encoding for PKCS7/SMIME signed messages. The fields
``SMIMECapabilities``
and ``SignatureAlgorithmIdentifier`` should now be correctly encoded
according to the
  definitions in :rfc:`2633` :rfc:`3370`.
<p>.. _v42-0-3:</p>
<p>42.0.3 - 2024-02-15
</code></pre></p>
<ul>
<li>Fixed an initialization issue that caused key loading failures for
some
users.</li>
</ul>
<p>.. _v42-0-2:</p>
<p>42.0.2 - 2024-01-30</p>
<pre><code>
* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL
3.2.1.
* Fixed an issue that prevented the use of Python buffer protocol
objects in
  ``sign`` and ``verify`` methods on asymmetric keys.
* Fixed an issue with incorrect keyword-argument naming with
``EllipticCurvePrivateKey``

:meth:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey.exchange`,
  ``X25519PrivateKey``

:meth:`~cryptography.hazmat.primitives.asymmetric.x25519.X25519PrivateKey.exchange`,
  ``X448PrivateKey``

:meth:`~cryptography.hazmat.primitives.asymmetric.x448.X448PrivateKey.exchange`,
  and ``DHPrivateKey``

:meth:`~cryptography.hazmat.primitives.asymmetric.dh.DHPrivateKey.exchange`.
<p>.. _v42-0-1:</p>
<p>42.0.1 - 2024-01-24
</code></pre></p>
<ul>
<li>Fixed an issue with incorrect keyword-argument naming with
<code>EllipticCurvePrivateKey</code>

:meth:<code>~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey.sign</code>.</li>
<li>Resolved compatibility issue with loading certain RSA public keys in

:func:<code>~cryptography.hazmat.primitives.serialization.load_pem_public_key</code>.</li>
</ul>
<p>.. _v42-0-0:</p>
<p>42.0.0 - 2024-01-22</p>
<pre><code>
&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fe18470f7d"><code>fe18470</code></a>
Bump for 42.0.4 release (<a
href="https://redirect.github.com/pyca/cryptography/issues/10445">#10445</a>)</li>
<li><a
href="aaa2dd06ed"><code>aaa2dd0</code></a>
Fix ASN.1 issues in PKCS#7 and S/MIME signing (<a
href="https://redirect.github.com/pyca/cryptography/issues/10373">#10373</a>)
(<a
href="https://redirect.github.com/pyca/cryptography/issues/10442">#10442</a>)</li>
<li><a
href="7a4d012991"><code>7a4d012</code></a>
Fixes <a
href="https://redirect.github.com/pyca/cryptography/issues/10422">#10422</a>
-- don't crash when a PKCS#12 key and cert don't match (<a
href="https://redirect.github.com/pyca/cryptography/issues/10423">#10423</a>)
...</li>
<li><a
href="df314bb182"><code>df314bb</code></a>
backport actions m1 switch to 42.0.x (<a
href="https://redirect.github.com/pyca/cryptography/issues/10415">#10415</a>)</li>
<li><a
href="c49a7a5271"><code>c49a7a5</code></a>
changelog and version bump for 42.0.3 (<a
href="https://redirect.github.com/pyca/cryptography/issues/10396">#10396</a>)</li>
<li><a
href="396bcf64c5"><code>396bcf6</code></a>
fix provider loading take two (<a
href="https://redirect.github.com/pyca/cryptography/issues/10390">#10390</a>)
(<a
href="https://redirect.github.com/pyca/cryptography/issues/10395">#10395</a>)</li>
<li><a
href="0e0e46f5f7"><code>0e0e46f</code></a>
backport: initialize openssl's legacy provider in rust (<a
href="https://redirect.github.com/pyca/cryptography/issues/10323">#10323</a>)
(<a
href="https://redirect.github.com/pyca/cryptography/issues/10333">#10333</a>)</li>
<li><a
href="2202123b50"><code>2202123</code></a>
changelog and version bump 42.0.2 (<a
href="https://redirect.github.com/pyca/cryptography/issues/10268">#10268</a>)</li>
<li><a
href="f7032bdd40"><code>f7032bd</code></a>
bump openssl in CI (<a
href="https://redirect.github.com/pyca/cryptography/issues/10298">#10298</a>)
(<a
href="https://redirect.github.com/pyca/cryptography/issues/10299">#10299</a>)</li>
<li><a
href="002e886f16"><code>002e886</code></a>
Fixes <a
href="https://redirect.github.com/pyca/cryptography/issues/10294">#10294</a>
-- correct accidental change to exchange kwarg (<a
href="https://redirect.github.com/pyca/cryptography/issues/10295">#10295</a>)
(<a
href="https://redirect.github.com/pyca/cryptography/issues/10296">#10296</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pyca/cryptography/compare/41.0.6...42.0.4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cryptography&package-manager=pip&previous-version=41.0.6&new-version=42.0.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/DirectXShaderCompiler/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-13 14:29:31 -05:00
Nathan Gauër 63db29e887
[SPIR-V] Fix static const in push constants (#6403)
Struct lowering is slightly different for push constants, and we didn't
checked if the field was static or not.

In SPIR-V, when a field is const static, we either replace all loads by
a the immediate (when usage is `Struct::field`), or create a global
variable we initialize to the correct value and reference instead. The
field is then ignored from the struct definition, and this variable is
used.

This hasn't changed with this commit, I just made push-buffers use the
same logic.

Fixed #6006

---------

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-13 15:49:50 +00:00
Helena Kotas 3fc84bf941
Fix verification in ExecutionTest::ComputeSampleTest (#6405)
The `ComputeSampleTest` is verifying `Sample` and
`CalculateLevelOfDetail` intrinsics calls on a texture in compute, mesh
and amplification shaders. The test is set up in a way that the reported
LOD values should be increasing as the X and Y coordinates increase.

However, since the test results are stored in quad z-order, and it is
perfectly valid for the X-derivative-LOD to decrease when going from
top-right to bottom-left pixel in a quad because in this case the X
coordinate decreases. Therefore, the test needs verify the LOD values
are increasing everywhere except for the bottom-left quad pixel (every
output with `index % 4 == 2`).

Previously, the test coincidentally worked for compute shaders because
it uses thread group of 336 and the 1/336 difference between 0 and pixel
1's X coordinate is not sufficient to change LODs. For mesh, however,
since the limit of a thread group size is 128, the validation is done
using the smaller range of 116, and 1/116 is sufficient to change LOD
for pixel 1.

This PR also fixes a couple of mismatched thread group dimensions in
`VerifySampleResults`.

The shader code for this test is at
[ShaderOpArith.xml](130877392c/tools/clang/unittests/HLSLExec/ShaderOpArith.xml (L454))
line 454.

Fixes #4788 
Fixes #6181

---------

Co-authored-by: Greg Roth <grroth@microsoft.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-12 16:09:25 -07:00
Natalie Chouinard 130877392c
[SPIR-V] Allow literal selectors in switch stmts (#6399)
Adds support for literal ints as selectors in switch statements.

Fixes #4338
2024-03-11 18:45:52 +00:00
Nathan Gauër 1f162e2230
[SPIR-V] Block semantic annotation reuse for input (#6396)
The MSDN spec is not very clear regarding input parameter aliasing, BUT
DXIL & MS agrees (See #3737) using the same semantic annotation twice
should be disallowed.

DXIL currently disallows it for most, and due to a bug, allows some
compute related semantics to be aliased.
SPIR-V did allowed aliasing, but it was a implemented as a hack causing
typing issues if the type changed between the 2 parameters using the
same semantic annotation.

To align more closely with DXIL, and the "spec", we are now disallowing
all semantic attribute reuse for input parameters.

Fixes #3737

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-03-08 12:48:54 +01:00
Xiang Li 263a77335a
[ClangCL] Fix warning in PixDiaTest.cpp (#6395)
Fix type mismatch waring.
2024-03-07 11:09:29 -08:00
Michael Anttila f19b3f5439
Update submodules (#6397)
Updating SPIRV-Tools and SPIRV-Headers.
2024-03-07 13:22:50 -05:00