diff --git a/DirectXTex/BC.cpp b/DirectXTex/BC.cpp index ab343a6..627ae31 100644 --- a/DirectXTex/BC.cpp +++ b/DirectXTex/BC.cpp @@ -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]; diff --git a/DirectXTex/BC4BC5.cpp b/DirectXTex/BC4BC5.cpp index 30b8461..5df3502 100644 --- a/DirectXTex/BC4BC5.cpp +++ b/DirectXTex/BC4BC5.cpp @@ -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); } } diff --git a/DirectXTex/BC6HBC7.cpp b/DirectXTex/BC6HBC7.cpp index 1ff62ea..3c1e09b 100644 --- a/DirectXTex/BC6HBC7.cpp +++ b/DirectXTex/BC6HBC7.cpp @@ -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)