Fix build using clang-cl on windows and improve driver detection (#129)

This commit is contained in:
Jun Bo Bi 2022-09-04 17:15:40 -04:00 committed by GitHub
parent 4ed18a65c3
commit a54a3ec74e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 9 deletions

View file

@ -145,7 +145,7 @@ uint32 LatteTexture_CalculateTextureDataHash(LatteTexture* hostTexture)
bool isCompressedFormat = hostTexture->IsCompressedFormat();
if( isCompressedFormat == false )
{
#if BOOST_OS_WINDOWS
#if BOOST_OS_WINDOWS
if (_cpuExtension_AVX2)
{
__m256i h256 = { 0 };
@ -157,7 +157,11 @@ uint32 LatteTexture_CalculateTextureDataHash(LatteTexture* hostTexture)
readPtr += (288 / 32);
h256 = _mm256_xor_si256(h256, temp);
}
#ifdef __clang__
hashVal = h256[0] + h256[1] + h256[2] + h256[3] + h256[4] + h256[5] + h256[6] + h256[7];
#else
hashVal = h256.m256i_u32[0] + h256.m256i_u32[1] + h256.m256i_u32[2] + h256.m256i_u32[3] + h256.m256i_u32[4] + h256.m256i_u32[5] + h256.m256i_u32[6] + h256.m256i_u32[7];
#endif
}
#else
if( false ) {}