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

Issue 1096703002: Reland: Add ETC1 powered SSE encoder for tile texture compression (Closed)

Created:
5 years, 8 months ago by radu.velea
Modified:
5 years, 7 months ago
CC:
cc-bugs_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland: Add ETC1 powered SSE encoder for tile texture compression Created an ETC1 encoder that uses SSE2 to improve compression speed. The SSE encoder extends TextureCompressor and uses the same algorithm as TextureCompressorETC1. Added unittest for TextureCompressorETC1. Moved shared code into a etc1 header. Added new performance test scenarios. Reland necessary for 32-bit GN issues. Performance difference on Ubuntu x64, Haswell Processor: Without SSE: *RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 Low= 1.966321587562561 us *RESULT Compress256x256SolidBlackImage: ETC1 Low= .0956009104847908 us *RESULT Compress256x256SolidColorImage: ETC1 Low= .4367307722568512 us *RESULT Compress256x256RandomColorImage: ETC1 Low= 5.948055744171143 us With SSE: *RESULT Compress256x256BlackAndWhiteGradientImage: ETC1 Low= 1.0316201448440552 us *RESULT Compress256x256SolidBlackImage: ETC1 Low= .25716209411621094 us *RESULT Compress256x256SolidColorImage: ETC1 Low= .2768038809299469 us *RESULT Compress256x256RandomColorImage: ETC1 Low= 1.834145426750183 us BUG=434699 TEST=newly added unittest TextureCompressorETC1Test::Compress256x256CreateETC1, TextureCompressorETC1Test::Compress256x256RatioETC1 Committed: https://crrev.com/5f3849aa8307399b7e6dfe5665ed149594244077 Cr-Commit-Position: refs/heads/master@{#329840} Committed: https://crrev.com/648fb54ee219104d27e2a2de0806408ac0e7c75b Cr-Commit-Position: refs/heads/master@{#329859}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Using similarity 0 #

Patch Set 4 : --no-find-copies #

Total comments: 11

Patch Set 5 : Instantiating new class based on CPU; removing SSE4.1 functions and falling back to SSE2 #

Total comments: 3

Patch Set 6 : Improved performance; added conditional compile; moved redundant code to header. #

Patch Set 7 : Changed some header paths. #

Patch Set 8 : Adding missing header. #

Patch Set 9 : Changed solid block compression to SSE #

Patch Set 10 : Fix after running trybot #

Patch Set 11 : Update gyp and Build.gn #

Total comments: 1

Patch Set 12 : Using ALIGNAS instead of attribute and remove pragma's #

Total comments: 1

Patch Set 13 : Adding unit test for texture compression #

Total comments: 3

Patch Set 14 : #

Patch Set 15 : #

Total comments: 7

Patch Set 16 : Applying feedback #

Total comments: 103

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Total comments: 34

Patch Set 20 : Updated comments, casts and other minor issues. #

Total comments: 8

Patch Set 21 : Sync Build.gn #

Total comments: 10

Patch Set 22 : Fixing comments #

Patch Set 23 : Fix BUILD.gn check #

Patch Set 24 : Reland: Change ia32 to x86 in Build.gn #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1213 lines, -200 lines) Patch
M AUTHORS View 1 chunk +1 line, -0 lines 0 comments Download
M cc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +32 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +37 lines, -0 lines 0 comments Download
M cc/cc_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M cc/resources/texture_compressor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +13 lines, -1 line 0 comments Download
M cc/resources/texture_compressor_etc1.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +175 lines, -0 lines 0 comments Download
M cc/resources/texture_compressor_etc1.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +9 lines, -180 lines 0 comments Download
A cc/resources/texture_compressor_etc1_sse.h View 1 2 3 4 5 1 chunk +31 lines, -0 lines 0 comments Download
A cc/resources/texture_compressor_etc1_sse.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +821 lines, -0 lines 0 comments Download
A cc/resources/texture_compressor_etc1_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +56 lines, -0 lines 0 comments Download
M cc/resources/texture_compressor_perftest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +37 lines, -19 lines 2 comments Download

Messages

