Sort the struct forward declarations. When generating webgpu.h in the dawn generator sort the forward declarations of structures in order to match the upstream webgpu.h header. Bug: 465339954 Change-Id: I7ffd9d0db364fac827e03c33e88b6ab3094a268b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/298135 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/generator/templates/api.h b/generator/templates/api.h index 56a7fce..71ab2cb 100644 --- a/generator/templates/api.h +++ b/generator/templates/api.h
@@ -242,7 +242,7 @@ typedef uint64_t {{API}}Flags; typedef uint32_t {{API}}Bool; -{% for type in by_category["object"] %} +{% for type in by_category["object"] | sort %} typedef struct {{as_cType(type.name)}}Impl* {{as_cType(type.name)}} {{API}}_OBJECT_ATTRIBUTE; {% endfor %}
diff --git a/third_party/webgpu-headers/webgpu.h.diff b/third_party/webgpu-headers/webgpu.h.diff index 2a55300..c4f81b2 100644 --- a/third_party/webgpu-headers/webgpu.h.diff +++ b/third_party/webgpu-headers/webgpu.h.diff
@@ -1,17 +1,8 @@ --- webgpu_header +++ dawn_header @@ --typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE; -@@ -typedef struct WGPUExternalTextureImpl* WGPUExternalTexture WGPU_OBJECT_ATTRIBUTE; @@ --typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder WGPU_OBJECT_ATTRIBUTE; --typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder WGPU_OBJECT_ATTRIBUTE; -@@ -+typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE; -+typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder WGPU_OBJECT_ATTRIBUTE; -+typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder WGPU_OBJECT_ATTRIBUTE; -@@ +struct WGPUBindGroupEntry; @@ -struct WGPUExternalTextureBindingEntry;