[graphite] Unmap and track current draw buffers
For discrete GPUs the draw buffers need to be unmapped so that didModifyRange: is called to updated the managed buffer. In addition, they should be tracked on the CommandBuffer. Bug: skia:13033 Change-Id: I931b1bfd438bc75652c04734219690506fad5ea6 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520537 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
b9802c75ef
commit
bd11ec8eab
@ -150,6 +150,21 @@ void DrawBufferManager::transferToCommandBuffer(CommandBuffer* commandBuffer) {
|
||||
commandBuffer->trackResource(std::move(buffer));
|
||||
}
|
||||
fUsedBuffers.clear();
|
||||
|
||||
// The current draw buffers have not been added to fUsedBuffers,
|
||||
// so we need to handle them as well.
|
||||
if (fCurrentVertexBuffer) {
|
||||
fCurrentVertexBuffer->unmap();
|
||||
commandBuffer->trackResource(std::move(fCurrentVertexBuffer));
|
||||
}
|
||||
if (fCurrentIndexBuffer) {
|
||||
fCurrentIndexBuffer->unmap();
|
||||
commandBuffer->trackResource(std::move(fCurrentIndexBuffer));
|
||||
}
|
||||
if (fCurrentUniformBuffer) {
|
||||
fCurrentUniformBuffer->unmap();
|
||||
commandBuffer->trackResource(std::move(fCurrentUniformBuffer));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace skgpu
|
||||
|
Loading…
Reference in New Issue
Block a user