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

Issue 1888473002: Use transfer buffer for BatchAtlas texture copies

Created:
4 years, 8 months ago by jvanverth1
Modified:
4 years, 2 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Use transfer buffer for BatchAtlas texture copies. Sets up use of transfer buffer (if available) to do one-copy transfers. Get transfer buffers working properly in GL. Implement GrVkGpu::onTransferPixels. Check caps to ensure we can create a transfer buffer. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1888473002 Committed: https://skia.googlesource.com/skia/+/b0ec9836dbf7f2304a3a29289b818719ca0a39bd

Patch Set 1 #

Patch Set 2 : Got transfer buffers working in GL #

Patch Set 3 : Fixes for Vulkan #

Patch Set 4 : Some cleanup #

Patch Set 5 : Fix Chrome #

Total comments: 15

Patch Set 6 : Address comments #

Patch Set 7 : Fix line endings #

Patch Set 8 : Update #

Patch Set 9 : Rebase to ToT #

Patch Set 10 : Rebase to ToT #

Patch Set 11 : Add fence support #

Patch Set 12 : Rebase to ToT #

Patch Set 13 : Rebase to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+347 lines, -56 lines) Patch
M include/gpu/GrCaps.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M include/gpu/GrTypesPriv.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M include/gpu/gl/GrGLFunctions.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M include/gpu/gl/GrGLInterface.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M include/gpu/gl/GrGLTypes.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/GrBatchAtlas.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +13 lines, -5 lines 0 comments Download
M src/gpu/GrBatchAtlas.cpp View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +55 lines, -23 lines 0 comments Download
M src/gpu/GrBatchFlushState.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -1 line 0 comments Download
M src/gpu/GrCaps.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M src/gpu/GrGpu.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +10 lines, -6 lines 0 comments Download
M src/gpu/GrGpu.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -4 lines 0 comments Download
M src/gpu/GrResourceProvider.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M src/gpu/batches/GrDrawBatch.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGLAssembleInterface.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +13 lines, -1 line 0 comments Download
M src/gpu/gl/GrGLBuffer.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLCaps.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +12 lines, -2 lines 0 comments Download
M src/gpu/gl/GrGLDefines.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLGpu.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -1 line 0 comments Download
M src/gpu/gl/GrGLGpu.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +29 lines, -4 lines 0 comments Download
M src/gpu/gl/GrGLInterface.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +18 lines, -0 lines 0 comments Download
M src/gpu/vk/GrVkCaps.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/vk/GrVkGpu.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -2 lines 0 comments Download
M src/gpu/vk/GrVkGpu.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +113 lines, -2 lines 0 comments Download
M tools/gpu/GrTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 31 (14 generated)
jvanverth1
This appears to work well even without a fence -- I've tested it on Mac, ...
4 years, 8 months ago (2016-04-15 19:46:15 UTC) #7
egdaniel
In general, I wonder if, at least in vulkan world, we can share a lot ...
4 years, 8 months ago (2016-04-18 16:46:35 UTC) #8
bsalomon
lgtm modulo Greg's vk comments. Any win from this? https://codereview.chromium.org/1888473002/diff/80001/src/gpu/GrBatchAtlas.cpp File src/gpu/GrBatchAtlas.cpp (right): https://codereview.chromium.org/1888473002/diff/80001/src/gpu/GrBatchAtlas.cpp#newcode44 src/gpu/GrBatchAtlas.cpp:44: ...
4 years, 8 months ago (2016-04-19 14:48:36 UTC) #9
jvanverth1
Addressing comments: https://codereview.chromium.org/1888473002/diff/80001/src/gpu/GrBatchAtlas.cpp File src/gpu/GrBatchAtlas.cpp (right): https://codereview.chromium.org/1888473002/diff/80001/src/gpu/GrBatchAtlas.cpp#newcode44 src/gpu/GrBatchAtlas.cpp:44: fTransferBuffer->unref(); On 2016/04/19 14:48:36, bsalomon wrote: > ...
4 years, 8 months ago (2016-04-19 17:14:27 UTC) #10
egdaniel
https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp File src/gpu/vk/GrVkGpu.cpp (right): https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp#newcode285 src/gpu/vk/GrVkGpu.cpp:285: if (!vkTex) { On 2016/04/19 17:14:27, jvanverth1 wrote: > ...
4 years, 8 months ago (2016-04-19 17:22:18 UTC) #11
jvanverth1
On 2016/04/19 17:22:18, egdaniel wrote: > https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp > File src/gpu/vk/GrVkGpu.cpp (right): > > https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp#newcode285 > ...
4 years, 8 months ago (2016-04-19 18:12:07 UTC) #12
bsalomon
https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp File src/gpu/vk/GrVkGpu.cpp (right): https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp#newcode285 src/gpu/vk/GrVkGpu.cpp:285: if (!vkTex) { On 2016/04/19 17:22:18, egdaniel wrote: > ...
4 years, 8 months ago (2016-04-19 18:19:26 UTC) #13
jvanverth1
On 2016/04/19 18:19:26, bsalomon wrote: > https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp > File src/gpu/vk/GrVkGpu.cpp (right): > > https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp#newcode285 > ...
4 years, 8 months ago (2016-04-19 18:26:07 UTC) #14
bsalomon
On 2016/04/19 18:26:07, jvanverth1 wrote: > On 2016/04/19 18:19:26, bsalomon wrote: > > https://codereview.chromium.org/1888473002/diff/80001/src/gpu/vk/GrVkGpu.cpp > ...
4 years, 8 months ago (2016-04-19 18:30:25 UTC) #15
jvanverth1
On 2016/04/19 18:30:25, bsalomon wrote: > On 2016/04/19 18:26:07, jvanverth1 wrote: > > On 2016/04/19 ...
4 years, 8 months ago (2016-04-19 18:51:20 UTC) #16
egdaniel
lgtm
4 years, 8 months ago (2016-04-19 18:54:36 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1888473002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1888473002/160001
4 years, 8 months ago (2016-04-20 12:43:45 UTC) #20
commit-bot: I haz the power
Committed patchset #9 (id:160001) as https://skia.googlesource.com/skia/+/b0ec9836dbf7f2304a3a29289b818719ca0a39bd
4 years, 8 months ago (2016-04-20 12:54:05 UTC) #22
jvanverth1
A revert of this CL (patchset #9 id:160001) has been created in https://codereview.chromium.org/1904723003/ by jvanverth@google.com. ...
4 years, 8 months ago (2016-04-20 17:33:14 UTC) #23
jvanverth1
So I did a little more work on this, trying to add fence support in. ...
4 years, 5 months ago (2016-07-12 17:54:02 UTC) #25
bsalomon
On 2016/07/12 17:54:02, jvanverth1 wrote: > So I did a little more work on this, ...
4 years, 5 months ago (2016-07-12 18:14:43 UTC) #28
jvanverth1
4 years, 5 months ago (2016-07-12 18:17:47 UTC) #29
On 2016/07/12 18:14:43, bsalomon wrote:
> On 2016/07/12 17:54:02, jvanverth1 wrote:
> > So I did a little more work on this, trying to add fence support in. I have
a
> > first pass where I can create a fence for a transfer and associate it with a
> > GrBatchAtlas::Plot, but I have no idea where to wait on it. There doesn't
seem
> > to be any way for a batch to trace back to its pre-uploads (the non-inline
> > ones). And in any case, the actual draw is handled by the VertexBatch
> > superclass. Any suggestions on how to hook this in?
> 
> Perhaps we need to hand something back to the batch when it adds an upload
that
> can then be passed to GrVertexBatch::Target::draw() that indicates that the
draw
> requires the upload to be complete.
> 
> Do we need to sync the other way? That is, make sure that the last draw that
> reads the old contents has finished before the transfer begins?

We might need to, yes.

> > As a side note, it's a shame we have to use a fence and stall on the CPU --
I
> > think what we'd ideally want is a barrier or semaphore on the GPU where the
> draw
> > command waits for the upload to finish.
> 
> Yeah, that could be terrible since the GPU may be working on an early frame.
> There is a glWaitSync (as opposed to ClientWaitSync).

Ah, that makes a little more sense to me now. I think that might work. And on
Vulkan we have direct access to the GPU-only sync objects.

Powered by Google App Engine
This is Rietveld 408576698