From 5a8585faa1700ca08e9255fce34f8b49e498648f Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 16:48:24 -0700 Subject: [PATCH] gpu: add ProgrammableStageDescriptor Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 8 -------- gpu/src/main.zig | 1 + gpu/src/structs.zig | 8 ++++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index d9b275ab..5c6133dd 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -57,14 +57,6 @@ typedef struct WGPUDawnTogglesDeviceDescriptor { -typedef struct WGPUProgrammableStageDescriptor { - WGPUChainedStruct const * nextInChain; - WGPUShaderModule module; - char const * entryPoint; - uint32_t constantCount; - WGPUConstantEntry const * constants; -} WGPUProgrammableStageDescriptor; - typedef struct WGPUTextureDescriptor { WGPUChainedStruct const * nextInChain; char const * label; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index f3e3bb78..adca6fc4 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -94,6 +94,7 @@ pub const MultisampleState = @import("structs.zig").MultisampleState; pub const PrimitiveState = @import("structs.zig").PrimitiveState; pub const StorageTextureBindingLayout = @import("structs.zig").StorageTextureBindingLayout; pub const DepthStencilState = @import("structs.zig").DepthStencilState; +pub const ProgrammableStageDescriptor = @import("structs.zig").ProgrammableStageDescriptor; // Enumerations pub const Feature = @import("enums.zig").Feature; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index 599e81f2..8385547c 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -57,6 +57,13 @@ pub const DepthStencilState = struct { depth_bias_clamp: f32, }; +pub const ProgrammableStageDescriptor = struct { + label: ?[*:0]const u8 = null, + module: ShaderModule, + entryPoint: [*:0]const u8, + constants: []const ConstantEntry, +}; + test "syntax" { _ = CompilationMessage; _ = CompilationInfo; @@ -64,4 +71,5 @@ test "syntax" { _ = PrimitiveState; _ = StorageTextureBindingLayout; _ = DepthStencilState; + _ = ProgrammableStageDescriptor; }