Skip to content

Commit 24040a0

Browse files
author
joaosaffran
committed
Merge branch 'validation/check-descriptors-are-bound' into validation/textures-not-bind-root-signatures
2 parents 9c34f3f + 662c3a8 commit 24040a0

9 files changed

+9
-13
lines changed

llvm/include/llvm/Frontend/HLSL/RootSignatureValidations.h

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

1717
#include "llvm/ADT/IntervalMap.h"
1818
#include "llvm/Frontend/HLSL/HLSLRootSignature.h"
19-
#include "llvm/Support/DXILABI.h"
2019

2120
namespace llvm {
2221
namespace hlsl {
@@ -180,7 +179,7 @@ class RootSignatureBindingValidation {
180179
}
181180
};
182181
llvm::SmallVector<RangeInfo>
183-
findUnboundRanges(const llvm::SmallVectorImpl<RangeInfo> &Ranges,
182+
findUnboundRanges(const llvm::ArrayRef<RangeInfo> &Ranges,
184183
const llvm::ArrayRef<RangeInfo> &Bindings);
185184
} // namespace rootsig
186185
} // namespace hlsl

llvm/lib/Frontend/HLSL/RootSignatureValidations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ findOverlappingRanges(llvm::SmallVector<RangeInfo> &Infos) {
317317
}
318318

319319
llvm::SmallVector<RangeInfo>
320-
findUnboundRanges(const llvm::SmallVectorImpl<RangeInfo> &Ranges,
320+
findUnboundRanges(const llvm::ArrayRef<RangeInfo> &Ranges,
321321
const llvm::ArrayRef<RangeInfo> &Bindings) {
322322
llvm::SmallVector<RangeInfo> Unbounds;
323323
for (const auto &Range : Ranges) {

llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313
#include "llvm/ADT/ArrayRef.h"
1414
#include "llvm/ADT/STLForwardCompat.h"
1515
#include "llvm/ADT/SmallString.h"
16-
#include "llvm/ADT/SmallVector.h"
1716
#include "llvm/Analysis/DXILMetadataAnalysis.h"
1817
#include "llvm/Analysis/DXILResource.h"
19-
#include "llvm/BinaryFormat/DXContainer.h"
2018
#include "llvm/Frontend/HLSL/RootSignatureValidations.h"
2119
#include "llvm/IR/DiagnosticInfo.h"
2220
#include "llvm/IR/Instructions.h"
2321
#include "llvm/IR/IntrinsicsDirectX.h"
2422
#include "llvm/IR/Module.h"
2523
#include "llvm/InitializePasses.h"
26-
#include "llvm/MC/DXContainerRootSignature.h"
27-
#include "llvm/Support/DXILABI.h"
2824

2925
#define DEBUG_TYPE "dxil-post-optimization-validation"
3026

@@ -152,7 +148,7 @@ static void reportRegNotBound(Module &M,
152148
OS << "register " << ResourceClassToString(Unbound.Class)
153149
<< " (space=" << Unbound.Space << ", register=" << Unbound.LowerBound
154150
<< ")"
155-
<< " is not defined in Root Signature";
151+
<< " does not have a binding in the Root Signature";
156152
M.getContext().diagnose(DiagnosticInfoGeneric(Message));
157153
}
158154

llvm/lib/Target/DirectX/DXILPostOptimizationValidation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "llvm/IR/PassManager.h"
1818

1919
namespace llvm {
20+
2021
class DXILPostOptimizationValidation
2122
: public PassInfoMixin<DXILPostOptimizationValidation> {
2223
public:

llvm/test/CodeGen/DirectX/rootsignature-validation-fail-cbuffer.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s
22

3-
; CHECK: error: register CBuffer (space=665, register=3) is not defined in Root Signature
3+
; CHECK: error: register CBuffer (space=665, register=3) does not have a binding in the Root Signature
44

55
; Root Signature(
66
; CBV(b3, space=666, visibility=SHADER_VISIBILITY_ALL)

llvm/test/CodeGen/DirectX/rootsignature-validation-fail-constants.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s
2-
; CHECK: error: register CBuffer (space=666, register=2) is not defined in Root Signature
2+
; CHECK: error: register CBuffer (space=666, register=2) does not have a binding in the Root Signature
33
; Root Signature(RootConstants(num32BitConstants=4, b2))
44

55
%__cblayout_CB = type <{ float }>

llvm/test/CodeGen/DirectX/rootsignature-validation-fail-sampler.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s
22

3-
; CHECK: error: register Sampler (space=2, register=3) is not defined in Root Signature
3+
; CHECK: error: register Sampler (space=2, register=3) does not have a binding in the Root Signature
44

55
; Root Signature(
66
; CBV(b3, space=666, visibility=SHADER_VISIBILITY_ALL)

llvm/test/CodeGen/DirectX/rootsignature-validation-fail-srv.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s
22

3-
; CHECK: error: register SRV (space=0, register=0) is not defined in Root Signature
3+
; CHECK: error: register SRV (space=0, register=0) does not have a binding in the Root Signature
44

55
; Root Signature(
66
; CBV(b3, space=666, visibility=SHADER_VISIBILITY_ALL)

llvm/test/CodeGen/DirectX/rootsignature-validation-fail-uav.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: not opt -S -passes='dxil-post-optimization-validation' -mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1 | FileCheck %s
22

3-
; CHECK: error: register UAV (space=0, register=4294967295) is not defined in Root Signature
3+
; CHECK: error: register UAV (space=0, register=4294967295) does not have a binding in the Root Signature
44

55
; Root Signature(
66
; CBV(b3, space=666, visibility=SHADER_VISIBILITY_ALL)

0 commit comments

Comments
 (0)