From 2fbd4b06d90676d86dbf4dd63b22daec63ed7eec Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 15 Jul 2022 23:56:49 -0700 Subject: [PATCH] gpu: add ExternalTexture.BindingEntry Signed-off-by: Stephen Gutekanst --- gpu/TODO-webgpu.h | 5 ----- gpu/src/dawn.zig | 3 --- gpu/src/external_texture.zig | 7 +++++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gpu/TODO-webgpu.h b/gpu/TODO-webgpu.h index 9bc210b1..4e34c95b 100644 --- a/gpu/TODO-webgpu.h +++ b/gpu/TODO-webgpu.h @@ -1,8 +1,3 @@ -typedef struct WGPUExternalTextureBindingEntry { - WGPUChainedStruct chain; - WGPUExternalTexture externalTexture; -} WGPUExternalTextureBindingEntry; - typedef struct WGPUExternalTextureBindingLayout { WGPUChainedStruct chain; } WGPUExternalTextureBindingLayout; diff --git a/gpu/src/dawn.zig b/gpu/src/dawn.zig index 6305039f..e8d0f0b4 100644 --- a/gpu/src/dawn.zig +++ b/gpu/src/dawn.zig @@ -14,20 +14,17 @@ pub const EncoderInternalUsageDescriptor = struct { }; pub const InstanceDescriptor = extern struct { - // TODO: file an issue on Dawn: why not named nextInChain? chain: ChainedStruct, additional_runtime_search_paths_count: u32, additional_runtime_search_paths: [*]const u8, }; pub const TextureInternalUsageDescriptor = extern struct { - // TODO: file an issue on Dawn: why not named nextInChain? chain: ChainedStruct, internal_usage: Texture.UsageFlags, }; pub const TogglesDeviceDescriptor = extern struct { - // TODO: file an issue on Dawn: why not named nextInChain? chain: ChainedStruct, force_enabled_toggles_count: u32, force_enabled_toggles: [*]const u8, diff --git a/gpu/src/external_texture.zig b/gpu/src/external_texture.zig index f98d8449..726803a0 100644 --- a/gpu/src/external_texture.zig +++ b/gpu/src/external_texture.zig @@ -1,6 +1,13 @@ +pub const ChainedStruct = @import("types.zig").ChainedStruct; + pub const ExternalTexture = enum(usize) { _, // TODO: verify there is a use case for nullable value of this type. pub const none: ExternalTexture = @intToEnum(ExternalTexture, 0); + + pub const BindingEntry = extern struct { + chain: ChainedStruct, + external_texture: ExternalTexture, + }; };