DirectXTex: some more /analyze cleanup

This commit is contained in:
walbourn_cp 2013-07-01 13:30:13 -07:00
parent af675e3c3a
commit bd0b88aa8e
3 changed files with 23 additions and 2 deletions

View File

@ -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];

View File

@ -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);
}
}
@ -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);
}
}
@ -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);
}
}
@ -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);
}
}

View File

@ -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)
@ -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)