Skip to content

Commit 5adc27f

Browse files
author
devsh
committed
Merge branch 'main' of github.com:microsoft/DirectXShaderCompiler into devshFixes
2 parents 47c3d15 + ac36a79 commit 5adc27f

File tree

220 files changed

+11844
-2454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+11844
-2454
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ autoconf/autom4te.cache
5252
# Directories to ignore (do not add trailing '/'s, they skip symlinks).
5353
#==============================================================================#
5454
# Build directories
55-
build*
55+
/build*/
5656
# External projects that are tracked independently.
5757
external/*
5858
# Clang, which is tracked independently.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ release mode for DXIL 1.1 and Shader Model 6.1 (View Instancing support only).
6161

6262
Drivers can be downloaded from the following link [Intel Graphics Drivers](https://downloadcenter.intel.com/product/80939/Graphics-Drivers)
6363

64-
Direct access to 15.60 driver (latest as of of this update) is provided below:
64+
Direct access to 15.60 driver (latest as of this update) is provided below:
6565

6666
[Installer](https://downloadmirror.intel.com/27412/a08/win64_15.60.2.4901.exe)
6767

azure-pipelines.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ stages:
5151
Linux_Clang_Release:
5252
image: ${{ variables.linux }}
5353
configuration: Release
54-
CC: clang
55-
CXX: clang++
54+
CC: clang-18
55+
CXX: clang++-18
5656
CMAKE_OPTS: -DLLVM_ENABLE_WERROR=On -DLLVM_USE_SANITIZER='Address;Undefined' -DLLVM_ENABLE_LIBCXX=On -DLLVM_USE_LINKER=lld
5757
CHECK_ALL_ENV: ASAN_OPTIONS=alloc_dealloc_mismatch=0
5858
OS: Linux
@@ -98,7 +98,12 @@ stages:
9898
inputs:
9999
versionSpec: '3.x'
100100

101-
- bash: sudo apt-get install ninja-build
101+
- bash: |
102+
sudo apt-get install ninja-build
103+
wget https://apt.llvm.org/llvm.sh
104+
chmod u+x llvm.sh
105+
sudo ./llvm.sh 18
106+
sudo apt-get install libc++-18-dev
102107
displayName: 'Installing dependencies'
103108
condition: eq(variables['image'], variables['linux'])
104109

docs/ReleaseNotes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ The included licenses apply to the following files:
1212

1313
| License file | Applies to |
1414
|---|---|
15-
|LICENSE-MS.txt |dxil.dll (if included in package)|
1615
|LICENSE-MIT.txt |d3d12shader.h|
1716
|LICENSE-LLVM.txt |all other files|
1817

@@ -23,6 +22,8 @@ The included licenses apply to the following files:
2322
Place release notes for the upcoming release below this line and remove this line upon naming this release.
2423

2524
- The incomplete WaveMatrix implementation has been removed.
25+
- DXIL Validator Hash is open sourced.
26+
- DXIL container validation for PSV0 part allows any content ordering inside string and semantic index tables.
2627

2728
### Version 1.8.2407
2829

docs/SPIR-V.rst

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ Supported extensions
303303
* SPV_GOOGLE_user_type
304304
* SPV_NV_mesh_shader
305305
* SPV_KHR_fragment_shading_barycentric
306+
* SPV_KHR_float_controls
306307

307308
Vulkan specific attributes
308309
--------------------------
@@ -397,8 +398,8 @@ interface variables:
397398
main([[vk::location(N)]] float4 input: A) : B
398399
{ ... }
399400
400-
Macro for SPIR-V
401-
----------------
401+
Macros for SPIR-V
402+
-----------------
402403

403404
If SPIR-V CodeGen is enabled and ``-spirv`` flag is used as one of the command
404405
line options (meaning that "generates SPIR-V code"), it defines an implicit
@@ -412,6 +413,12 @@ specific part of the HLSL code:
412413
#endif
413414
RWStructuredBuffer<S> mySBuffer;
414415
416+
When the ``-spirv`` flag is used, the ``-fspv-target-env`` option will
417+
implicitly define the macros ``__SPIRV_MAJOR_VERSION__`` and
418+
``__SPIRV_MINOR_VERSION__``, which will be integers representing the major and
419+
minor version of the SPIR-V being generated. This can be used to enable code that uses a feature
420+
only for environments where that feature is available.
421+
415422
SPIR-V version and extension
416423
----------------------------
417424

@@ -2884,6 +2891,30 @@ If an output unsigned integer ``status`` argument is present,
28842891
``OpImageSparseSampleDrefExplicitLod`` is used instead. The resulting SPIR-V
28852892
``Residency Code`` will be written to ``status``.
28862893

2894+
``.SampleCmpBias(sampler, location, bias, comparator[, offset][, clamp][, Status])``
2895+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2896+
2897+
Not available to ``Texture3D``, ``Texture2DMS``, and ``Texture2DMSArray``.
2898+
2899+
The translation is similar to ``.SampleBias()``, but the
2900+
``OpImageSampleDrefImplicitLod`` instruction is used.
2901+
2902+
If an output unsigned integer ``status`` argument is present,
2903+
``OpImageSparseSampleDrefImplicitLod`` is used instead. The resulting SPIR-V
2904+
``Residency Code`` will be written to ``status``.
2905+
2906+
``.SampleCmpGrad(sampler, location, ddx, ddy, comparator[, offset][, clamp][, Status])``
2907+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2908+
2909+
Not available to ``Texture3D``, ``Texture2DMS``, and ``Texture2DMSArray``.
2910+
2911+
The translation is similar to ``.SampleGrad()``, but the
2912+
``OpImageSampleDrefExplicitLod`` instruction are used.
2913+
2914+
If an output unsigned integer ``status`` argument is present,
2915+
``OpImageSparseSampleDrefExplicitLod`` is used instead. The resulting SPIR-V
2916+
``Residency Code`` will be written to ``status``.
2917+
28872918
``.Gather()``
28882919
+++++++++++++
28892920

@@ -2977,10 +3008,11 @@ Not available to ``Texture2DMS`` and ``Texture2DMSArray``.
29773008

29783009
Since texture types are represented as ``OpTypeImage``, the ``OpImageQueryLod``
29793010
instruction is used for translation. An ``OpSampledImage`` is created based on
2980-
the ``SamplerState`` passed to the function. The resulting sampled image and
2981-
the coordinate passed to the function are used to invoke ``OpImageQueryLod``.
2982-
The result of ``OpImageQueryLod`` is a ``float2``. The first element contains
2983-
the mipmap array layer. The second element contains the unclamped level of detail.
3011+
the ``SamplerState`` or ``SamplerComparisonState`` passed to the function. The
3012+
resulting sampled image and the coordinate passed to the function are used to
3013+
invoke ``OpImageQueryLod``. The result of ``OpImageQueryLod`` is a ``float2``.
3014+
The first element contains the mipmap array layer. The second element contains
3015+
the unclamped level of detail.
29843016

29853017
``Texture1D``
29863018
~~~~~~~~~~~~~

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ For API clients and LLVM developers.
190190

191191
:doc:`CodeGenerator`
192192
The design and implementation of the LLVM code generator. Useful if you are
193-
working on retargetting LLVM to a new architecture, designing a new codegen
193+
working on retargeting LLVM to a new architecture, designing a new codegen
194194
pass, or enhancing existing components.
195195

196196
:doc:`TableGen <TableGen/index>`

include/dxc/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ configure_file(
1717

1818
add_subdirectory(DXIL)
1919
add_subdirectory(DxilContainer)
20-
add_subdirectory(HLSL)
2120
add_subdirectory(Support)
2221
add_subdirectory(Tracing)
2322

include/dxc/DxilContainer/DxcContainerBuilder.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
#pragma once
1313

14-
#include "dxc/DxilContainer/DxilContainer.h"
14+
// Include Windows header early for DxilHash.h.
1515
#include "dxc/Support/Global.h"
1616
#include "dxc/Support/WinIncludes.h"
17+
18+
#include "dxc/DxilContainer/DxilContainer.h"
19+
#include "dxc/DxilHash/DxilHash.h"
1720
#include "dxc/Support/microcom.h"
1821
#include "dxc/dxcapi.h"
1922
#include "llvm/ADT/SmallVector.h"
@@ -46,6 +49,7 @@ class DxcContainerBuilder : public IDxcContainerBuilder {
4649
m_warning = warning;
4750
m_RequireValidation = false;
4851
m_HasPrivateData = false;
52+
m_HashFunction = nullptr;
4953
}
5054

5155
protected:
@@ -66,6 +70,13 @@ class DxcContainerBuilder : public IDxcContainerBuilder {
6670
const char *m_warning;
6771
bool m_RequireValidation;
6872
bool m_HasPrivateData;
73+
// Function to compute hash when valid dxil container is built
74+
// This is nullptr if loaded container has invalid hash
75+
HASH_FUNCTION_PROTO *m_HashFunction;
76+
77+
void DetermineHashFunctionFromContainerContents(
78+
const DxilContainerHeader *ContainerHeader);
79+
void HashAndUpdate(DxilContainerHeader *ContainerHeader);
6980

7081
UINT32 ComputeContainerSize();
7182
HRESULT UpdateContainerHeader(AbstractMemoryStream *pStream,

include/dxc/DxilContainer/DxilContainer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ enum class DxilProgramSigSemantic : uint32_t {
166166
InnerCoverage = 70,
167167
};
168168

169+
DxilProgramSigSemantic SemanticKindToSystemValue(DXIL::SemanticKind,
170+
DXIL::TessellatorDomain);
171+
169172
enum class DxilProgramSigCompType : uint32_t {
170173
Unknown = 0,
171174
UInt32 = 1,
@@ -179,6 +182,9 @@ enum class DxilProgramSigCompType : uint32_t {
179182
Float64 = 9,
180183
};
181184

185+
DxilProgramSigCompType CompTypeToSigCompType(DXIL::ComponentType,
186+
bool i1ToUnknownCompat);
187+
182188
struct DxilProgramSignatureElement {
183189
uint32_t Stream; // Stream index (parameters must appear in non-decreasing
184190
// stream order)

0 commit comments

Comments
 (0)