mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 17:35:30 +00:00
Add the last usage serial in Buffer
Add the last usage serial in Buffer, it is used for optimizing MapAsync(), so the callback of MapAsync() is called when the last usage serial is done instead of using the current pending serial when the MapAsync() is called. Bug: b/265151060 Change-Id: Ibc95d4e41d41896f0a49b0fd1068912b46ea14e1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/116693 Commit-Queue: Peng Huang <penghuang@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
@@ -39,6 +39,8 @@ ResultOrError<Ref<Buffer>> Buffer::CreateInternalBuffer(Device* device,
|
||||
|
||||
Buffer::Buffer(Device* device, const BufferDescriptor* descriptor)
|
||||
: BufferBase(device, descriptor) {
|
||||
// TODO(penghuang): track usage for GL.
|
||||
mLastUsageSerial = kMaxExecutionSerial;
|
||||
const OpenGLFunctions& gl = device->GetGL();
|
||||
// Allocate at least 4 bytes so clamped accesses are always in bounds.
|
||||
mAllocatedSize = std::max(GetSize(), uint64_t(4u));
|
||||
|
||||
Reference in New Issue
Block a user