From ec300679a07d28d6ae61facb9a75aaf02bb124d3 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 17:19:40 -0700 Subject: [PATCH] gpu: add VertexState Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 10 ---------- gpu/src/main.zig | 1 + gpu/src/structs.zig | 10 +++++++++- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index 0c2c21fc..c3a8fd8d 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -99,16 +99,6 @@ typedef struct WGPUSupportedLimits { WGPULimits limits; } WGPUSupportedLimits; -typedef struct WGPUVertexState { - WGPUChainedStruct const * nextInChain; - WGPUShaderModule module; - char const * entryPoint; - uint32_t constantCount; - WGPUConstantEntry const * constants; - uint32_t bufferCount; - WGPUVertexBufferLayout const * buffers; -} WGPUVertexState; - typedef struct WGPUFragmentState { WGPUChainedStruct const * nextInChain; WGPUShaderModule module; diff --git a/gpu/src/main.zig b/gpu/src/main.zig index 418b4f1e..6dd6b7be 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -100,6 +100,7 @@ pub const ComputePassTimestampWrite = @import("structs.zig").ComputePassTimestam pub const RenderPassTimestampWrite = @import("structs.zig").RenderPassTimestampWrite; pub const RenderPassDepthStencilAttachment = @import("structs.zig").RenderPassDepthStencilAttachment; pub const RenderPassColorAttachment = @import("structs.zig").RenderPassColorAttachment; +pub const VertexState = @import("structs.zig").VertexState; // Enumerations pub const Feature = @import("enums.zig").Feature; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index 353ebe33..4d86a0d5 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -73,7 +73,7 @@ pub const ConstantEntry = struct { pub const ProgrammableStageDescriptor = struct { label: ?[*:0]const u8 = null, module: ShaderModule, - entryPoint: [*:0]const u8, + entry_point: [*:0]const u8, constants: []const ConstantEntry, }; @@ -111,6 +111,13 @@ pub const RenderPassColorAttachment = struct { clear_value: Color, }; +pub const VertexState = struct { + module: ShaderModule, + entry_point: [*:0]const u8, + constants: []const ConstantEntry, + buffers: []const VertexBufferLayout, +}; + test "syntax" { _ = CompilationMessage; _ = CompilationInfo; @@ -124,4 +131,5 @@ test "syntax" { _ = RenderPassTimestampWrite; _ = RenderPassDepthStencilAttachment; _ = RenderPassColorAttachment; + _ = VertexState; }