[llvm-branch-commits] [clang] [llvm] [HLSL][RootSiganture] Add parsing of new number params in StaticSampler (PR #140291)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 26 10:42:28 PDT 2025


================
@@ -241,13 +245,27 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseStaticSamplerTest) {
 
   ASSERT_FALSE(Parser.parse());
 
-  ASSERT_EQ(Elements.size(), 1u);
+  ASSERT_EQ(Elements.size(), 2u);
 
+  // Check default values are as expected
   RootElement Elem = Elements[0];
   ASSERT_TRUE(std::holds_alternative<StaticSampler>(Elem));
   ASSERT_EQ(std::get<StaticSampler>(Elem).Reg.ViewType, RegisterType::SReg);
   ASSERT_EQ(std::get<StaticSampler>(Elem).Reg.Number, 0u);
   ASSERT_EQ(std::get<StaticSampler>(Elem).MipLODBias, 0.f);
+  ASSERT_EQ(std::get<StaticSampler>(Elem).MaxAnisotropy, 16u);
+  ASSERT_EQ(std::get<StaticSampler>(Elem).MinLOD, 0.f);
----------------
joaosaffran wrote:

```suggestion
  EXPECT_FLOAT_EQ(std::get<StaticSampler>(Elem).MinLOD, 0.f);
```

Google tests has a special set of assert for floating point numbers: https://google.github.io/googletest/reference/assertions.html#floating-point

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


More information about the llvm-branch-commits mailing list