Skip to content

Commit d001d58

Browse files
Merge branch 'microsoft:main' into main
2 parents 9b9ce19 + ac36a79 commit d001d58

File tree

751 files changed

+31255
-11549
lines changed

Some content is hidden

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

751 files changed

+31255
-11549
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @microsoft/hlsl-release

.github/ISSUE_TEMPLATE/release.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Release
3+
about: Create a tracking issue for a release
4+
title: 'Release 1.x.xxxx'
5+
labels: []
6+
assignees: ''
7+
8+
---
9+
10+
# Schedule
11+
12+
- [ ] MM/DD/YYYY - Release branch forks from `main`
13+
- At this point, changes must be cherry-picked into the release branch in
14+
order for them to be included in the release.
15+
- [ ] MM/DD/YYYY - Release Candidate 1 (begin Ask Mode[^1] for release branch).
16+
- At this point, changes must be approved by @microsoft/hlsl-release
17+
- [ ] MM/DD/YYYY - Final Release Candidate
18+
- [ ] MM/DD/YYYY - Target Release Date
19+
20+
21+
# Tasks
22+
23+
## Before Fork
24+
25+
This part of the release process is to 'prime the pump' - that is to make sure
26+
that all the various parts of the engineering system are set into place so that
27+
we are confident we can generate builds for the new branch
28+
29+
- [ ] Update version number
30+
- [ ] Create the release branch from `main`
31+
- The release branch is kept into sync with main via regular fast-forward
32+
merges.
33+
- [ ] Internal branches and build pipelines configured
34+
- Verify that the engineering system can build:
35+
- [ ] Zip files for github release
36+
- [ ] NuGet package
37+
- [ ] VPack
38+
- [ ] Final merge of `main` into the release branch
39+
40+
## After Fork
41+
42+
- [ ] Update README.md
43+
- [ ] Create draft of Release post on GitHub
44+
45+
## Quality Sign Off
46+
47+
- [ ] Microsoft Testing Sign-off (@pow2clk)
48+
- [ ] Google Testing Sign-off (@s-perron / @Keenuts)
49+
50+
## Release
51+
52+
- [ ] Tag final release and post binaries
53+
54+
55+
[^1]: [Ask Mode](https://devblogs.microsoft.com/oldnewthing/20140722-00/?p=433)
56+
is a Microsoft-ism to denote when changes require approval before accepting
57+
merges. For DXC this will require approval from @microsoft/hlsl-release

.github/ISSUE_TEMPLATE/support.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: User support
3+
about: Ask the maintainers a question or for support.
4+
title: ''
5+
labels: ['user-support', 'needs-triage']
6+
assignees: ''
7+
8+
---
9+
10+
**What is the issue you're encountering?**
11+
<!--- Please provide a few sentences describing the issue you encountered. --->
12+
13+
**Steps to Reproduce (if applicable)**
14+
<!--- If you're encountering a problem, please provide a description of how you
15+
got to the state you're in. If possible please provide source and tool command
16+
line options. If the issue reproduces on Compiler Explorer
17+
(https://godbolt.org/) or Shader Playground
18+
(https://shader-playground.timjones.io/) please provide a link. If the source is
19+
split across multiple files, please preprocess into a single file using DXC's
20+
command line `-P -Fi <path>`.--->
21+
22+
23+
**Environment**
24+
- DXC version <!-- replace with the output of 'dxc --version' -->
25+
- Host Operating System <!--- Host operating system and version --->
26+
27+
<!--- If this is a build issue please include CMake version, compiler and
28+
version, and the CMake invocation used to configure your build directory. --->

.github/workflows/pr-description-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'PR description checker'
22
on:
3-
pull_request:
3+
pull_request_target:
44
types:
55
- opened
66
- edited

.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.

CMakeLists.txt

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,19 +104,26 @@ endif()
104104
option(DXC_DISABLE_ALLOCATOR_OVERRIDES "Disable usage of allocator overrides" OFF)
105105
mark_as_advanced(DXC_DISABLE_ALLOCATOR_OVERRIDES)
106106

107+
option(DXC_CODEGEN_EXCEPTIONS_TRAP "An exception in code generation generates a trap, ending the compiler process" OFF)
108+
mark_as_advanced(DXC_CODEGEN_EXCEPTIONS_TRAP)
109+
107110
# adjust link option to enable debugging from kernel mode; not compatible with incremental linking
108-
if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32 AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
111+
if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND MSVC AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
109112
add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO)
110113
endif()
111114

112115
# enable control flow guard
113116
if(WIN32)
114-
add_compile_options(/guard:cf)
115-
add_link_options(/guard:cf)
117+
if(MSVC)
118+
add_compile_options(/guard:cf)
119+
add_link_options(/guard:cf)
120+
else()
121+
add_compile_options(-fcf-protection)
122+
endif()
116123
endif(WIN32)
117124

118125
# Enable CET Shadow Stack
119-
if(WIN32 AND NOT (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*"))
126+
if(MSVC AND NOT (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*"))
120127
add_link_options(/CETCOMPAT)
121128
endif()
122129

@@ -318,6 +325,9 @@ else()
318325
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
319326
endif()
320327

328+
option(LLVM_ASSERTIONS_TRAP "Force assertions to always trap, rather than the default unspecified behavior (e.g. RaiseException on Windows)" OFF)
329+
option(LLVM_ASSERTIONS_NO_STRINGS "Make assertion macro drops strings to reduce binary size" OFF)
330+
321331
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
322332
"Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
323333

@@ -447,7 +457,7 @@ set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
447457
include(HandleLLVMOptions)
448458

449459
# Verify that we can find a Python 3 interpreter and force cmake to use it.
450-
find_package(PythonInterp 3 REQUIRED)
460+
find_package(Python3 REQUIRED)
451461

452462
######
453463
# LLVMBuild Integration
@@ -481,7 +491,7 @@ endif (LLVM_USE_OPROFILE)
481491
message(STATUS "Constructing LLVMBuild project information")
482492

483493
execute_process(
484-
COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL}
494+
COMMAND ${Python3_EXECUTABLE} ${LLVMBUILDTOOL}
485495
--native-target Unknown
486496
--enable-targets "${LLVM_TARGETS_TO_BUILD}"
487497
--enable-optional-components "${LLVMOPTIONALCOMPONENTS}"
@@ -616,9 +626,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
616626

617627
# HLSL Change Starts - override assert to RaiseException instead of abort
618628
# for better test behavior
619-
if(WIN32 AND NOT UNIX)
620-
include_directories(BEFORE "${LLVM_MAIN_INCLUDE_DIR}/llvm/llvm_assert")
621-
endif()
629+
include_directories(BEFORE "${LLVM_MAIN_INCLUDE_DIR}/llvm/llvm_assert")
622630
# HLSL Change Ends
623631

624632
include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR})
@@ -646,9 +654,9 @@ endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
646654
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
647655

648656
# enable warnings as errors for debug build
649-
if (WIN32)
657+
if (MSVC)
650658
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /WX")
651-
endif (WIN32)
659+
endif (MSVC)
652660

653661
include(AddLLVM)
654662
include(TableGen)
@@ -761,7 +769,9 @@ if (LLVM_INCLUDE_DOCS)
761769
add_subdirectory(docs)
762770
endif()
763771

764-
add_hlsl_hctgen(DxilDocs OUTPUT docs/DXIL.rst CODE_TAG) # HLSL Change
772+
if (LLVM_BUILD_DOCS)
773+
add_hlsl_hctgen(DxilDocs OUTPUT docs/DXIL.rst CODE_TAG) # HLSL Change
774+
endif()
765775

766776
add_subdirectory(cmake/modules)
767777

CONTRIBUTING.md

Lines changed: 101 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
One of the easiest ways to contribute is to participate in discussions and discuss issues. You can also contribute by submitting pull requests with code changes.
44

5-
65
## General feedback and discussions?
7-
Please start a discussion on the repo issue tracker.
86

7+
Please start a discussion on the repo issue tracker.
98

109
## Bugs and feature requests?
11-
For non-security related bugs please log a new issue in the GitHub repo.
1210

11+
For non-security related bugs please log a new issue in the GitHub repo.
1312

1413
## Reporting security issues and bugs
15-
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094.aspx).
1614

15+
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <[email protected]>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094.aspx).
1716

1817
## Filing issues
18+
1919
When filing issues, please use our [bug filing templates](https://github.com/aspnet/Home/wiki/Functional-bug-template).
2020
The best way to get your bug fixed is to be as detailed as you can be about the problem.
2121
Providing a minimal project with steps to reproduce the problem is ideal.
@@ -28,65 +28,116 @@ Here are questions you can answer before you file a bug to make sure you're not
2828

2929
GitHub supports [markdown](https://help.github.com/articles/github-flavored-markdown/), so when filing bugs make sure you check the formatting before clicking submit.
3030

31-
3231
## Contributing code and content
32+
3333
You will need to complete a Contributor License Agreement (CLA) before your pull request can be accepted. This agreement testifies that you are granting us permission to use the source code you are submitting, and that this work is being submitted under appropriate license that we can use it.
3434

3535
You can complete the CLA by going through the steps at the [Contribution License Agreement site](https://cla.microsoft.com). Once we have received the signed CLA, we'll review the request. You will only need to do this once.
3636

37-
Make sure you can build the code. Familiarize yourself with the project workflow and our coding conventions. If you don't know what a pull request is read this article: https://help.github.com/articles/using-pull-requests. The hcttest command is your friend.
37+
Make sure you can build the code. Familiarize yourself with the project workflow and our coding conventions. If you don't know what a pull request is read this article: <https://help.github.com/articles/using-pull-requests>.
3838

3939
Before submitting a feature or substantial code contribution please discuss it with the team and ensure it follows the product roadmap. You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. Note that all code submissions will be rigorously reviewed and tested by the team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.
4040

41-
Here's a few things you should always do when making changes to the code base:
42-
43-
**Engineering guidelines**
41+
### Coding guidelines
4442

4543
The coding, style, and general engineering guidelines follow those described in the docs/CodingStandards.rst. For additional guidelines in code specific to HLSL, see the docs/HLSLChanges.rst file.
4644

47-
DXC has adopted a clang-format requirement for all incoming changes. PRs to DXC should have the _changed code_ clang formatted to the LLVM style, and leave the remaining portions of the file unchanged. This can be done using the `git-clang-format` tool or IDE driven workflows. A GitHub action will run on all PRs to validate that the change is properly formatted.
45+
DXC has adopted a clang-format requirement for all incoming changes to C and C++ files. PRs to DXC should have the *changed code* clang formatted to the LLVM style, and leave the remaining portions of the file unchanged. This can be done using the `git-clang-format` tool or IDE driven workflows. A GitHub action will run on all PRs to validate that the change is properly formatted.
4846

49-
**Commit/Pull Request Format**
47+
### Documenting Pull Requests
5048

51-
```
52-
Summary of the changes (Less than 80 chars)
53-
- Detail 1
54-
- Detail 2
49+
Pull request descriptions should have the following format:
50+
51+
```md
52+
Title summary of the changes (Less than 80 chars)
53+
- Description Detail 1
54+
- Description Detail 2
5555

56-
Fixes #bugnumber (in this specific format)
56+
Fixes #bugnumber (Where relevant. In this specific format)
5757
```
5858

59-
Your pull request should:
60-
61-
* Include a description of what your change intends to do
62-
* The title of your PR should be a very brief description of the change, and
63-
can use tags to allow for speedy categorization.
64-
* Titles under 76 characters print nicely in unix terminals under `git log`.
65-
This is not a hard requirement, but is good guidance.
66-
* Title tags are generally one word or acronym enclosed in square brackets.
67-
Limiting to one or two tags is ideal to keep titles short. Some examples
68-
of common tags are:
69-
* [NFC] - No Functional Change
70-
* [RFC] - Request For Comments (often used for drafts to get feedback)
71-
* [Doc] - Documentation change
72-
* [SPIRV] - Changes related to SPIR-V
73-
* [HLSL2021] - Changes related to HLSL 2021 features
74-
* Other tags in use: [Linux], [mac], [Win], [PIX], etc...
75-
* Tags aren't formalized or any specific limited set. If you're unsure of
76-
a reasonable tag to use, just don't use any. If you want to invent a new
77-
tag, go for it! These are to help categorize changes at a glance.
78-
* The PR description should include a more detailed description of the change,
79-
an explanation for the motivation of the change, and links to any relevant
80-
Issues. This does not need to be a dissertation, but should leave
81-
breadcrumbs for the next person debugging your code (who might be you).
82-
* Using the words `Fixes`, `Fixed`, `Closes`, `Closed`, or `Close` followed by
83-
`#<issuenumber>`, will auto close an issue after the PR is merged.
84-
* Be a child commit of a reasonably recent commit in the main branch
85-
* Pass all unit tests
86-
* Ensure that the title and description are fully up to date before merging
87-
* The title and description feed the final git commit message, and we want to
88-
ensure high quality commit messages in the repository history.
89-
* Include adequate tests
90-
* At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why
91-
* Tests should include reasonable permutations of the target fix/change
92-
* Include baseline changes with your change as needed
59+
#### Titles
60+
61+
The title should focus on what the change intends to do rather than how it was done.
62+
The description can and should explain how it was done if not obvious.
63+
64+
Titles under 76 characters print nicely in unix terminals under `git log`.
65+
This is not a hard requirement, but is good guidance.
66+
67+
Tags in titles allow for speedy categorization
68+
Title tags are generally one word or acronym enclosed in square brackets.
69+
Limiting to one or two tags is ideal to keep titles short.
70+
Some examples of common tags are:
71+
72+
- `[NFC]` - No Functional Change
73+
- `[RFC]` - Request For Comments (often used for drafts to get feedback)
74+
- `[Doc]` - Documentation change
75+
- `[SPIRV]` - Changes related to SPIR-V
76+
- `[HLSL2021]` - Changes related to HLSL 2021 features
77+
- Other tags in use: `[Linux]`, `[mac]`, `[Win]`, `[PIX]`, etc...
78+
79+
Tags aren't formalized or any specific limited set.
80+
If you're unsure of a reasonable tag to use, just don't use any.
81+
If you want to invent a new tag, go for it!
82+
These are to help categorize changes at a glance.
83+
84+
#### Descriptions
85+
86+
The PR description should include a more detailed description of the change,
87+
an explanation for the motivation of the change, and links to any relevant Issues.
88+
This does not need to be a dissertation, but should leave breadcrumbs for the next person debugging your code (who might be you).
89+
90+
Using the words `Fixes`, `Fixed`, `Closes`, `Closed`, or `Close` followed by
91+
`#<issuenumber>`, will auto close an issue after the PR is merged.
92+
93+
#### Release Notes
94+
95+
Significant changes may require release notes that highlight important
96+
compiler behavior changes for each named release.
97+
These include changes that are:
98+
99+
- Visible to the users
100+
- Significant changes to compiler behavior
101+
- New features: Language, Hardware support, compiler options
102+
- Important bug fixes
103+
- Changes in default behavior
104+
105+
When such a change is made, the release note should be included as part of that change.
106+
This is done in the docs/ReleaseNotes.md file.
107+
108+
If the change is meant for a named release, it should be added to that named release's section of the release notes file.
109+
As the change is merged to the appropriate release branches, the release notes will come along with it.
110+
111+
If a change is meant for the next upcoming release, it should be added to the "Upcoming Release" section.
112+
When the next upcoming release is named, the title will be updated and the release note will be included in the appropriate release.
113+
114+
When writing release note list entries:
115+
116+
- Keep the description to a single sentence.
117+
- Links to specific PRs shouldn't be included.
118+
- Markdown links to bugs are encouraged if the issue is too complicated to completely explain in a single sentence.
119+
- Remember to update release notes as the nature of the change alters or is removed.
120+
121+
### Testing Pull Requests
122+
123+
All changes that make functional or behavioral changes to the compiler whether by fixing bugs or adding features
124+
must include additional testing in the implementing pull request.
125+
Changes that do not change behavior may still be required to add testing if the change impacts areas with limited test coverage
126+
to verify that the change doesn't alter previously untested, but important behavior.
127+
For bug fixes, at least one added test should fail in the absence of your non-test code changes.
128+
Tests should include reasonable permutations of the target fix/change.
129+
Include baseline changes with your change as needed.
130+
131+
Submitting a pull request kicks off an automated set of regression tests that verify the change introduces no unwanted changes in behavior.
132+
For a pull request to be mergeable in GitHub, it will have to pass this regression test suite.
133+
Changes made to DXC for the benefit of external projects should be verified using that project's testing protocols to avoid churn.
134+
135+
For cases where any of the above testing requirements are not possible, please specify why in the pull request.
136+
137+
### Merging Pull Requests
138+
139+
Pull requests should be a child commit of a reasonably recent commit in the main branch.
140+
A pull request's commits should be squashed on merging except in very special circumstances usually involving release branches.
141+
142+
Ensure that the title and description are fully up to date before merging.
143+
The title and description feed the final git commit message, and we want to ensure high quality commit messages in the repository history.

0 commit comments

Comments
 (0)