gpu: add VertexBufferLayout

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 15:02:17 -07:00 committed by Stephen Gutekanst
parent d70f5695b6
commit 04378a8ff7
3 changed files with 9 additions and 10 deletions

View file

@ -388,10 +388,6 @@ typedef struct WGPURenderPassDepthStencilAttachment {
bool stencilReadOnly; bool stencilReadOnly;
} WGPURenderPassDepthStencilAttachment; } WGPURenderPassDepthStencilAttachment;
typedef struct WGPURenderPassColorAttachment { typedef struct WGPURenderPassColorAttachment {
WGPUTextureView view; WGPUTextureView view;
WGPUTextureView resolveTarget; WGPUTextureView resolveTarget;
@ -401,12 +397,7 @@ typedef struct WGPURenderPassColorAttachment {
WGPUColor clearValue; WGPUColor clearValue;
} WGPURenderPassColorAttachment; } WGPURenderPassColorAttachment;
typedef struct WGPUVertexBufferLayout {
uint64_t arrayStride;
WGPUVertexStepMode stepMode;
uint32_t attributeCount;
WGPUVertexAttribute const * attributes;
} WGPUVertexBufferLayout;

View file

@ -83,6 +83,7 @@ pub const StencilFaceState = @import("structs.zig").StencilFaceState;
pub const VertexAttribute = @import("structs.zig").VertexAttribute; pub const VertexAttribute = @import("structs.zig").VertexAttribute;
pub const BlendComponent = @import("structs.zig").BlendComponent; pub const BlendComponent = @import("structs.zig").BlendComponent;
pub const BlendState = @import("structs.zig").BlendState; pub const BlendState = @import("structs.zig").BlendState;
pub const VertexBufferLayout = @import("structs.zig").VertexBufferLayout;
// Enumerations // Enumerations
pub const Feature = @import("enums.zig").Feature; pub const Feature = @import("enums.zig").Feature;

View file

@ -75,3 +75,10 @@ pub const BlendState = extern struct {
color: BlendComponent, color: BlendComponent,
alpha: BlendComponent, alpha: BlendComponent,
}; };
pub const VertexBufferLayout = extern struct {
array_stride: u64,
step_mode: VertexStepMode,
attribute_count: u32,
attributes: *const VertexAttribute,
};