Update WGPUChainedStruct usage to match webgpu.h

In the webgpu-headers PR it was decided that in the C header
WGPUChainedStruct would be included as a member instead of members being
inlined.

See https://github.com/webgpu-native/webgpu-headers/pull/30

Bug: dawn:160
Change-Id: I8caf91f3106578077c80778621a632411da44423
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15441
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-01-25 09:30:40 +00:00 committed by Commit Bot service account
parent eb1ca45df7
commit 13e2e139a5
4 changed files with 5 additions and 6 deletions

View File

@ -650,7 +650,7 @@
}, },
"device lost callback": { "device lost callback": {
"category": "callback", "category": "callback",
"args" : [ "args": [
{"name": "message", "type": "char", "annotation": "const*"}, {"name": "message", "type": "char", "annotation": "const*"},
{"name": "userdata", "type": "void", "annotation": "*"} {"name": "userdata", "type": "void", "annotation": "*"}
] ]

View File

@ -20,7 +20,7 @@ namespace dawn_native {
"sizeof mismatch for ChainedStruct"); "sizeof mismatch for ChainedStruct");
static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct),
"alignof mismatch for ChainedStruct"); "alignof mismatch for ChainedStruct");
static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, nextInChain), static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next),
"offsetof mismatch for ChainedStruct::nextInChain"); "offsetof mismatch for ChainedStruct::nextInChain");
static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType),
"offsetof mismatch for ChainedStruct::sType"); "offsetof mismatch for ChainedStruct::sType");

View File

@ -95,7 +95,7 @@ typedef uint32_t WGPUFlags;
{% endfor %} {% endfor %}
typedef struct WGPUChainedStruct { typedef struct WGPUChainedStruct {
struct WGPUChainedStruct const * nextInChain; struct WGPUChainedStruct const * next;
WGPUSType sType; WGPUSType sType;
} WGPUChainedStruct; } WGPUChainedStruct;
@ -105,8 +105,7 @@ typedef struct WGPUChainedStruct {
WGPUChainedStruct const * nextInChain; WGPUChainedStruct const * nextInChain;
{% endif %} {% endif %}
{% if type.chained %} {% if type.chained %}
WGPUChainedStruct const * nextInChain; WGPUChainedStruct chain;
WGPUSType sType;
{% endif %} {% endif %}
{% for member in type.members %} {% for member in type.members %}
{{as_annotated_cType(member)}}; {{as_annotated_cType(member)}};

View File

@ -46,7 +46,7 @@ namespace wgpu {
"sizeof mismatch for ChainedStruct"); "sizeof mismatch for ChainedStruct");
static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct),
"alignof mismatch for ChainedStruct"); "alignof mismatch for ChainedStruct");
static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, nextInChain), static_assert(offsetof(ChainedStruct, nextInChain) == offsetof(WGPUChainedStruct, next),
"offsetof mismatch for ChainedStruct::nextInChain"); "offsetof mismatch for ChainedStruct::nextInChain");
static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType),
"offsetof mismatch for ChainedStruct::sType"); "offsetof mismatch for ChainedStruct::sType");