diff --git a/dawn.json b/dawn.json index db94f4e8d8..fccab43282 100644 --- a/dawn.json +++ b/dawn.json @@ -650,7 +650,7 @@ }, "device lost callback": { "category": "callback", - "args" : [ + "args": [ {"name": "message", "type": "char", "annotation": "const*"}, {"name": "userdata", "type": "void", "annotation": "*"} ] diff --git a/generator/templates/dawn_native/wgpu_structs.cpp b/generator/templates/dawn_native/wgpu_structs.cpp index bec3ebf173..83f24eea43 100644 --- a/generator/templates/dawn_native/wgpu_structs.cpp +++ b/generator/templates/dawn_native/wgpu_structs.cpp @@ -20,7 +20,7 @@ namespace dawn_native { "sizeof mismatch for ChainedStruct"); static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), "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"); static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), "offsetof mismatch for ChainedStruct::sType"); diff --git a/generator/templates/webgpu.h b/generator/templates/webgpu.h index 49e598c44c..52005ac1e1 100644 --- a/generator/templates/webgpu.h +++ b/generator/templates/webgpu.h @@ -95,7 +95,7 @@ typedef uint32_t WGPUFlags; {% endfor %} typedef struct WGPUChainedStruct { - struct WGPUChainedStruct const * nextInChain; + struct WGPUChainedStruct const * next; WGPUSType sType; } WGPUChainedStruct; @@ -105,8 +105,7 @@ typedef struct WGPUChainedStruct { WGPUChainedStruct const * nextInChain; {% endif %} {% if type.chained %} - WGPUChainedStruct const * nextInChain; - WGPUSType sType; + WGPUChainedStruct chain; {% endif %} {% for member in type.members %} {{as_annotated_cType(member)}}; diff --git a/generator/templates/webgpu_cpp.cpp b/generator/templates/webgpu_cpp.cpp index fcaac3e1c7..7d22f640af 100644 --- a/generator/templates/webgpu_cpp.cpp +++ b/generator/templates/webgpu_cpp.cpp @@ -46,7 +46,7 @@ namespace wgpu { "sizeof mismatch for ChainedStruct"); static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct), "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"); static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType), "offsetof mismatch for ChainedStruct::sType");