From 04378a8ff78ce3cb66bb171786f2425fc6da6667 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 11 Mar 2022 15:02:17 -0700 Subject: [PATCH] gpu: add VertexBufferLayout Signed-off-by: Stephen Gutekanst --- gpu/src/TODO | 11 +---------- gpu/src/main.zig | 1 + gpu/src/structs.zig | 7 +++++++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gpu/src/TODO b/gpu/src/TODO index 19993cbc..904ff577 100644 --- a/gpu/src/TODO +++ b/gpu/src/TODO @@ -388,10 +388,6 @@ typedef struct WGPURenderPassDepthStencilAttachment { bool stencilReadOnly; } WGPURenderPassDepthStencilAttachment; - - - - typedef struct WGPURenderPassColorAttachment { WGPUTextureView view; WGPUTextureView resolveTarget; @@ -401,12 +397,7 @@ typedef struct WGPURenderPassColorAttachment { WGPUColor clearValue; } WGPURenderPassColorAttachment; -typedef struct WGPUVertexBufferLayout { - uint64_t arrayStride; - WGPUVertexStepMode stepMode; - uint32_t attributeCount; - WGPUVertexAttribute const * attributes; -} WGPUVertexBufferLayout; + diff --git a/gpu/src/main.zig b/gpu/src/main.zig index d1fa090d..b28255f8 100644 --- a/gpu/src/main.zig +++ b/gpu/src/main.zig @@ -83,6 +83,7 @@ pub const StencilFaceState = @import("structs.zig").StencilFaceState; pub const VertexAttribute = @import("structs.zig").VertexAttribute; pub const BlendComponent = @import("structs.zig").BlendComponent; pub const BlendState = @import("structs.zig").BlendState; +pub const VertexBufferLayout = @import("structs.zig").VertexBufferLayout; // Enumerations pub const Feature = @import("enums.zig").Feature; diff --git a/gpu/src/structs.zig b/gpu/src/structs.zig index 606a61d5..6c18418b 100644 --- a/gpu/src/structs.zig +++ b/gpu/src/structs.zig @@ -75,3 +75,10 @@ pub const BlendState = extern struct { color: BlendComponent, alpha: BlendComponent, }; + +pub const VertexBufferLayout = extern struct { + array_stride: u64, + step_mode: VertexStepMode, + attribute_count: u32, + attributes: *const VertexAttribute, +};