Deprecate Buffer::SetSubData in favor of Queue::WriteBuffer

Bug: dawn:22
Change-Id: I00b3cd65ac4eb494b05918251f4b3b2bcaf24f71
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2020-06-02 09:24:39 +00:00
committed by Commit Bot service account
parent 3b7d0858bf
commit 47a3341e07
40 changed files with 528 additions and 390 deletions

View File

@@ -38,4 +38,21 @@ namespace dawn_wire { namespace server {
return true;
}
bool Server::DoQueueWriteBufferInternal(ObjectId queueId,
ObjectId bufferId,
uint64_t bufferOffset,
const uint8_t* data,
size_t size) {
// The null object isn't valid as `self` or `buffer` so we can combine the check with the
// check that the ID is valid.
auto* queue = QueueObjects().Get(queueId);
auto* buffer = BufferObjects().Get(bufferId);
if (queue == nullptr || buffer == nullptr) {
return false;
}
mProcs.queueWriteBuffer(queue->handle, buffer->handle, bufferOffset, data, size);
return true;
}
}} // namespace dawn_wire::server