Total messages: 53 (17 generated)
adrian.belgun
Added quick review. https://codereview.chromium.org/1096703002/diff/60001/cc/resources/texture_compressor_etc1_sse.cc File cc/resources/texture_compressor_etc1_sse.cc (right): https://codereview.chromium.org/1096703002/diff/60001/cc/resources/texture_compressor_etc1_sse.cc#newcode103 cc/resources/texture_compressor_etc1_sse.cc:103: /* 0, 1, 2 - for ...
5 years, 8 months ago (2015-04-17 14:02:58 UTC) #3
robert.bradford
Good first start! General comments: Try and reduce copy and pasting from the texture_compressor.c. Could ...
5 years, 8 months ago (2015-04-17 14:04:47 UTC) #5
radu.velea
Done https://codereview.chromium.org/1096703002/diff/60001/cc/cc.gyp File cc/cc.gyp (right): https://codereview.chromium.org/1096703002/diff/60001/cc/cc.gyp#newcode491 cc/cc.gyp:491: 'resources/texture_compressor_etc1_sse.h', On 2015/04/17 14:04:47, robert.bradford wrote: > You ...
5 years, 8 months ago (2015-04-17 16:02:32 UTC) #6
robert.bradford
https://codereview.chromium.org/1096703002/diff/80001/cc/resources/texture_compressor_etc1_sse.h File cc/resources/texture_compressor_etc1_sse.h (right): https://codereview.chromium.org/1096703002/diff/80001/cc/resources/texture_compressor_etc1_sse.h#newcode12 cc/resources/texture_compressor_etc1_sse.h:12: class CC_EXPORT TextureCompressorETC1_SSE : public TextureCompressor { This class ...
5 years, 8 months ago (2015-04-17 16:14:25 UTC) #7
robert.bradford
https://codereview.chromium.org/1096703002/diff/80001/cc/cc.gyp File cc/cc.gyp (right): https://codereview.chromium.org/1096703002/diff/80001/cc/cc.gyp#newcode490 cc/cc.gyp:490: 'resources/texture_compressor_etc1_sse.cc', These files need to be conditional on the ...
5 years, 8 months ago (2015-04-17 16:20:08 UTC) #8
robert.bradford
https://codereview.chromium.org/1096703002/diff/200001/cc/resources/texture_compressor.h File cc/resources/texture_compressor.h (right): https://codereview.chromium.org/1096703002/diff/200001/cc/resources/texture_compressor.h#newcode42 cc/resources/texture_compressor.h:42: static base::CPU cpu; static initialiser here (of non-POD type) ...
5 years, 7 months ago (2015-04-28 12:23:19 UTC) #11
robert.bradford
https://codereview.chromium.org/1096703002/diff/220001/cc/resources/texture_compressor_etc1_sse.cc File cc/resources/texture_compressor_etc1_sse.cc (right): https://codereview.chromium.org/1096703002/diff/220001/cc/resources/texture_compressor_etc1_sse.cc#newcode212 cc/resources/texture_compressor_etc1_sse.cc:212: __m128i threashhold_upper = _mm_set1_epi32(3); nit: spelling s/threashold/threshold/g
5 years, 7 months ago (2015-04-28 15:47:05 UTC) #12
christiank
Just tried it, and it works great. It seems to produce slightly better results than ...
5 years, 7 months ago (2015-04-29 12:25:46 UTC) #13
radu.velea
On 2015/04/29 12:25:46, christiank wrote: > Just tried it, and it works great. It seems ...
5 years, 7 months ago (2015-04-29 14:06:39 UTC) #14
christiank
On 2015/04/29 14:06:39, radu.velea wrote: > On 2015/04/29 12:25:46, christiank wrote: > > Just tried ...
5 years, 7 months ago (2015-04-30 13:53:37 UTC) #15
radu.velea
I applied your feedback. @christiank I left you a comment some time ago regarding ETC1: ...
5 years, 7 months ago (2015-05-04 08:42:14 UTC) #16
radu.velea
Hi David, please could you take a look at this change?
5 years, 7 months ago (2015-05-05 12:13:16 UTC) #18
reveman
Please include the difference in perf test results in the description of this patch https://codereview.chromium.org/1096703002/diff/280001/cc/resources/texture_compressor.cc ...
5 years, 7 months ago (2015-05-05 15:30:11 UTC) #20
radu.velea
On 2015/05/05 15:30:11, reveman wrote: > Please include the difference in perf test results in ...
5 years, 7 months ago (2015-05-06 11:56:12 UTC) #21
reveman
https://codereview.chromium.org/1096703002/diff/300001/cc/cc.gyp File cc/cc.gyp (right): https://codereview.chromium.org/1096703002/diff/300001/cc/cc.gyp#newcode635 cc/cc.gyp:635: 'target_name': 'cc_opts', hm, do we really need a separate ...
5 years, 7 months ago (2015-05-06 18:44:03 UTC) #22
radu.velea
I think I've added all or most of your feedback. Let me know if you ...
5 years, 7 months ago (2015-05-07 11:21:41 UTC) #23
reveman
lgtm with nits and % christiank's review https://codereview.chromium.org/1096703002/diff/360001/cc/resources/texture_compressor.cc File cc/resources/texture_compressor.cc (right): https://codereview.chromium.org/1096703002/diff/360001/cc/resources/texture_compressor.cc#newcode8 cc/resources/texture_compressor.cc:8: #include "base/cpu.h" ...
5 years, 7 months ago (2015-05-07 14:24:36 UTC) #24
radu.velea
I think I fixed everything. https://codereview.chromium.org/1096703002/diff/360001/cc/resources/texture_compressor.cc File cc/resources/texture_compressor.cc (right): https://codereview.chromium.org/1096703002/diff/360001/cc/resources/texture_compressor.cc#newcode8 cc/resources/texture_compressor.cc:8: #include "base/cpu.h" On 2015/05/07 ...
5 years, 7 months ago (2015-05-07 15:53:46 UTC) #25
reveman
lgtm still. just a few build related nits that I missed in my last review ...
5 years, 7 months ago (2015-05-07 16:26:29 UTC) #26
radu.velea
Sync-ed Build.gn, replaced ifdefs, removed unused headers. https://codereview.chromium.org/1096703002/diff/380001/cc/BUILD.gn File cc/BUILD.gn (right): https://codereview.chromium.org/1096703002/diff/380001/cc/BUILD.gn#newcode554 cc/BUILD.gn:554: if (target_cpu ...
5 years, 7 months ago (2015-05-08 10:52:11 UTC) #27
christiank
lgtm with nits. Noticed a small error in documentation, otherwise it looks good. https://codereview.chromium.org/1096703002/diff/400001/cc/resources/texture_compressor_etc1.h File ...
5 years, 7 months ago (2015-05-11 13:56:17 UTC) #28
robert.bradford
Some minor nits for you to fix when integrating christiank's feedback. https://codereview.chromium.org/1096703002/diff/400001/cc/resources/texture_compressor_etc1.h File cc/resources/texture_compressor_etc1.h (right): ...
5 years, 7 months ago (2015-05-11 14:18:03 UTC) #29
radu.velea
Fixed comments. https://codereview.chromium.org/1096703002/diff/400001/cc/resources/texture_compressor_etc1.h File cc/resources/texture_compressor_etc1.h (right): https://codereview.chromium.org/1096703002/diff/400001/cc/resources/texture_compressor_etc1.h#newcode61 cc/resources/texture_compressor_etc1.h:61: // [ 0][ 1][ 2][ 3] [ ...
5 years, 7 months ago (2015-05-11 15:19:11 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1096703002/420001
5 years, 7 months ago (2015-05-14 11:00:47 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/37608)
5 years, 7 months ago (2015-05-14 11:32:29 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1096703002/440001
5 years, 7 months ago (2015-05-14 12:10:55 UTC) #38
commit-bot: I haz the power
Committed patchset #23 (id:440001)
5 years, 7 months ago (2015-05-14 13:24:24 UTC) #39
commit-bot: I haz the power
Patchset 23 (id:??) landed as https://crrev.com/5f3849aa8307399b7e6dfe5665ed149594244077 Cr-Commit-Position: refs/heads/master@{#329840}
5 years, 7 months ago (2015-05-14 13:25:21 UTC) #40
sergeyv
A revert of this CL (patchset #23 id:440001) has been created in https://codereview.chromium.org/1136083003/ by sergeyv@chromium.org. ...
5 years, 7 months ago (2015-05-14 14:15:28 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1096703002/460001
5 years, 7 months ago (2015-05-14 16:13:38 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1096703002/460001
5 years, 7 months ago (2015-05-14 16:43:10 UTC) #47
commit-bot: I haz the power
Committed patchset #24 (id:460001)
5 years, 7 months ago (2015-05-14 16:51:39 UTC) #48
commit-bot: I haz the power
Patchset 24 (id:??) landed as https://crrev.com/648fb54ee219104d27e2a2de0806408ac0e7c75b Cr-Commit-Position: refs/heads/master@{#329859}
5 years, 7 months ago (2015-05-14 16:52:16 UTC) #49
Lei Zhang
https://codereview.chromium.org/1096703002/diff/460001/cc/resources/texture_compressor_perftest.cc File cc/resources/texture_compressor_perftest.cc (right): https://codereview.chromium.org/1096703002/diff/460001/cc/resources/texture_compressor_perftest.cc#newcode105 cc/resources/texture_compressor_perftest.cc:105: srand(kImageSeed); Why not just use the appropriate functions from ...
5 years, 7 months ago (2015-05-25 22:31:58 UTC) #51
reveman
https://codereview.chromium.org/1096703002/diff/460001/cc/resources/texture_compressor_perftest.cc File cc/resources/texture_compressor_perftest.cc (right): https://codereview.chromium.org/1096703002/diff/460001/cc/resources/texture_compressor_perftest.cc#newcode105 cc/resources/texture_compressor_perftest.cc:105: srand(kImageSeed); On 2015/05/25 22:31:58, Lei Zhang wrote: > Why ...
5 years, 7 months ago (2015-05-26 15:50:22 UTC) #52
Lei Zhang
5 years, 7 months ago (2015-05-26 18:27:24 UTC) #53
Message was sent while issue was closed.
On 2015/05/26 15:50:22, reveman wrote:
>
https://codereview.chromium.org/1096703002/diff/460001/cc/resources/texture_c...
> File cc/resources/texture_compressor_perftest.cc (right):
> 
>
https://codereview.chromium.org/1096703002/diff/460001/cc/resources/texture_c...
> cc/resources/texture_compressor_perftest.cc:105: srand(kImageSeed);
> On 2015/05/25 22:31:58, Lei Zhang wrote:
> > Why not just use the appropriate functions from base/rand_util.h?
> 
> I think we want pseudo random numbers here as real random numbers could cause
> unexpected differences between each run of this perf test. base/rand_util.h
> doesn't seem to provide this but maybe I'm missing something?

Got it. Thanks.

Powered by Google App Engine
This is Rietveld 408576698