summaryrefslogtreecommitdiff
path: root/src/resources/dye/dyepalette_replaceaoglcolor.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-22 17:36:20 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-22 18:18:35 +0300
commit9cf97ab28310a58b195e4daa85a24775df7c9c00 (patch)
tree150b8b7ddb703c3a5d63aec1f186b43c030a1452 /src/resources/dye/dyepalette_replaceaoglcolor.cpp
parent4aada89a99e81574db3e662b9c354cde0cd4440d (diff)
downloadplus-9cf97ab28310a58b195e4daa85a24775df7c9c00.tar.gz
plus-9cf97ab28310a58b195e4daa85a24775df7c9c00.tar.bz2
plus-9cf97ab28310a58b195e4daa85a24775df7c9c00.tar.xz
plus-9cf97ab28310a58b195e4daa85a24775df7c9c00.zip
Use int in A and S dye (OpenGL).
Diffstat (limited to 'src/resources/dye/dyepalette_replaceaoglcolor.cpp')
-rw-r--r--src/resources/dye/dyepalette_replaceaoglcolor.cpp14
1 files changed, 7 insertions, 7 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);
}
}