Fix up GPUDDLSink for Vulkan
Change-Id: If38afff3d07f51fd0f5a989c2f59e3c788086f8b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284099 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
c15c936c3e
commit
4e3ceb96b8
@ -1671,7 +1671,17 @@ Result GPUDDLSink::ddlDraw(const Src& src,
|
||||
recordingTaskGroup->wait();
|
||||
|
||||
// This should be the only explicit flush for the entire DDL draw
|
||||
gpuTaskGroup->add([gpuThreadCtx]() { gpuThreadCtx->flush(); });
|
||||
gpuTaskGroup->add([gpuThreadCtx]() {
|
||||
// We need to ensure all the GPU work is finished so
|
||||
// the following 'deleteAllFromGPU' call will work
|
||||
// on Vulkan.
|
||||
// TODO: switch over to using the promiseImage callbacks
|
||||
// to free the backendTextures. This is complicated a
|
||||
// bit by which thread possesses the direct context.
|
||||
GrFlushInfo flushInfoSyncCpu;
|
||||
flushInfoSyncCpu.fFlags = kSyncCpu_GrFlushFlag;
|
||||
gpuThreadCtx->flush(flushInfoSyncCpu);
|
||||
});
|
||||
|
||||
// The backend textures are created on the gpuThread by the 'uploadAllToGPU' call.
|
||||
// It is simpler to also delete them at this point on the gpuThread.
|
||||
|
@ -88,6 +88,10 @@ private:
|
||||
|
||||
void destroyBackendTexture() {
|
||||
SkASSERT(!fPromiseImageTexture || fPromiseImageTexture->unique());
|
||||
|
||||
if (fPromiseImageTexture) {
|
||||
fContext->deleteBackendTexture(fPromiseImageTexture->backendTexture());
|
||||
}
|
||||
fPromiseImageTexture = nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user