Skip to content

Commit bd0b88a

Browse files
walbourn_cpwalbourn_cp
walbourn_cp
authored and
walbourn_cp
committed
DirectXTex: some more /analyze cleanup
1 parent af675e3 commit bd0b88a

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

DirectXTex/BC.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,10 @@ void D3DXDecodeBC2(XMVECTOR *pColor, const uint8_t *pBC)
807807
DWORD dw = pBC2->bitmap[0];
808808

809809
for(size_t i = 0; i < 8; ++i, dw >>= 4)
810+
{
811+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
810812
pColor[i] = XMVectorSetW( pColor[i], (float) (dw & 0xf) * (1.0f / 15.0f) );
813+
}
811814

812815
dw = pBC2->bitmap[1];
813816

DirectXTex/BC4BC5.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ void D3DXDecodeBC4U( XMVECTOR *pColor, const uint8_t *pBC )
379379

380380
for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
381381
{
382+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
382383
pColor[i] = XMVectorSet( pBC4->R(i), 0, 0, 1.0f);
383384
}
384385
}
@@ -393,6 +394,7 @@ void D3DXDecodeBC4S(XMVECTOR *pColor, const uint8_t *pBC)
393394

394395
for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
395396
{
397+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
396398
pColor[i] = XMVectorSet( pBC4->R(i), 0, 0, 1.0f);
397399
}
398400
}
@@ -454,6 +456,7 @@ void D3DXDecodeBC5U(XMVECTOR *pColor, const uint8_t *pBC)
454456

455457
for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
456458
{
459+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
457460
pColor[i] = XMVectorSet(pBCR->R(i), pBCG->R(i), 0, 1.0f);
458461
}
459462
}
@@ -469,6 +472,7 @@ void D3DXDecodeBC5S(XMVECTOR *pColor, const uint8_t *pBC)
469472

470473
for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
471474
{
475+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
472476
pColor[i] = XMVectorSet(pBCR->R(i), pBCG->R(i), 0, 1.0f);
473477
}
474478
}

DirectXTex/BC6HBC7.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,14 @@ void D3DX_BC6H::GeneratePaletteQuantized(const EncodeParams* pEP, const INTEndPn
14381438
{
14391439
case 3: aWeights = g_aWeights3; assert(uNumIndices <= 8); _Analysis_assume_(uNumIndices <= 8); break;
14401440
case 4: aWeights = g_aWeights4; assert(uNumIndices <= 16); _Analysis_assume_(uNumIndices <= 16); break;
1441-
default: assert(false); for(size_t i=0; i < uNumIndices; ++i) aPalette[i] = INTColor(0,0,0); return;
1441+
default:
1442+
assert(false);
1443+
for(size_t i = 0; i < uNumIndices; ++i)
1444+
{
1445+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
1446+
aPalette[i] = INTColor(0,0,0);
1447+
}
1448+
return;
14421449
}
14431450

14441451
for (size_t i = 0; i < uNumIndices; ++i)
@@ -1818,7 +1825,14 @@ void D3DX_BC6H::GeneratePaletteUnquantized(const EncodeParams* pEP, size_t uRegi
18181825
{
18191826
case 3: aWeights = g_aWeights3; assert(uNumIndices <= 8); _Analysis_assume_(uNumIndices <= 8); break;
18201827
case 4: aWeights = g_aWeights4; assert(uNumIndices <= 16); _Analysis_assume_(uNumIndices <= 16); break;
1821-
default: assert(false); for(size_t i = 0; i < uNumIndices; ++i) aPalette[i] = INTColor(0,0,0); return;
1828+
default:
1829+
assert(false);
1830+
for(size_t i = 0; i < uNumIndices; ++i)
1831+
{
1832+
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
1833+
aPalette[i] = INTColor(0,0,0);
1834+
}
1835+
return;
18221836
}
18231837

18241838
for(register size_t i = 0; i < uNumIndices; ++i)

0 commit comments

Comments
 (0)