Skip to content

Commit 79cdfff

Browse files
author
joaosaffran
committed
fix rebase issues
1 parent 17cee41 commit 79cdfff

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

llvm/lib/ObjectYAML/DXContainerEmitter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,7 @@ void DXContainerWriter::writeParts(raw_ostream &OS) {
290290
RS.Parameters.push_back(NewParam);
291291
}
292292

293-
if (Error Err = RS.write(OS))
294-
handleAllErrors(std::move(Err));
295-
293+
RS.write(OS);
296294
break;
297295
}
298296
uint64_t BytesWritten = OS.tell() - DataStart;

llvm/lib/Target/DirectX/DXContainerGlobals.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ void DXContainerGlobals::addRootSignature(Module &M,
175175
SmallString<256> Data;
176176
raw_svector_ostream OS(Data);
177177

178-
if (Error Err = RS.write(OS))
179-
handleAllErrors(std::move(Err));
178+
RS.write(OS);
180179

181180
Constant *Constant =
182181
ConstantDataArray::getString(M.getContext(), Data, /*AddNull*/ false);

llvm/lib/Target/DirectX/DXILRootSignature.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ static bool parseRootConstants(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD,
3434
if (RootConstNode->getNumOperands() != 5)
3535
return reportError(Ctx, "Invalid format for Root constants element");
3636

37-
dxbc::RootParameter NewParam;
38-
NewParam.ParameterType = dxbc::RootParameterType::Constants32Bit;
37+
mcdxbc::RootParameter NewParam;
38+
NewParam.Header.ParameterType = dxbc::RootParameterType::Constants32Bit;
3939

4040
auto *ShaderVisibility =
4141
mdconst::extract<ConstantInt>(RootConstNode->getOperand(1));
42-
NewParam.ShaderVisibility =
42+
NewParam.Header.ShaderVisibility =
4343
(dxbc::ShaderVisibility)ShaderVisibility->getZExtValue();
4444

4545
auto *ShaderRegister =
@@ -122,15 +122,15 @@ static bool validate(LLVMContext *Ctx, const mcdxbc::RootSignatureDesc &RSD) {
122122

123123
for (const auto &P : RSD.Parameters) {
124124
// Parameter Type cannot be set through metadata.
125-
assert(
126-
dxbc::RootSignatureValidations::isValidParameterType(P.ParameterType));
125+
assert(dxbc::RootSignatureValidations::isValidParameterType(
126+
P.Header.ParameterType));
127127

128128
if (!dxbc::RootSignatureValidations::isValidShaderVisibility(
129-
P.ShaderVisibility)) {
129+
P.Header.ShaderVisibility)) {
130130
return reportError(
131131
Ctx,
132132
"Invalid Root Signature parameter shader visibility in metadata " +
133-
Twine((uint32_t)P.ShaderVisibility));
133+
Twine((uint32_t)P.Header.ShaderVisibility));
134134
}
135135
}
136136
return false;
@@ -250,12 +250,14 @@ PreservedAnalyses RootSignatureAnalysisPrinter::run(Module &M,
250250
OS << indent(Space) << "- Parameters: \n";
251251
Space++;
252252
for (const auto &P : RS.Parameters) {
253-
OS << indent(Space) << "Type: " << (uint32_t)P.ParameterType << " \n";
253+
OS << indent(Space) << "Type: " << (uint32_t)P.Header.ParameterType
254+
<< " \n";
254255
OS << indent(Space)
255-
<< "ShaderVisibility: " << (uint32_t)P.ShaderVisibility << " \n";
256+
<< "ShaderVisibility: " << (uint32_t)P.Header.ShaderVisibility
257+
<< " \n";
256258
Space++;
257259

258-
switch (P.ParameterType) {
260+
switch (P.Header.ParameterType) {
259261

260262
case dxbc::RootParameterType::Constants32Bit: {
261263
OS << indent(Space) << "- Constants: \n";

llvm/test/CodeGen/DirectX/ContainerData/RootSignature-Constants.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
2323
; DXC-NEXT: Flags: 0x000000:
2424
; DXC-NEXT: Version: 2:
2525
; DXC-NEXT: NumParameters: 1:
26-
; DXC-NEXT: RootParametersOffset: 20:
26+
; DXC-NEXT: RootParametersOffset: 24:
2727
; DXC-NEXT: NumStaticSamplers: 0:
28-
; DXC-NEXT: StaticSamplersOffset: 28:
28+
; DXC-NEXT: StaticSamplersOffset: 48:
2929
; DXC-NEXT: - Parameters:
3030
; DXC-NEXT: Type: 1
3131
; DXC-NEXT: ShaderVisibility: 0

0 commit comments

Comments
 (0)