gpu: add BindGroupEntry
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
fd48c830e1
commit
a541bf4fa1
4 changed files with 35 additions and 11 deletions
10
gpu/src/TODO
10
gpu/src/TODO
|
|
@ -187,16 +187,6 @@ typedef struct WGPURenderPipelineDescriptor {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct WGPUBindGroupEntry {
|
|
||||||
WGPUChainedStruct const * nextInChain;
|
|
||||||
uint32_t binding;
|
|
||||||
WGPUBuffer buffer;
|
|
||||||
uint64_t offset;
|
|
||||||
uint64_t size;
|
|
||||||
WGPUSampler sampler;
|
|
||||||
WGPUTextureView textureView;
|
|
||||||
} WGPUBindGroupEntry;
|
|
||||||
|
|
||||||
typedef struct WGPUBufferBindingLayout {
|
typedef struct WGPUBufferBindingLayout {
|
||||||
WGPUChainedStruct const * nextInChain;
|
WGPUChainedStruct const * nextInChain;
|
||||||
WGPUBufferBindingType type;
|
WGPUBufferBindingType type;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ const BlendOperation = @import("enums.zig").BlendOperation;
|
||||||
const BlendFactor = @import("enums.zig").BlendFactor;
|
const BlendFactor = @import("enums.zig").BlendFactor;
|
||||||
const CompareFunction = @import("enums.zig").CompareFunction;
|
const CompareFunction = @import("enums.zig").CompareFunction;
|
||||||
const StencilOperation = @import("enums.zig").StencilOperation;
|
const StencilOperation = @import("enums.zig").StencilOperation;
|
||||||
|
const VertexFormat = @import("enums.zig").VertexFormat;
|
||||||
|
const VertexStepMode = @import("enums.zig").VertexStepMode;
|
||||||
|
|
||||||
// TODO: docs
|
// TODO: docs
|
||||||
pub const Limits = extern struct {
|
pub const Limits = extern struct {
|
||||||
|
|
@ -84,3 +86,15 @@ pub const VertexBufferLayout = extern struct {
|
||||||
attribute_count: u32,
|
attribute_count: u32,
|
||||||
attributes: *const VertexAttribute,
|
attributes: *const VertexAttribute,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
test "syntax" {
|
||||||
|
_ = Limits;
|
||||||
|
_ = Color;
|
||||||
|
_ = Extent3D;
|
||||||
|
_ = Origin3D;
|
||||||
|
_ = StencilFaceState;
|
||||||
|
_ = VertexAttribute;
|
||||||
|
_ = BlendComponent;
|
||||||
|
_ = BlendState;
|
||||||
|
_ = VertexBufferLayout;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ pub const CommandEncoder = @import("CommandEncoder.zig");
|
||||||
pub const ComputePassEncoder = @import("ComputePassEncoder.zig");
|
pub const ComputePassEncoder = @import("ComputePassEncoder.zig");
|
||||||
pub const ComputePipeline = @import("ComputePipeline.zig");
|
pub const ComputePipeline = @import("ComputePipeline.zig");
|
||||||
|
|
||||||
// Data structures
|
// Data structures ABI-compatible with webgpu.h
|
||||||
pub const Limits = @import("data.zig").Limits;
|
pub const Limits = @import("data.zig").Limits;
|
||||||
pub const Color = @import("data.zig").Color;
|
pub const Color = @import("data.zig").Color;
|
||||||
pub const Extent3D = @import("data.zig").Extent3D;
|
pub const Extent3D = @import("data.zig").Extent3D;
|
||||||
|
|
@ -85,6 +85,9 @@ pub const BlendComponent = @import("data.zig").BlendComponent;
|
||||||
pub const BlendState = @import("data.zig").BlendState;
|
pub const BlendState = @import("data.zig").BlendState;
|
||||||
pub const VertexBufferLayout = @import("data.zig").VertexBufferLayout;
|
pub const VertexBufferLayout = @import("data.zig").VertexBufferLayout;
|
||||||
|
|
||||||
|
// Data structures not ABI-compatible with webgpu.h
|
||||||
|
pub const BindGroupEntry = @import("structs.zig").BindGroupEntry;
|
||||||
|
|
||||||
// Enumerations
|
// Enumerations
|
||||||
pub const Feature = @import("enums.zig").Feature;
|
pub const Feature = @import("enums.zig").Feature;
|
||||||
pub const TextureUsage = @import("enums.zig").TextureUsage;
|
pub const TextureUsage = @import("enums.zig").TextureUsage;
|
||||||
|
|
|
||||||
17
gpu/src/structs.zig
Normal file
17
gpu/src/structs.zig
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
//! Structures which are not ABI compatible with webgpu.h
|
||||||
|
const Buffer = @import("Buffer.zig");
|
||||||
|
const Sampler = @import("Sampler.zig");
|
||||||
|
const TextureView = @import("TextureView.zig");
|
||||||
|
|
||||||
|
pub const BindGroupEntry = struct {
|
||||||
|
binding: u32,
|
||||||
|
buffer: Buffer,
|
||||||
|
offset: u64,
|
||||||
|
size: u64,
|
||||||
|
sampler: Sampler,
|
||||||
|
texture_view: TextureView,
|
||||||
|
};
|
||||||
|
|
||||||
|
test "syntax" {
|
||||||
|
_ = BindGroupEntry;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue