Optimize copying image data for presentation
A highly generic Blitter::blitToBuffer() method was used for copying
pixels without requiring any format conversion or scaling.
This change removes Blitter::blitToBuffer() and the unused
blitFromBuffer() methods and implements a copyTo() method which does
straightforward memcpy() of the data.
Also consistently add 'To' and 'From' to the Image class's copy, blit,
and resolve methods to avoid any confusion about which direction the
transfer happens.
Benchmark results:
Run on (48 X 2594 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x24)
L1 Instruction 32 KiB (x24)
L2 Unified 256 KiB (x24)
L3 Unified 30720 KiB (x2)
---------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------
(LLVM, before)
Triangle/Hello 8.69 ms 7.39 ms 112
(LLVM, after)
Triangle/Hello 0.878 ms 0.454 ms 2133
(Subzero, before)
Triangle/Hello 26.2 ms 24.8 ms 41
(Subzero, after)
Triangle/Hello 1.11 ms 0.432 ms 1339
Bug: b/147967959
Change-Id: I76a103bbb6e582f987ef1c3cc39d17779ae4ac99
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/45650
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
Reviewed-by:
Alexis Hétu <sugoi@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Showing
Please
register
or
sign in
to comment