Remove `dawn`,`emscripten` check for external texture. The External Texture header entries are in the upstream WebGPU native header file but they aren't in the local generated copy. Currently dawn.json guards them behind `dawn` and `emscripten` tags. This CL removes the tags so our header generates closer to the upstream header. Change-Id: I9009a8cb9132853346d6bcbe1661995c753862de Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/298176 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/dawn/dawn.json b/src/dawn/dawn.json index c7d0cea..b3dc87a 100644 --- a/src/dawn/dawn.json +++ b/src/dawn/dawn.json
@@ -465,7 +465,6 @@ "category": "structure", "chained": "in", "chain roots": ["bind group entry"], - "tags": ["dawn", "emscripten"], "members": [ {"name": "external texture", "type": "external texture"} ] @@ -485,7 +484,6 @@ "category": "structure", "chained": "in", "chain roots": ["bind group layout entry"], - "tags": ["dawn", "emscripten"], "members": [] }, @@ -1773,7 +1771,6 @@ }, "external texture": { "category": "object", - "tags": ["dawn", "emscripten"], "methods": [ { "name": "set label", @@ -3955,14 +3952,14 @@ {"value": 10, "name": "surface color management"}, {"value": 11, "name": "request adapter WebXR options"}, {"value": 12, "name": "texture component swizzle descriptor"}, + {"value": 13, "name": "external texture binding layout"}, + {"value": 14, "name": "external texture binding entry"}, {"value": 15, "name": "compatibility mode limits"}, {"value": 16, "name": "texture binding view dimension"}, {"value": 0, "name": "emscripten surface source canvas HTML selector", "tags": ["emscripten"]}, {"value": 0, "name": "surface descriptor from windows core window", "tags": ["dawn"]}, - {"value": 1, "name": "external texture binding entry", "tags": ["dawn", "emscripten"]}, - {"value": 2, "name": "external texture binding layout", "tags": ["dawn", "emscripten"]}, {"value": 3, "name": "surface descriptor from windows UWP swap chain panel", "tags": ["dawn"]}, {"value": 4, "name": "dawn texture internal usage descriptor", "tags": ["dawn"]}, {"value": 5, "name": "dawn encoder internal usage descriptor", "tags": ["dawn"]},
diff --git a/third_party/webgpu-headers/webgpu.h.diff b/third_party/webgpu-headers/webgpu.h.diff index c4f81b2..9b3697a 100644 --- a/third_party/webgpu-headers/webgpu.h.diff +++ b/third_party/webgpu-headers/webgpu.h.diff
@@ -1,71 +1,10 @@ --- webgpu_header +++ dawn_header @@ --typedef struct WGPUExternalTextureImpl* WGPUExternalTexture WGPU_OBJECT_ATTRIBUTE; -@@ -+struct WGPUBindGroupEntry; -@@ --struct WGPUExternalTextureBindingEntry; --struct WGPUExternalTextureBindingLayout; -@@ -struct WGPUTextureViewDescriptor; @@ --struct WGPUBindGroupEntry; -+struct WGPUBindGroupDescriptor; -@@ --struct WGPUBindGroupDescriptor; -@@ +struct WGPUTextureViewDescriptor; @@ -- WGPUSType_ExternalTextureBindingLayout = 0x0000000D, -- WGPUSType_ExternalTextureBindingEntry = 0x0000000E, -@@ -+typedef struct WGPUBindGroupEntry { -+ WGPUChainedStruct * nextInChain; -+ uint32_t binding; -+ WGPU_NULLABLE WGPUBuffer buffer; -+ uint64_t offset; -+ uint64_t size; -+ WGPU_NULLABLE WGPUSampler sampler; -+ WGPU_NULLABLE WGPUTextureView textureView; -+} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE; -+ -+#define WGPU_BIND_GROUP_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupEntry, { \ -+ /*.nextInChain=*/NULL _wgpu_COMMA \ -+ /*.binding=*/0 _wgpu_COMMA \ -+ /*.buffer=*/NULL _wgpu_COMMA \ -+ /*.offset=*/0 _wgpu_COMMA \ -+ /*.size=*/WGPU_WHOLE_SIZE _wgpu_COMMA \ -+ /*.sampler=*/NULL _wgpu_COMMA \ -+ /*.textureView=*/NULL _wgpu_COMMA \ -+}) -+ -@@ --}) -- --typedef struct WGPUExternalTextureBindingEntry { -- WGPUChainedStruct chain; -- WGPUExternalTexture externalTexture; --} WGPUExternalTextureBindingEntry WGPU_STRUCTURE_ATTRIBUTE; -- --#define WGPU_EXTERNAL_TEXTURE_BINDING_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExternalTextureBindingEntry, { \ -- /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ -- /*.next=*/NULL _wgpu_COMMA \ -- /*.sType=*/WGPUSType_ExternalTextureBindingEntry _wgpu_COMMA \ -- }) _wgpu_COMMA \ -- /*.externalTexture=*/NULL _wgpu_COMMA \ --}) -- --typedef struct WGPUExternalTextureBindingLayout { -- WGPUChainedStruct chain; --} WGPUExternalTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; -- --#define WGPU_EXTERNAL_TEXTURE_BINDING_LAYOUT_INIT _wgpu_MAKE_INIT_STRUCT(WGPUExternalTextureBindingLayout, { \ -- /*.chain=*/_wgpu_MAKE_INIT_STRUCT(WGPUChainedStruct, { \ -- /*.next=*/NULL _wgpu_COMMA \ -- /*.sType=*/WGPUSType_ExternalTextureBindingLayout _wgpu_COMMA \ -- }) _wgpu_COMMA \ -@@ -typedef struct WGPUTextureViewDescriptor { - WGPUChainedStruct * nextInChain; - WGPUStringView label; @@ -93,58 +32,6 @@ -}) - @@ --typedef struct WGPUBindGroupEntry { -- WGPUChainedStruct * nextInChain; -- uint32_t binding; -- WGPU_NULLABLE WGPUBuffer buffer; -- uint64_t offset; -- uint64_t size; -- WGPU_NULLABLE WGPUSampler sampler; -- WGPU_NULLABLE WGPUTextureView textureView; --} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE; -- --#define WGPU_BIND_GROUP_ENTRY_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupEntry, { \ -- /*.nextInChain=*/NULL _wgpu_COMMA \ -- /*.binding=*/0 _wgpu_COMMA \ -- /*.buffer=*/NULL _wgpu_COMMA \ -- /*.offset=*/0 _wgpu_COMMA \ -- /*.size=*/WGPU_WHOLE_SIZE _wgpu_COMMA \ -- /*.sampler=*/NULL _wgpu_COMMA \ -- /*.textureView=*/NULL _wgpu_COMMA \ -+typedef struct WGPUBindGroupDescriptor { -+ WGPUChainedStruct * nextInChain; -+ WGPUStringView label; -+ WGPUBindGroupLayout layout; -+ size_t entryCount; -+ WGPUBindGroupEntry const * entries; -+} WGPUBindGroupDescriptor WGPU_STRUCTURE_ATTRIBUTE; -+ -+#define WGPU_BIND_GROUP_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupDescriptor, { \ -+ /*.nextInChain=*/NULL _wgpu_COMMA \ -+ /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -+ /*.layout=*/NULL _wgpu_COMMA \ -+ /*.entryCount=*/0 _wgpu_COMMA \ -+ /*.entries=*/NULL _wgpu_COMMA \ -@@ --typedef struct WGPUBindGroupDescriptor { -- WGPUChainedStruct * nextInChain; -- WGPUStringView label; -- WGPUBindGroupLayout layout; -- size_t entryCount; -- WGPUBindGroupEntry const * entries; --} WGPUBindGroupDescriptor WGPU_STRUCTURE_ATTRIBUTE; -- --#define WGPU_BIND_GROUP_DESCRIPTOR_INIT _wgpu_MAKE_INIT_STRUCT(WGPUBindGroupDescriptor, { \ -- /*.nextInChain=*/NULL _wgpu_COMMA \ -- /*.label=*/WGPU_STRING_VIEW_INIT _wgpu_COMMA \ -- /*.layout=*/NULL _wgpu_COMMA \ -- /*.entryCount=*/0 _wgpu_COMMA \ -- /*.entries=*/NULL _wgpu_COMMA \ --}) -- -@@ -+}) -+ +typedef struct WGPUTextureViewDescriptor { + WGPUChainedStruct * nextInChain; + WGPUStringView label; @@ -169,13 +56,5 @@ + /*.arrayLayerCount=*/WGPU_ARRAY_LAYER_COUNT_UNDEFINED _wgpu_COMMA \ + /*.aspect=*/WGPUTextureAspect_Undefined _wgpu_COMMA \ + /*.usage=*/WGPUTextureUsage_None _wgpu_COMMA \ -@@ --typedef void (*WGPUProcExternalTextureSetLabel)(WGPUExternalTexture externalTexture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; --typedef void (*WGPUProcExternalTextureAddRef)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; --typedef void (*WGPUProcExternalTextureRelease)(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -- -@@ --WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture, WGPUStringView label) WGPU_FUNCTION_ATTRIBUTE; --WGPU_EXPORT void wgpuExternalTextureAddRef(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; --WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture) WGPU_FUNCTION_ATTRIBUTE; -- ++}) ++
diff --git a/tools/android/BUILD.gn b/tools/android/BUILD.gn index be120e7..007db4d 100644 --- a/tools/android/BUILD.gn +++ b/tools/android/BUILD.gn
@@ -104,6 +104,9 @@ "java/androidx/webgpu/GPUDevice.kt", "java/androidx/webgpu/GPUDeviceDescriptor.kt", "java/androidx/webgpu/GPUExtent3D.kt", + "java/androidx/webgpu/GPUExternalTexture.kt", + "java/androidx/webgpu/GPUExternalTextureBindingEntry.kt", + "java/androidx/webgpu/GPUExternalTextureBindingLayout.kt", "java/androidx/webgpu/GPUFragmentState.kt", "java/androidx/webgpu/GPUInstance.kt", "java/androidx/webgpu/GPUInstanceDescriptor.kt",