Skip to content

Commit 9d756b0

Browse files
committed
Resolve some default error warnings (microsoft#7191)
DxilContainerValidation.cpp has some int / bool comparisons that cause default error warnings in some of the private builds. This needs to be addressed. This PR changes the comparisons by converting the numerical expressions into the appropriate boolean, then comparing the booleans.
1 parent 7da2a2c commit 9d756b0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/DxilValidation/DxilContainerValidation.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,12 @@ void PSVContentVerifier::VerifySignatureElement(
337337

338338
PSVSignatureElement PSVSE(StrTab, IndexTab, PSVSE0);
339339
if (SE.IsArbitrary())
340-
Mismatch |= strcmp(PSVSE.GetSemanticName(), SE.GetName());
340+
Mismatch |=
341+
strcmp(PSVSE.GetSemanticName(), SE.GetName()) == 0 ? false : true;
341342
else
342-
Mismatch |= PSVSE0->SemanticKind != static_cast<uint8_t>(SE.GetKind());
343+
Mismatch |= PSVSE0->SemanticKind != static_cast<uint8_t>(SE.GetKind()) == 0
344+
? false
345+
: true;
343346

344347
ModulePSVSE0.SemanticName = PSVSE0->SemanticName;
345348
// Compare all fields.
@@ -494,7 +497,8 @@ void PSVContentVerifier::Verify(unsigned ValMajor, unsigned ValMinor,
494497
std::to_string(ShaderStage));
495498
return;
496499
}
497-
if (PSV1->UsesViewID != DM.m_ShaderFlags.GetViewID())
500+
bool ViewIDUsed = PSV1->UsesViewID == 0 ? false : true;
501+
if (ViewIDUsed != DM.m_ShaderFlags.GetViewID())
498502
EmitMismatchError("UsesViewID", std::to_string(PSV1->UsesViewID),
499503
std::to_string(DM.m_ShaderFlags.GetViewID()));
500504

0 commit comments

Comments
 (0)