diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-12-22 17:36:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-12-22 18:18:35 +0300 |
commit | 9cf97ab28310a58b195e4daa85a24775df7c9c00 (patch) | |
tree | 150b8b7ddb703c3a5d63aec1f186b43c030a1452 /src/resources/dye | |
parent | 4aada89a99e81574db3e662b9c354cde0cd4440d (diff) | |
download | manaverse-9cf97ab28310a58b195e4daa85a24775df7c9c00.tar.gz manaverse-9cf97ab28310a58b195e4daa85a24775df7c9c00.tar.bz2 manaverse-9cf97ab28310a58b195e4daa85a24775df7c9c00.tar.xz manaverse-9cf97ab28310a58b195e4daa85a24775df7c9c00.zip |
Use int in A and S dye (OpenGL).
Diffstat (limited to 'src/resources/dye')
-rw-r--r-- | src/resources/dye/dyepalette_replaceaoglcolor.cpp | 14 | ||||
-rw-r--r-- | src/resources/dye/dyepalette_replacesoglcolor.cpp | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/resources/dye/dyepalette_replaceaoglcolor.cpp b/src/resources/dye/dyepalette_replaceaoglcolor.cpp index 3b643bf92..17e9adf36 100644 --- a/src/resources/dye/dyepalette_replaceaoglcolor.cpp +++ b/src/resources/dye/dyepalette_replaceaoglcolor.cpp @@ -163,12 +163,12 @@ void DyePalette::replaceAOGLColorSimd(uint32_t *restrict pixels, if (sz % 2) -- it_end; - for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize); - pixels != p_end; - ++pixels) + for (int ptr = 0; ptr < bufSize; ptr += 8) { -// __m256i base = _mm256_load_si256(reinterpret_cast<__m256i*>(pixels)); - __m256i base = _mm256_loadu_si256(reinterpret_cast<__m256i*>(pixels)); +// __m256i base = _mm256_load_si256(reinterpret_cast<__m256i*>( +// &pixels[ptr])); + __m256i base = _mm256_loadu_si256(reinterpret_cast<__m256i*>( + &pixels[ptr])); std::vector<DyeColor>::const_iterator it = mColors.begin(); while (it != it_end) @@ -186,8 +186,8 @@ void DyePalette::replaceAOGLColorSimd(uint32_t *restrict pixels, ++ it; } -// _mm256_store_si256(reinterpret_cast<__m256i*>(pixels), base); - _mm256_storeu_si256(reinterpret_cast<__m256i*>(pixels), base); +// _mm256_store_si256(reinterpret_cast<__m256i*>(&pixels[ptr]), base); + _mm256_storeu_si256(reinterpret_cast<__m256i*>(&pixels[ptr]), base); } } diff --git a/src/resources/dye/dyepalette_replacesoglcolor.cpp b/src/resources/dye/dyepalette_replacesoglcolor.cpp index 6425a3fe2..40b6fb8af 100644 --- a/src/resources/dye/dyepalette_replacesoglcolor.cpp +++ b/src/resources/dye/dyepalette_replacesoglcolor.cpp @@ -159,13 +159,13 @@ void DyePalette::replaceSOGLColorSimd(uint32_t *restrict pixels, if (sz % 2) -- it_end; - for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize); - pixels != p_end; - pixels += 8) + for (int ptr = 0; ptr < bufSize; ptr += 8) { __m256i mask = _mm256_set1_epi32(0x00ffffff); -// __m256i base = _mm256_load_si256(reinterpret_cast<__m256i*>(pixels)); - __m256i base = _mm256_loadu_si256(reinterpret_cast<__m256i*>(pixels)); +// __m256i base = _mm256_load_si256(reinterpret_cast<__m256i*>( +// &pixels[ptr])); + __m256i base = _mm256_loadu_si256(reinterpret_cast<__m256i*>( + &pixels[ptr])); std::vector<DyeColor>::const_iterator it = mColors.begin(); while (it != it_end) @@ -184,8 +184,8 @@ void DyePalette::replaceSOGLColorSimd(uint32_t *restrict pixels, base = _mm256_or_si256(srcAnd, dstAnd); ++ it; } -// _mm256_store_si256(reinterpret_cast<__m256i*>(pixels), base); - _mm256_storeu_si256(reinterpret_cast<__m256i*>(pixels), base); +// _mm256_store_si256(reinterpret_cast<__m256i*>(&pixels[ptr]), base); + _mm256_storeu_si256(reinterpret_cast<__m256i*>(&pixels[ptr]), base); } } |