[webgpu][headers] Adds forward declaration for callback info structs.
Change-Id: I86e10b5e691972c4d421e45bffa36515285aa452
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/247535
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Loko Kung <lokokung@google.com>
diff --git a/generator/templates/api.h b/generator/templates/api.h
index c81bd36..0bff8ff 100644
--- a/generator/templates/api.h
+++ b/generator/templates/api.h
@@ -247,6 +247,11 @@
struct {{as_cType(type.name)}};
{% endfor %}
+// Callback info structure forward declarations.
+{% for type in by_category["callback info"] %}
+ struct {{as_cType(type.name)}};
+{% endfor %}
+
{% for type in by_category["enum"] %}
typedef enum {{as_cType(type.name)}} {
{% for value in type.values %}
@@ -282,7 +287,7 @@
{% for type in by_category["callback function"] %}
typedef {{as_cType(type.return_type.name)}} (*{{as_cType(type.name)}})(
{%- for arg in type.arguments -%}
- {% if arg.type.category == "structure" and arg.type.name.get() != "string view"%}struct {% endif %}{{as_annotated_cType(arg)}}{{", "}}
+ {% if arg.type.category == "structure" and arg.type.name.get() != "string view" %}struct {% endif %}{{as_annotated_cType(arg)}}{{", "}}
{%- endfor -%}
{{API}}_NULLABLE void* userdata1, {{API}}_NULLABLE void* userdata2) {{API}}_FUNCTION_ATTRIBUTE;
diff --git a/third_party/webgpu-headers/webgpu.h.diff b/third_party/webgpu-headers/webgpu.h.diff
index 1757b3d..984a4e4 100644
--- a/third_party/webgpu-headers/webgpu.h.diff
+++ b/third_party/webgpu-headers/webgpu.h.diff
@@ -37,24 +37,6 @@
struct WGPUVertexAttribute;
struct WGPUBindGroupDescriptor;
@@
- struct WGPUFragmentState;
- struct WGPURenderPipelineDescriptor;
-
--struct WGPUBufferMapCallbackInfo;
--struct WGPUCompilationInfoCallbackInfo;
--struct WGPUCreateComputePipelineAsyncCallbackInfo;
--struct WGPUCreateRenderPipelineAsyncCallbackInfo;
--struct WGPUDeviceLostCallbackInfo;
--struct WGPUPopErrorScopeCallbackInfo;
--struct WGPUQueueWorkDoneCallbackInfo;
--struct WGPURequestAdapterCallbackInfo;
--struct WGPURequestDeviceCallbackInfo;
--struct WGPUUncapturedErrorCallbackInfo;
--
- typedef enum WGPUAdapterType {
- WGPUAdapterType_DiscreteGPU = 0x00000001,
- WGPUAdapterType_IntegratedGPU = 0x00000002,
-@@
WGPUFeatureName_ClipDistances = 0x0000000F,
WGPUFeatureName_DualSourceBlending = 0x00000010,
WGPUFeatureName_Subgroups = 0x00000011,