Skip to content

Commit 693103f

Browse files
committed
Merge remote-tracking branch 'origin/master' into hlsl-2021
2 parents 0e15e09 + 5fba0c3 commit 693103f

File tree

154 files changed

+5083
-890
lines changed

Some content is hidden

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

154 files changed

+5083
-890
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Before you build, you will need to have some additional software installed. This
4848

4949
* [Git](http://git-scm.com/downloads).
5050
* [Python](https://www.python.org/downloads/) - version 3.x is required
51-
* [Visual Studio 2017](https://www.visualstudio.com/downloads) - select the following workloads:
51+
* [Visual Studio 2019](https://www.visualstudio.com/downloads) - select the following workloads:
5252
* Universal Windows Platform Development
5353
* Desktop Development with C++
5454
* [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk) - version 10.0.18362.0 or newer

azure-pipelines.yml

Lines changed: 82 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,116 @@
1-
# Starter pipeline
2-
# Start with a minimal pipeline that you can customize to build and deploy your code.
3-
# Add steps that build, run tests, deploy, and more:
4-
# https://aka.ms/yaml
5-
61
resources:
72
- repo: self
83

94
stages:
105
- stage: Build
116
jobs:
12-
- job: Linux
7+
- job: Windows
138
timeoutInMinutes: 90
149

1510
pool:
16-
vmImage: Ubuntu-18.04
11+
vmImage: windows-2019
12+
13+
variables:
14+
HLSL_SRC_DIR: '$(Build.SourcesDirectory)'
15+
HLSL_BLD_DIR: '$(Agent.BuildDirectory)'
16+
platform: x64
1717

1818
strategy:
1919
matrix:
20-
Clang_Release:
20+
VS2019_Release:
2121
configuration: Release
22-
CC: clang
23-
CXX: clang++
24-
CXX_FLAGS: -Werror
25-
Clang_Debug:
22+
VS2019_Debug:
2623
configuration: Debug
27-
CC: clang
28-
CXX: clang++
29-
CXX_FLAGS: -Werror
30-
Gcc_Release:
31-
configuration: Release
32-
CC: gcc-7
33-
CXX: g++-7
34-
CXX_FLAGS:
35-
Gcc_Debug:
36-
configuration: Debug
37-
CC: gcc-7
38-
CXX: g++-7
39-
CXX_FLAGS:
4024

4125
steps:
42-
- bash: sudo apt-get install ninja-build
43-
displayName: 'Installing dependencies'
44-
- bash: git submodule update --init
26+
- script: git submodule update --init
4527
displayName: 'Updating submodules'
46-
- bash: |
47-
mkdir build
48-
cd build
49-
cmake -G Ninja .. $(cat ../utils/cmake-predefined-config-params) -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$(configuration) -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
50-
displayName: 'Cmake configuration'
51-
- bash: |
52-
cd build
53-
ninja
28+
- script: |
29+
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
30+
call utils\hct\hctbuild.cmd -$(platform) -$(configuration) -show-cmake-log -spirvtest
5431
displayName: 'Building'
55-
- bash: |
56-
./build/bin/dxc -T ps_6_0 tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
57-
./build/bin/dxc -T ps_6_0 -Fo passthru-ps.dxil tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
58-
./build/bin/dxc -T ps_6_0 -Fo passthru-ps.spv tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
59-
displayName: 'Smoke tests'
60-
- bash: ./build/bin/clang-spirv-tests --spirv-test-root tools/clang/test/CodeGenSPIRV/
61-
displayName: 'SPIRV tests'
62-
- bash: ./build/bin/clang-hlsl-tests --HlslDataDir $PWD/tools/clang/test/HLSL/
63-
displayName: 'DXIL tests'
32+
- script: |
33+
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
34+
call utils\hct\hcttest.cmd -$(configuration) noexec
35+
displayName: 'DXIL Tests'
36+
- script: |
37+
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
38+
call utils\hct\hcttest.cmd -$(configuration) spirv_only
39+
displayName: 'SPIRV Tests'
6440
65-
- job: MacOS
41+
- job: Nix
6642
timeoutInMinutes: 90
6743

68-
pool:
69-
vmImage: macOS-10.14
70-
7144
variables:
72-
configuration: Release
73-
CC: clang
74-
CXX: clang++
75-
CXX_FLAGS: -Werror
45+
macOS: macOS-11
46+
linux: Ubuntu-18.04
7647

7748
strategy:
7849
matrix:
79-
Clang_Release:
80-
configuration: Release
81-
Clang_Debug:
82-
configuration: Debug
50+
Linux_Clang_Release:
51+
image: ${{ variables.linux }}
52+
configuration: Release
53+
CC: clang
54+
CXX: clang++
55+
CXX_FLAGS: -Werror
56+
OS: Linux
57+
Linux_Clang_Debug:
58+
image: ${{ variables.linux }}
59+
configuration: Debug
60+
CC: clang
61+
CXX: clang++
62+
CXX_FLAGS: -Werror
63+
Linux_Gcc_Release:
64+
image: ${{ variables.linux }}
65+
configuration: Release
66+
CC: gcc-7
67+
CXX: g++-7
68+
CXX_FLAGS:
69+
Linux_Gcc_Debug:
70+
image: ${{ variables.linux }}
71+
configuration: Debug
72+
CC: gcc-7
73+
CXX: g++-7
74+
CXX_FLAGS:
75+
MacOS_Clang_Release:
76+
image: ${{ variables.macOS }}
77+
configuration: Release
78+
CC: clang
79+
CXX: clang++
80+
CXX_FLAGS: -Werror
81+
OS: MacOS
82+
MacOS_Clang_Debug:
83+
image: ${{ variables.macOS }}
84+
configuration: Debug
85+
CC: clang
86+
CXX: clang++
87+
CXX_FLAGS: -Werror
88+
89+
pool:
90+
vmImage: $(image)
8391

8492
steps:
93+
- task: UsePythonVersion@0
94+
inputs:
95+
versionSpec: '3.x'
96+
97+
- bash: sudo apt-get install ninja-build
98+
displayName: 'Installing dependencies'
99+
condition: eq(variables['image'], variables['linux'])
100+
85101
- bash: |
86102
brew update
87103
brew install ninja
104+
ulimit -Sn 1024
88105
displayName: 'Installing dependencies'
106+
condition: eq(variables['image'], variables['macOS'])
89107
- bash: git submodule update --init
90108
displayName: 'Updating submodules'
91109
- bash: |
92110
mkdir build
93111
cd build
94-
cmake -G Ninja .. $(cat ../utils/cmake-predefined-config-params) -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$(configuration) -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
95-
displayName: 'Cmake configuration'
112+
cmake -G Ninja $BUILD_SOURCESDIRECTORY $(cat $BUILD_SOURCESDIRECTORY/utils/cmake-predefined-config-params) -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${configuration} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS=${CXX_FLAGS}
113+
displayName: 'Running Cmake'
96114
- bash: |
97115
cd build
98116
ninja
@@ -101,12 +119,11 @@ stages:
101119
./build/bin/dxc -T ps_6_0 tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
102120
./build/bin/dxc -T ps_6_0 -Fo passthru-ps.dxil tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
103121
./build/bin/dxc -T ps_6_0 -Fo passthru-ps.spv tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
122+
ls -ld $AGENT_BUILDDIRECTORY
123+
ls -ld $BUILD_SOURCESDIRECTORY
104124
displayName: 'Smoke tests'
105-
- bash: |
106-
ulimit -Sn 1024
107-
./build/bin/clang-spirv-tests --spirv-test-root tools/clang/test/CodeGenSPIRV/
125+
- bash: ./build/bin/clang-spirv-tests --spirv-test-root tools/clang/test/CodeGenSPIRV/
108126
displayName: 'SPIRV tests'
109-
- bash: |
110-
ulimit -Sn 1024
111-
./build/bin/clang-hlsl-tests --HlslDataDir $PWD/tools/clang/test/HLSL/
127+
- bash: ./build/bin/clang-hlsl-tests --HlslDataDir $PWD/tools/clang/test/HLSL/
112128
displayName: 'DXIL tests'
129+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -----------------------------------------------------------------------------
2+
# ShaderCompiler DXC Master Nightly Build Pipeline Entry Point
3+
# -----------------------------------------------------------------------------
4+
5+
name: DXC.Master.Nightly.$(date:yyMMdd).$(rev:rr)
6+
7+
trigger: none
8+
9+
parameters:
10+
- name: BuildConfigurations
11+
type: object
12+
default: [Release, Debug]
13+
14+
- name: BuildPlatforms
15+
type: object
16+
default: [x64, x86, arm64]
17+
18+
resources:
19+
repositories:
20+
- repository: XboxDXC
21+
type: git
22+
name: Xbox/Xbox.ShaderCompiler.DXC
23+
ref: refs/heads/Xbox
24+
25+
extends:
26+
template: azure-pipelines\templates\DXC.Master.Nightly.template.yml@XboxDXC
27+
parameters:
28+
BuildConfigurations: ${{parameters.BuildConfigurations}}
29+
BuildPlatforms: ${{parameters.BuildPlatforms}}
30+
StatusEmail: $(StatusEmail)

azure-pipelines/DXC.Release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# -----------------------------------------------------------------------------
2+
# ShaderCompiler DXC Release Pipeline Entry Point
3+
# -----------------------------------------------------------------------------
4+
5+
name: DXC.Release.$(date:yyMMdd).$(rev:rr)
6+
7+
trigger: none
8+
9+
parameters:
10+
- name: BuildConfigurations
11+
type: object
12+
default: [Release, Debug]
13+
14+
- name: BuildPlatforms
15+
type: object
16+
default: [x64, x86, arm64]
17+
18+
resources:
19+
repositories:
20+
- repository: XboxDXC
21+
type: git
22+
name: Xbox/Xbox.ShaderCompiler.DXC
23+
ref: refs/heads/Xbox
24+
25+
extends:
26+
template: azure-pipelines\templates\DXC.Release.template.yml@XboxDXC
27+
parameters:
28+
BuildConfigurations: ${{parameters.BuildConfigurations}}
29+
BuildPlatforms: ${{parameters.BuildPlatforms}}
30+
StatusEmail: $(StatusEmail)

external/SPIRV-Tools

Submodule SPIRV-Tools updated 437 files

include/dxc/DXIL/DxilMetadataHelper.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ class DxilMDHelper {
115115
static const char kDxilSourceMainFileNameMDName[];
116116
static const char kDxilSourceArgsMDName[];
117117

118+
// Resource binding data
119+
static const char kDxilDxcBindingTableMDName[];
120+
static const unsigned kDxilDxcBindingTableResourceName = 0;
121+
static const unsigned kDxilDxcBindingTableResourceClass = 1;
122+
static const unsigned kDxilDxcBindingTableResourceIndex = 2;
123+
static const unsigned kDxilDxcBindingTableResourceSpace = 3;
124+
118125
// Old source info.
119126
static const char kDxilSourceContentsOldMDName[];
120127
static const char kDxilSourceDefinesOldMDName[];
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// //
3+
// DxcBindingTable.h //
4+
// Copyright (C) Microsoft Corporation. All rights reserved. //
5+
// This file is distributed under the University of Illinois Open Source //
6+
// License. See LICENSE.TXT for details. //
7+
// //
8+
///////////////////////////////////////////////////////////////////////////////
9+
10+
#pragma once
11+
12+
#include "llvm/ADT/StringRef.h"
13+
#include "dxc/DXIL/DxilConstants.h"
14+
15+
#include <string>
16+
#include <map>
17+
18+
namespace llvm {
19+
class raw_ostream;
20+
class Module;
21+
}
22+
23+
namespace hlsl {
24+
class DxilModule;
25+
}
26+
27+
namespace hlsl {
28+
struct DxcBindingTable {
29+
typedef std::pair<std::string, hlsl::DXIL::ResourceClass> Key;
30+
struct Entry {
31+
unsigned index = UINT_MAX;
32+
unsigned space = UINT_MAX;
33+
};
34+
std::map<Key, Entry> entries;
35+
};
36+
37+
bool ParseBindingTable(llvm::StringRef fileName, llvm::StringRef content, llvm::raw_ostream &errors, DxcBindingTable *outTable);
38+
void WriteBindingTableToMetadata(llvm::Module &M, const DxcBindingTable &table);
39+
void ApplyBindingTableFromMetadata(hlsl::DxilModule &DM);
40+
41+
}

include/dxc/DxilPIXPasses/DxilPIXPasses.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ModulePass *createDxilReduceMSAAToSingleSamplePass();
2525
ModulePass *createDxilForceEarlyZPass();
2626
ModulePass *createDxilDebugInstrumentationPass();
2727
ModulePass *createDxilShaderAccessTrackingPass();
28+
ModulePass *createDxilPIXAddTidToAmplificationShaderPayloadPass();
2829

2930
void initializeDxilAddPixelHitInstrumentationPass(llvm::PassRegistry&);
3031
void initializeDxilDbgValueToDbgDeclarePass(llvm::PassRegistry&);
@@ -36,5 +37,6 @@ void initializeDxilReduceMSAAToSingleSamplePass(llvm::PassRegistry&);
3637
void initializeDxilForceEarlyZPass(llvm::PassRegistry&);
3738
void initializeDxilDebugInstrumentationPass(llvm::PassRegistry&);
3839
void initializeDxilShaderAccessTrackingPass(llvm::PassRegistry&);
40+
void initializeDxilPIXAddTidToAmplificationShaderPayloadPass(llvm::PassRegistry&);
3941

4042
}

include/dxc/HLSL/HLOperationLower.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
namespace llvm {
1616
class Instruction;
17-
class LoadInst;
1817
class Function;
1918
}
2019

@@ -25,5 +24,5 @@ class HLSLExtensionsCodegenHelper;
2524

2625
void TranslateBuiltinOperations(
2726
HLModule &HLM, HLSLExtensionsCodegenHelper *extCodegenHelper,
28-
std::unordered_set<llvm::LoadInst *> &UpdateCounterSet);
27+
std::unordered_set<llvm::Instruction *> &UpdateCounterSet);
2928
}

include/dxc/Support/HLSLOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class DxcOpts {
131131
std::vector<std::string> Exports; // OPT_exports
132132
std::vector<std::string> PreciseOutputs; // OPT_precise_output
133133
llvm::StringRef DefaultLinkage; // OPT_default_linkage
134+
llvm::StringRef ImportBindingTable; // OPT_import_binding_table
134135
unsigned DefaultTextCodePage = DXC_CP_UTF8; // OPT_encoding
135136

136137
bool AllResourcesBound = false; // OPT_all_resources_bound
@@ -164,6 +165,7 @@ class DxcOpts {
164165
bool ShowHelp = false; // OPT_help
165166
bool ShowHelpHidden = false; // OPT__help_hidden
166167
bool ShowOptionNames = false; // OPT_fdiagnostics_show_option
168+
bool ShowVersion = false; // OPT_version
167169
bool UseColor = false; // OPT_Cc
168170
bool UseHexLiterals = false; // OPT_Lx
169171
bool UseInstructionByteOffsets = false; // OPT_No

0 commit comments

Comments
 (0)