================
@@ -162,20 +164,50 @@ DXContainerYAML::RootSignatureYamlDesc::create(
}
for (const auto &S : Data.samplers()) {
+ if (!dxbc::isValidSamplerFilter(S.Filter))
+ return createStringError(std::errc::invalid_argument,
+ "Invalid value for static sampler filter");
+
+ if (!dxbc::isValidAddress(S.AddressU))
+ return createStringError(std::errc::invalid_argument,
+ "Invalid value for static sampler AddressU");
+
+ if (!dxbc::isValidAddress(S.AddressV))
+ return createStringError(std::errc::invalid_argument,
+ "Invalid value for static sampler AddressV");
+
+ if (!dxbc::isValidAddress(S.AddressW))
+ return createStringError(std::errc::invalid_argument,
+ "Invalid value for static sampler AddressW");
+
+ if (!dxbc::isValidComparisonFunc(S.ComparisonFunc))
+ return createStringError(
+ std::errc::invalid_argument,
+ "Invalid value for static sampler ComparisonFunc");
+
+ if (!dxbc::isValidBorderColor(S.BorderColor))
+ return createStringError(std::errc::invalid_argument,
+ "Invalid value for static sampler BorderColor");
+
+ if (!dxbc::isValidShaderVisibility(S.ShaderVisibility))
+ return createStringError(
+ std::errc::invalid_argument,
+ "Invalid value for static sampler ShaderVisibility");
+
StaticSamplerYamlDesc NewS;
- NewS.Filter = S.Filter;
- NewS.AddressU = S.AddressU;
- NewS.AddressV = S.AddressV;
- NewS.AddressW = S.AddressW;
+ NewS.Filter = dxbc::SamplerFilter(S.Filter);
----------------
joaosaffran wrote:
Those castings are required here. They are coming from the binary
representation, so they are actually `uint32_t`, the casting are moving the
data into the internal representations, which use the enums.
https://github.com/llvm/llvm-project/pull/154827
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits