This change removes the IsOverloadLegal check in OP::GetOpFunc.
It will permit the generation of illegal DXIL operations. Subsequently,
the validation should catch these illegal DXIL operations if they are
not optimized later in SimplifyDxilCall.
Fixes#6410
Bumps [black](https://github.com/psf/black) from 23.9.1 to 24.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/psf/black/releases">black's
releases</a>.</em></p>
<blockquote>
<h2>24.3.0</h2>
<h3>Highlights</h3>
<p>This release is a milestone: it fixes Black's first CVE security
vulnerability. If you
run Black on untrusted input, or if you habitually put thousands of
leading tab
characters in your docstrings, you are strongly encouraged to upgrade
immediately to fix
<a
href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503">CVE-2024-21503</a>.</p>
<p>This release also fixes a bug in Black's AST safety check that
allowed Black to make
incorrect changes to certain f-strings that are valid in Python 3.12 and
higher.</p>
<h3>Stable style</h3>
<ul>
<li>Don't move comments along with delimiters, which could cause crashes
(<a
href="https://redirect.github.com/psf/black/issues/4248">#4248</a>)</li>
<li>Strengthen AST safety check to catch more unsafe changes to strings.
Previous versions
of Black would incorrectly format the contents of certain unusual
f-strings containing
nested strings with the same quote type. Now, Black will crash on such
strings until
support for the new f-string syntax is implemented. (<a
href="https://redirect.github.com/psf/black/issues/4270">#4270</a>)</li>
<li>Fix a bug where line-ranges exceeding the last code line would not
work as expected
(<a
href="https://redirect.github.com/psf/black/issues/4273">#4273</a>)</li>
</ul>
<h3>Performance</h3>
<ul>
<li>Fix catastrophic performance on docstrings that contain large
numbers of leading tab
characters. This fixes
<a
href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503">CVE-2024-21503</a>.
(<a
href="https://redirect.github.com/psf/black/issues/4278">#4278</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>Note what happens when <code>--check</code> is used with
<code>--quiet</code> (<a
href="https://redirect.github.com/psf/black/issues/4236">#4236</a>)</li>
</ul>
<h2>24.2.0</h2>
<h3>Stable style</h3>
<ul>
<li>Fixed a bug where comments where mistakenly removed along with
redundant parentheses
(<a
href="https://redirect.github.com/psf/black/issues/4218">#4218</a>)</li>
</ul>
<h3>Preview style</h3>
<ul>
<li>Move the <code>hug_parens_with_braces_and_square_brackets</code>
feature to the unstable style
due to an outstanding crash and proposed formatting tweaks (<a
href="https://redirect.github.com/psf/black/issues/4198">#4198</a>)</li>
<li>Fixed a bug where base expressions caused inconsistent formatting of
** in tenary
expression (<a
href="https://redirect.github.com/psf/black/issues/4154">#4154</a>)</li>
<li>Checking for newline before adding one on docstring that is almost
at the line limit
(<a
href="https://redirect.github.com/psf/black/issues/4185">#4185</a>)</li>
<li>Remove redundant parentheses in <code>case</code> statement
<code>if</code> guards (<a
href="https://redirect.github.com/psf/black/issues/4214">#4214</a>).</li>
</ul>
<h3>Configuration</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/psf/black/blob/main/CHANGES.md">black's
changelog</a>.</em></p>
<blockquote>
<h2>24.3.0</h2>
<h3>Highlights</h3>
<p>This release is a milestone: it fixes Black's first CVE security
vulnerability. If you
run Black on untrusted input, or if you habitually put thousands of
leading tab
characters in your docstrings, you are strongly encouraged to upgrade
immediately to fix
<a
href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503">CVE-2024-21503</a>.</p>
<p>This release also fixes a bug in Black's AST safety check that
allowed Black to make
incorrect changes to certain f-strings that are valid in Python 3.12 and
higher.</p>
<h3>Stable style</h3>
<ul>
<li>Don't move comments along with delimiters, which could cause crashes
(<a
href="https://redirect.github.com/psf/black/issues/4248">#4248</a>)</li>
<li>Strengthen AST safety check to catch more unsafe changes to strings.
Previous versions
of Black would incorrectly format the contents of certain unusual
f-strings containing
nested strings with the same quote type. Now, Black will crash on such
strings until
support for the new f-string syntax is implemented. (<a
href="https://redirect.github.com/psf/black/issues/4270">#4270</a>)</li>
<li>Fix a bug where line-ranges exceeding the last code line would not
work as expected
(<a
href="https://redirect.github.com/psf/black/issues/4273">#4273</a>)</li>
</ul>
<h3>Performance</h3>
<ul>
<li>Fix catastrophic performance on docstrings that contain large
numbers of leading tab
characters. This fixes
<a
href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503">CVE-2024-21503</a>.
(<a
href="https://redirect.github.com/psf/black/issues/4278">#4278</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>Note what happens when <code>--check</code> is used with
<code>--quiet</code> (<a
href="https://redirect.github.com/psf/black/issues/4236">#4236</a>)</li>
</ul>
<h2>24.2.0</h2>
<h3>Stable style</h3>
<ul>
<li>Fixed a bug where comments where mistakenly removed along with
redundant parentheses
(<a
href="https://redirect.github.com/psf/black/issues/4218">#4218</a>)</li>
</ul>
<h3>Preview style</h3>
<ul>
<li>Move the <code>hug_parens_with_braces_and_square_brackets</code>
feature to the unstable style
due to an outstanding crash and proposed formatting tweaks (<a
href="https://redirect.github.com/psf/black/issues/4198">#4198</a>)</li>
<li>Fixed a bug where base expressions caused inconsistent formatting of
** in tenary
expression (<a
href="https://redirect.github.com/psf/black/issues/4154">#4154</a>)</li>
<li>Checking for newline before adding one on docstring that is almost
at the line limit
(<a
href="https://redirect.github.com/psf/black/issues/4185">#4185</a>)</li>
<li>Remove redundant parentheses in <code>case</code> statement
<code>if</code> guards (<a
href="https://redirect.github.com/psf/black/issues/4214">#4214</a>).</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="552baf8229"><code>552baf8</code></a>
Prepare release 24.3.0 (<a
href="https://redirect.github.com/psf/black/issues/4279">#4279</a>)</li>
<li><a
href="f000936726"><code>f000936</code></a>
Fix catastrophic performance in lines_with_leading_tabs_expanded() (<a
href="https://redirect.github.com/psf/black/issues/4278">#4278</a>)</li>
<li><a
href="7b5a657285"><code>7b5a657</code></a>
Fix --line-ranges behavior when ranges are at EOF (<a
href="https://redirect.github.com/psf/black/issues/4273">#4273</a>)</li>
<li><a
href="1abcffc818"><code>1abcffc</code></a>
Use regex where we ignore case on windows (<a
href="https://redirect.github.com/psf/black/issues/4252">#4252</a>)</li>
<li><a
href="719e67462c"><code>719e674</code></a>
Fix 4227: Improve documentation for --quiet --check (<a
href="https://redirect.github.com/psf/black/issues/4236">#4236</a>)</li>
<li><a
href="e5510afc06"><code>e5510af</code></a>
update plugin url for Thonny (<a
href="https://redirect.github.com/psf/black/issues/4259">#4259</a>)</li>
<li><a
href="6af7d11096"><code>6af7d11</code></a>
Fix AST safety check false negative (<a
href="https://redirect.github.com/psf/black/issues/4270">#4270</a>)</li>
<li><a
href="f03ee113c9"><code>f03ee11</code></a>
Ensure <code>blib2to3.pygram</code> is initialized before use (<a
href="https://redirect.github.com/psf/black/issues/4224">#4224</a>)</li>
<li><a
href="e4bfedbec2"><code>e4bfedb</code></a>
fix: Don't move comments while splitting delimiters (<a
href="https://redirect.github.com/psf/black/issues/4248">#4248</a>)</li>
<li><a
href="d0287e1f75"><code>d0287e1</code></a>
Make trailing comma logic more concise (<a
href="https://redirect.github.com/psf/black/issues/4202">#4202</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/psf/black/compare/23.9.1...24.3.0">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=black&package-manager=pip&previous-version=23.9.1&new-version=24.3.0)](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>
In FileCheckerTest.cpp, the -T target of a %dxc part is checked for
compatibility. However, if you use -Vd, it skips the version check for
the validator. This isn't quite right since the validator version will
be set from the attached validator, unless you explicitly set
-validator-version or use -select-validator internal. Also, if
-validator-version is explicitly set, we should check the validator
against that version, not just the one based on shader model.
This change fixes the initial check logic to only skip validator check
when using -select-validator internal or -validator-version. It also
checks against an explicitly requested -validator-version when an
external validator will be used.
Fixes#6367
Tests are split between one containing cases that could potentially be
translated to legacy barrier op in the future, and a test without
translatable barrier ops.
Part of #6538.
These flags had some effect on load code generation, but never worked
right and were not tested in the DXC compiler let alone with drivers.
This removes any notion of the flags beyond option processing and
produces a warning message that the flag is not supported and will be
ignored. The flags are both not listed in help anymore either. A simple
OptionsTest and lit test verify that the warning message is produced for either
flag and existing tests that used the flag are updated or removed.
Incidentally fixed the capitalization of an existing options warning message.
Fixes#6306
Check mix packoffset elements with nonpackoffset elements in a cbuffer
at Sema::ActOnFinishHLSLBuffer. Also check packoffset for aggregate
type.
Fixes#3724
Fixed a bug in `hlsl::RemoveUnstructuredLoopExits` where when a new
exiting block is created from splitting, it was added to the current
loop being processed, when it could also part of an inner loop. Not
adding the new block to inner loops that it's part of makes the inner
loops malformed, and causes crash.
This fix adds the new block to the inner most loop that it should be
part of. Also adds the `StructurizeLoopExits` option to `loop-unroll`
pass, which was missing before.
Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/kjd/idna/releases">idna's
releases</a>.</em></p>
<blockquote>
<h2>v3.7</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix issue where specially crafted inputs to encode() could take
exceptionally long amount of time to process. [CVE-2024-3651]</li>
</ul>
<p>Thanks to Guido Vranken for reporting the issue.</p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/kjd/idna/compare/v3.6...v3.7">https://github.com/kjd/idna/compare/v3.6...v3.7</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/kjd/idna/blob/master/HISTORY.rst">idna's
changelog</a>.</em></p>
<blockquote>
<p>3.7 (2024-04-11)
++++++++++++++++</p>
<ul>
<li>Fix issue where specially crafted inputs to encode() could
take exceptionally long amount of time to process. [CVE-2024-3651]</li>
</ul>
<p>Thanks to Guido Vranken for reporting the issue.</p>
<p>3.6 (2023-11-25)
++++++++++++++++</p>
<ul>
<li>Fix regression to include tests in source distribution.</li>
</ul>
<p>3.5 (2023-11-24)
++++++++++++++++</p>
<ul>
<li>Update to Unicode 15.1.0</li>
<li>String codec name is now "idna2008" as overriding the
system codec
"idna" was not working.</li>
<li>Fix typing error for codec encoding</li>
<li>"setup.cfg" has been added for this release due to some
downstream
lack of adherence to PEP 517. Should be removed in a future release
so please prepare accordingly.</li>
<li>Removed reliance on a symlink for the "idna-data" tool to
comport
with PEP 517 and the Python Packaging User Guide for sdist
archives.</li>
<li>Added security reporting protocol for project</li>
</ul>
<p>Thanks Jon Ribbens, Diogo Teles Sant'Anna, Wu Tingfeng for
contributions
to this release.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1d365e17e1"><code>1d365e1</code></a>
Release v3.7</li>
<li><a
href="c1b3154939"><code>c1b3154</code></a>
Merge pull request <a
href="https://redirect.github.com/kjd/idna/issues/172">#172</a> from
kjd/optimize-contextj</li>
<li><a
href="0394ec76ff"><code>0394ec7</code></a>
Merge branch 'master' into optimize-contextj</li>
<li><a
href="cd58a23173"><code>cd58a23</code></a>
Merge pull request <a
href="https://redirect.github.com/kjd/idna/issues/152">#152</a> from
elliotwutingfeng/dev</li>
<li><a
href="5beb28b9dd"><code>5beb28b</code></a>
More efficient resolution of joiner contexts</li>
<li><a
href="1b121483ed"><code>1b12148</code></a>
Update ossf/scorecard-action to v2.3.1</li>
<li><a
href="d516b874c3"><code>d516b87</code></a>
Update Github actions/checkout to v4</li>
<li><a
href="c095c75943"><code>c095c75</code></a>
Merge branch 'master' into dev</li>
<li><a
href="60a0a4cb61"><code>60a0a4c</code></a>
Fix typo in GitHub Actions workflow key</li>
<li><a
href="5918a0ef80"><code>5918a0e</code></a>
Merge branch 'master' into dev</li>
<li>Additional commits viewable in <a
href="https://github.com/kjd/idna/compare/v3.4...v3.7">compare
view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=idna&package-manager=pip&previous-version=3.4&new-version=3.7)](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>
Wave intrinsics such as `WaveGetLaneIndex()` are invalidated at DXR
thread repacking
points such as `CallShader()`. We were however reusing the result of
`WaveGetLaneIndex()`.
Fix this by marking it as `Readonly` instead of `Readnone`.
Add a test case that also covers other wave intrisics, which are handled
correctly.
Fixes#5034.
---------
Co-authored-by: Jannik Silvanus <jasilvanus@users.noreply.github.com>
OpConvertFToU and FToS convert numerically from floating point to
integer, with rounding toward 0.0, matching the defined behavior of HLSL
without any need for an initial bitwidth conversion from floating point
to floating point, which can result in incorrect rounding behavior (see
#6501).
Note that behavior is undefined if the target type is not wide enough to
hold the converted value, however this was also true with an initial
bitcast (because an N-bit FP can hold values outside the range of an
N-bit int), and I can't come up with any case where an intial truncation
would result in correct defined behavior where this straight conversion
would be undefined since the precision will inevitably be lost anyways.
Fixes#6501
This is a follow up to #6491 which adds emulation for OpBitField*Extract
This is required because Vulkan requires OpBitField*Extract operands to
be 32-bit integers.
Fixes#6327
---------
Signed-off-by: Nathan Gauër <brioche@google.com>
When the requested constant buffer layout is DX, some type lowering can
become complex (Nx1 matrices for ex). To simplify the lowering, the
backend "clones" those variables:
- on one end, we expose the correct layout
- but then, we copy this to a local variable to have a different layout
compatible with the operations we usually do on such types.
This means the type can sometimes be an HybridStructType, which is not
completely lowered, or a normal lowerer SPIR-V type. Both should be
allowed, but some codepaths had to be updated to reflect this.
---------
Signed-off-by: Nathan Gauër <brioche@google.com>
The existing logic from `VK_NV_mesh_shader` was incorrectly adapted for
the `VK_EXT_mesh_shader` implementation when it comes to the handling of
payloads as in/out variables. Because `TaskPayloadWorkgroupEXT` must be
applied to a single global `OpVariable` for each task/mesh shader, the
struct should not be flattened. Further, Location assignment is not
necessary for these input and output variables, so the usual reason for
flattening structs does not apply.
This change now removes the inner struct member global variables and
ensures the parent payload is decorated with `TaskPayloadWorkgroupEXT`.
Note that for amplification/task shaders, the payload variable is
created with the `groupshared` decl, and then its storage class needs to
be updated when that variable is used as a parameter to the
`DispatchMesh` call, as described in:
https://docs.vulkan.org/spec/latest/proposals/proposals/VK_EXT_mesh_shader.html#_hlsl_changes
Tested with new validation checks from:
https://github.com/KhronosGroup/SPIRV-Tools/pull/5640Fixes#5981
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>
Implements hlsl-specs proposal 0011, adding `vk::SpirvType` and
`vk::SpirvOpaqueType` templates which allow users to define and use
SPIR-V level types.
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.
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.
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.
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).
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>
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>
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>
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>
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 #6220Fixes#6384, #6383, #6382
---------
Signed-off-by: Nathan Gauër <brioche@google.com>
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.
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>
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>
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>
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>
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>
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>
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.
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.
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.
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)
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>