File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
include/llvm/Frontend/HLSL Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1155,10 +1155,9 @@ bool SemaHLSL::handleRootSignatureElements(
1155
1155
}
1156
1156
}
1157
1157
1158
- // Sort as specified
1159
- auto ComparePairs = [](InfoPair A, InfoPair B) { return A.first < B.first ; };
1160
-
1161
- std::sort (InfoPairs.begin (), InfoPairs.end (), ComparePairs);
1158
+ // 2. Sort with the RangeInfo <operator to prepare it for findOverlapping
1159
+ std::sort (InfoPairs.begin (), InfoPairs.end (),
1160
+ [](InfoPair A, InfoPair B) { return A.first < B.first ; });
1162
1161
1163
1162
llvm::SmallVector<RangeInfo> Infos;
1164
1163
for (const InfoPair &Pair : InfoPairs)
@@ -1205,6 +1204,7 @@ bool SemaHLSL::handleRootSignatureElements(
1205
1204
this ->Diag (OElem->getLocation (), diag::note_hlsl_resource_range_here);
1206
1205
};
1207
1206
1207
+ // 3. Invoke find overlapping ranges
1208
1208
llvm::SmallVector<OverlappingRanges> Overlaps =
1209
1209
llvm::hlsl::rootsig::findOverlappingRanges (Infos);
1210
1210
for (OverlappingRanges Overlap : Overlaps)
Original file line number Diff line number Diff line change @@ -137,8 +137,8 @@ struct OverlappingRanges {
137
137
// / - RangeInfo will retain the interval, ResourceClass, Space and Visibility
138
138
// / - It will also contain an index so that it can be associated to
139
139
// / additional diagnostic information
140
- // / 2. Sort the RangeInfo's such that they are grouped together by
141
- // / ResourceClass and Space
140
+ // / 2. The user is required to sort the RangeInfo's such that they are grouped
141
+ // / together by ResourceClass and Space
142
142
// / 3. Iterate through the collected RangeInfos by their groups
143
143
// / - For each group we will have a ResourceRange for each visibility
144
144
// / - As we iterate through we will:
Original file line number Diff line number Diff line change @@ -245,7 +245,8 @@ std::optional<const RangeInfo *> ResourceRange::insert(const RangeInfo &Info) {
245
245
246
246
llvm::SmallVector<OverlappingRanges>
247
247
findOverlappingRanges (ArrayRef<RangeInfo> Infos) {
248
- // 1. The user has provided the corresponding range information
248
+ // It is expected that Infos is filled with valid RangeInfos and that
249
+ // they are sorted with respect to the RangeInfo <operator
249
250
llvm::SmallVector<OverlappingRanges> Overlaps;
250
251
using GroupT = std::pair<dxil::ResourceClass, /* Space*/ uint32_t >;
251
252
You can’t perform that action at this time.
0 commit comments