Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: src/opts/SkTextureCompressor_opts.h

Issue 2264103002: compress_r11eac_blocks() required more alignment than dst has. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Turn test back on. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/bots/recipes/swarm_test.expected/Test-Android-GCC-Nexus6-GPU-Adreno420-Arm7-Debug.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkTextureCompressor_opts.h
diff --git a/src/opts/SkTextureCompressor_opts.h b/src/opts/SkTextureCompressor_opts.h
index 4fd123cef5ed2f7146642eb58011ce89c78c3f90..06ced38bdf0c6a63144bff2ddf1952bbc6051dac 100644
--- a/src/opts/SkTextureCompressor_opts.h
+++ b/src/opts/SkTextureCompressor_opts.h
@@ -150,14 +150,14 @@ namespace SK_OPTS_NS {
}
#endif
- static void compress_r11eac_blocks(uint64_t* dst, const uint8_t* src, size_t rowBytes) {
+ static void compress_r11eac_blocks(uint8_t* dst, const uint8_t* src, size_t rowBytes) {
// Try to avoid switching between vector and non-vector ops...
const uint8_t *const src1 = src;
const uint8_t *const src2 = src + rowBytes;
const uint8_t *const src3 = src + 2*rowBytes;
const uint8_t *const src4 = src + 3*rowBytes;
- uint64_t *const dst1 = dst;
- uint64_t *const dst2 = dst + 2;
+ uint8_t *const dst1 = dst;
+ uint8_t *const dst2 = dst + 16;
const uint8x16_t alphaRow1 = vld1q_u8(src1);
const uint8x16_t alphaRow2 = vld1q_u8(src2);
@@ -175,12 +175,12 @@ namespace SK_OPTS_NS {
if (is_zero(alphaRow1)) {
static const uint64x2_t kTransparent = { 0x0020000000002000ULL,
0x0020000000002000ULL };
- vst1q_u64(dst1, kTransparent);
- vst1q_u64(dst2, kTransparent);
+ vst1q_u8(dst1, vreinterpretq_u8_u64(kTransparent));
+ vst1q_u8(dst2, vreinterpretq_u8_u64(kTransparent));
return;
} else if (is_zero(nAlphaRow1)) {
- vst1q_u64(dst1, vreinterpretq_u64_u8(cmp));
- vst1q_u64(dst2, vreinterpretq_u64_u8(cmp));
+ vst1q_u8(dst1, cmp);
+ vst1q_u8(dst2, cmp);
return;
}
}
@@ -205,8 +205,8 @@ namespace SK_OPTS_NS {
const uint64x2_t d1 = vcombine_u64(vget_low_u64(indicesLeft), vget_low_u64(indicesRight));
const uint64x2_t d2 = vcombine_u64(vget_high_u64(indicesLeft), vget_high_u64(indicesRight));
- vst1q_u64(dst1, d1);
- vst1q_u64(dst2, d2);
+ vst1q_u8(dst1, vreinterpretq_u8_u64(d1));
+ vst1q_u8(dst2, vreinterpretq_u8_u64(d2));
}
static bool compress_a8_r11eac(uint8_t* dst, const uint8_t* src,
@@ -224,12 +224,11 @@ namespace SK_OPTS_NS {
SkASSERT((blocksX % 4) == 0);
- uint64_t* encPtr = reinterpret_cast<uint64_t*>(dst);
for (int y = 0; y < blocksY; ++y) {
for (int x = 0; x < blocksX; x+=4) {
// Compress it
- compress_r11eac_blocks(encPtr, src + 4*x, rowBytes);
- encPtr += 4;
+ compress_r11eac_blocks(dst, src + 4*x, rowBytes);
+ dst += 32;
}
src += 4 * rowBytes;
}
« no previous file with comments | « infra/bots/recipes/swarm_test.expected/Test-Android-GCC-Nexus6-GPU-Adreno420-Arm7-Debug.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698