[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Aug 15 07:55:29 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 09b57d9c203322d415c41eeaec6e8842409de620 67a1cc9be3446f61e6b6c3814690cc38f0d53dbd --extensions cpp,h -- llvm/include/llvm/Analysis/DXILResource.h llvm/lib/Target/DirectX/DXILOpLowering.cpp llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
index 76a40dbfc5..171b437c0b 100644
--- a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
+++ b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
@@ -149,7 +149,8 @@ struct FormatResourceDimension
OS << getTextureDimName(RK);
if (Item.isMultiSample())
OS << Item.getMultiSample().Count;
- break;;
+ break;
+ ;
}
case dxil::ResourceKind::RawBuffer:
case dxil::ResourceKind::StructuredBuffer:
@@ -214,11 +215,11 @@ static void prettyPrintResources(raw_ostream &OS, const DXILResourceMap &DRM,
const dxil::Resources &MDResources) {
// Column widths are arbitrary but match the widths DXC uses.
OS << ";\n; Resource Bindings:\n;\n";
- OS << formatv("; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n",
- "Name", "Type", "Format", "Dim", "ID", "HLSL Bind", "Count");
+ OS << formatv("; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n", "Name",
+ "Type", "Format", "Dim", "ID", "HLSL Bind", "Count");
OS << formatv(
- "; {0,-+30} {1,-+10} {2,-+7} {3,-+11} {4,-+7} {5,-+14} {6,-+9}\n", "",
- "", "", "", "", "", "");
+ "; {0,-+30} {1,-+10} {2,-+7} {3,-+11} {4,-+7} {5,-+14} {6,-+9}\n", "", "",
+ "", "", "", "", "");
// TODO: Do we want to sort these by binding or something like that?
for (auto [_, RI] : DRM) {
@@ -235,8 +236,8 @@ static void prettyPrintResources(raw_ostream &OS, const DXILResourceMap &DRM,
FormatBindingID ID(RI);
FormatBindingLocation Bind(RI);
FormatBindingSize Count(RI);
- OS << formatv("; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n",
- Name, Type, Format, Dim, ID, Bind, Count);
+ OS << formatv("; {0,-30} {1,10} {2,7} {3,11} {4,7} {5,14} {6,9}\n", Name,
+ Type, Format, Dim, ID, Bind, Count);
}
if (MDResources.hasCBuffers())
``````````
</details>
https://github.com/llvm/llvm-project/pull/104448
More information about the llvm-branch-commits
mailing list