[llvm-branch-commits] [llvm] [DirectX] Updating DXContainer logic to read version 1.2 of static samplers (PR #160184)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 24 12:41:20 PDT 2025


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 origin/main HEAD --extensions h,cpp -- llvm/include/llvm/Object/DXContainer.h llvm/lib/Object/DXContainer.cpp llvm/lib/ObjectYAML/DXContainerYAML.cpp llvm/unittests/Object/DXContainerTest.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/ObjectYAML/DXContainerYAML.cpp b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
index efa8b40c2..3c09ae4e5 100644
--- a/llvm/lib/ObjectYAML/DXContainerYAML.cpp
+++ b/llvm/lib/ObjectYAML/DXContainerYAML.cpp
@@ -211,8 +211,7 @@ DXContainerYAML::RootSignatureYamlDesc::create(
 
     if (Version > 2) {
 #define STATIC_SAMPLER_FLAG(Num, Enum, Flag)                                   \
-  NewS.Enum =                                                                  \
-      (S.Flags & llvm::to_underlying(dxbc::StaticSamplerFlags::Enum));
+  NewS.Enum = (S.Flags & llvm::to_underlying(dxbc::StaticSamplerFlags::Enum));
 #include "llvm/BinaryFormat/DXContainerConstants.def"
     }
     RootSigDesc.StaticSamplers.push_back(NewS);
diff --git a/llvm/unittests/Object/DXContainerTest.cpp b/llvm/unittests/Object/DXContainerTest.cpp
index 9e805639c..d6f7b26b9 100644
--- a/llvm/unittests/Object/DXContainerTest.cpp
+++ b/llvm/unittests/Object/DXContainerTest.cpp
@@ -1201,8 +1201,8 @@ TEST(RootSignature, ParseStaticSamplers) {
     ASSERT_EQ(Sampler.ShaderVisibility, 7u);
   }
   {
-    // this is testing static sampler parsing for root signature version 1.2, 
-    // it changes: the version number, the size of root signature being emitted 
+    // this is testing static sampler parsing for root signature version 1.2,
+    // it changes: the version number, the size of root signature being emitted
     // and the values for flag fields.
     uint8_t Buffer[] = {
         0x44, 0x58, 0x42, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

``````````

</details>


https://github.com/llvm/llvm-project/pull/160184


More information about the llvm-branch-commits mailing list