Skip to content

Commit

Permalink
address Tex
Browse files Browse the repository at this point in the history
  • Loading branch information
bob80905 committed Jan 18, 2025
1 parent efea0a0 commit 9194c53
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/clang/unittests/HLSL/ValidationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,8 @@ TEST_F(ValidationTest, ValidationFailNoHash) {
return;
CComPtr<IDxcBlob> pProgram;

// we need any shader that will pass compilation but fail validation
// We need any shader that will pass compilation but fail validation.
// This shader reads from uninitialized 'float a', which works for now.
LPCSTR pSource = R"(
float main(snorm float b : B) : SV_DEPTH
{
Expand Down Expand Up @@ -1226,11 +1227,11 @@ TEST_F(ValidationTest, ValidationFailNoHash) {
pProgram->GetBufferPointer(), pProgram->GetBufferSize());
VERIFY_IS_NOT_NULL(pHeader);

BYTE Result[DxilContainerHashSize] = {0, 0, 0, 0, 0, 0, 0, 0,
BYTE ZeroHash[DxilContainerHashSize] = {0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
// ComputeHashRetail(DataToHash, AmountToHash, Result);
// Should be unequal, this proves the hash isn't written when validation fails
VERIFY_ARE_EQUAL(memcmp(Result, pHeader->Hash.Digest, sizeof(Result)), 0);

// Should be equal, this proves the hash isn't written when validation fails
VERIFY_ARE_EQUAL(memcmp(ZeroHash, pHeader->Hash.Digest, sizeof(ZeroHash)), 0);
}
TEST_F(ValidationTest, UpdateCounterFail) {
if (m_ver.SkipIRSensitiveTest())
Expand Down

0 comments on commit 9194c53

Please sign in to comment.