Skip to content

Commit

Permalink
DirectXTex: some more /analyze cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn_cp authored and walbourn_cp committed Jul 1, 2013
1 parent af675e3 commit bd0b88a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions DirectXTex/BC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,10 @@ void D3DXDecodeBC2(XMVECTOR *pColor, const uint8_t *pBC)
DWORD dw = pBC2->bitmap[0];

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

dw = pBC2->bitmap[1];

Expand Down
4 changes: 4 additions & 0 deletions DirectXTex/BC4BC5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ void D3DXDecodeBC4U( XMVECTOR *pColor, const uint8_t *pBC )

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

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

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

for (size_t i = 0; i < NUM_PIXELS_PER_BLOCK; ++i)
{
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
pColor[i] = XMVectorSet(pBCR->R(i), pBCG->R(i), 0, 1.0f);
}
}
Expand Down
18 changes: 16 additions & 2 deletions DirectXTex/BC6HBC7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,14 @@ void D3DX_BC6H::GeneratePaletteQuantized(const EncodeParams* pEP, const INTEndPn
{
case 3: aWeights = g_aWeights3; assert(uNumIndices <= 8); _Analysis_assume_(uNumIndices <= 8); break;
case 4: aWeights = g_aWeights4; assert(uNumIndices <= 16); _Analysis_assume_(uNumIndices <= 16); break;
default: assert(false); for(size_t i=0; i < uNumIndices; ++i) aPalette[i] = INTColor(0,0,0); return;
default:
assert(false);
for(size_t i = 0; i < uNumIndices; ++i)
{
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
aPalette[i] = INTColor(0,0,0);
}
return;
}

for (size_t i = 0; i < uNumIndices; ++i)
Expand Down Expand Up @@ -1818,7 +1825,14 @@ void D3DX_BC6H::GeneratePaletteUnquantized(const EncodeParams* pEP, size_t uRegi
{
case 3: aWeights = g_aWeights3; assert(uNumIndices <= 8); _Analysis_assume_(uNumIndices <= 8); break;
case 4: aWeights = g_aWeights4; assert(uNumIndices <= 16); _Analysis_assume_(uNumIndices <= 16); break;
default: assert(false); for(size_t i = 0; i < uNumIndices; ++i) aPalette[i] = INTColor(0,0,0); return;
default:
assert(false);
for(size_t i = 0; i < uNumIndices; ++i)
{
#pragma prefast(suppress:22103, "writing blocks in two halves confuses tool")
aPalette[i] = INTColor(0,0,0);
}
return;
}

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

0 comments on commit bd0b88a

Please sign in to comment.