WireCmd: Update buffer pointer when serializing sub elements

Without this the serialize step failed to increment the pointer to
the buffer to account for the recording of "main" in the render
pipeline descriptor:

  descriptor->vertexStage->entryPoint = "main";

BUG=dawn:4

Change-Id: Ic3829787af2213577ac67ee93625679afdae1cc9
Reviewed-on: https://dawn-review.googlesource.com/c/2880
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-12-05 10:13:52 +00:00 committed by Commit Bot service account
parent 6f9d21e805
commit 7b3ea34b6b
1 changed files with 6 additions and 6 deletions

View File

@ -144,7 +144,7 @@
//* Serializes `record` into `transfer`, using `buffer` to get more space for pointed-to data
//* and `provider` to serialize objects.
void {{name}}Serialize(const {{name}}& record, {{name}}Transfer* transfer,
char* buffer, const ObjectIdProvider& provider) {
char** buffer, const ObjectIdProvider& provider) {
DAWN_UNUSED(provider);
DAWN_UNUSED(buffer);
@ -170,8 +170,8 @@
{% set memberName = as_varName(member.name) %}
transfer->{{memberName}}Strlen = std::strlen(record.{{memberName}});
memcpy(buffer, record.{{memberName}}, transfer->{{memberName}}Strlen);
buffer += transfer->{{memberName}}Strlen;
memcpy(*buffer, record.{{memberName}}, transfer->{{memberName}}Strlen);
*buffer += transfer->{{memberName}}Strlen;
{% endfor %}
//* Allocate space and write the non-value arguments in it.
@ -179,9 +179,9 @@
{% set memberName = as_varName(member.name) %}
{
size_t memberLength = {{member_length(member, "record.")}};
auto memberBuffer = reinterpret_cast<{{member_transfer_type(member)}}*>(buffer);
auto memberBuffer = reinterpret_cast<{{member_transfer_type(member)}}*>(*buffer);
buffer += memberLength * {{member_transfer_sizeof(member)}};
*buffer += memberLength * {{member_transfer_sizeof(member)}};
for (size_t i = 0; i < memberLength; ++i) {
{{serialize_member(member, "record." + memberName + "[i]", "memberBuffer[i]" )}}
}
@ -345,7 +345,7 @@ namespace dawn_wire {
auto transfer = reinterpret_cast<{{name}}Transfer*>(buffer);
buffer += sizeof({{name}}Transfer);
{{name}}Serialize(*this, transfer, buffer, objectIdProvider);
{{name}}Serialize(*this, transfer, &buffer, objectIdProvider);
}
DeserializeResult {{Cmd}}::Deserialize(const char** buffer, size_t* size, DeserializeAllocator* allocator, const ObjectIdResolver& resolver) {