dawn.json: Use void* instead of uint8_t* for data pointers

This requires some changes in the wire because WireCmd doesn't know the
size of void. This also adds a handwritten implementation of the Wire
commands for SetSubData that internally converts to uint8_t so that
WireCmd can generate the de/serialization.

BUG=dawn:160

Change-Id: Icbf0fd7dd841639ee6f67333844e027b27a8afcc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7780
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2019-06-06 16:19:15 +00:00
committed by Commit Bot service account
parent 97c0885a4a
commit 67ab1ea8c7
21 changed files with 93 additions and 49 deletions

View File

@@ -78,6 +78,24 @@ namespace dawn_wire { namespace server {
return true;
}
bool Server::DoBufferSetSubDataInternal(ObjectId bufferId,
uint64_t start,
uint64_t offset,
const uint8_t* data) {
// The null object isn't valid as `self`
if (bufferId == 0) {
return false;
}
auto* buffer = BufferObjects().Get(bufferId);
if (buffer == nullptr) {
return false;
}
mProcs.bufferSetSubData(buffer->handle, start, offset, data);
return true;
}
bool Server::DoBufferUpdateMappedData(ObjectId bufferId, uint32_t count, const uint8_t* data) {
// The null object isn't valid as `self`
if (bufferId == 0) {
@@ -89,10 +107,7 @@ namespace dawn_wire { namespace server {
return false;
}
if (data == nullptr) {
return false;
}
ASSERT(data != nullptr);
memcpy(buffer->mappedData, data, count);
return true;