gpu: implement ComputePipeline
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
056e46ec39
commit
ce46b2a652
3 changed files with 58 additions and 6 deletions
28
gpu/src/ComputePipeline.zig
Normal file
28
gpu/src/ComputePipeline.zig
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
const ComputePipeline = @This();
|
||||
|
||||
/// The type erased pointer to the ComputePipeline implementation
|
||||
/// Equal to c.WGPUComputePipeline for NativeInstance.
|
||||
ptr: *anyopaque,
|
||||
vtable: *const VTable,
|
||||
|
||||
pub const VTable = struct {
|
||||
reference: fn (ptr: *anyopaque) void,
|
||||
release: fn (ptr: *anyopaque) void,
|
||||
// TODO:
|
||||
// WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex);
|
||||
// WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label);
|
||||
};
|
||||
|
||||
pub inline fn reference(pipeline: ComputePipeline) void {
|
||||
pipeline.vtable.reference(pipeline.ptr);
|
||||
}
|
||||
|
||||
pub inline fn release(pipeline: ComputePipeline) void {
|
||||
pipeline.vtable.release(pipeline.ptr);
|
||||
}
|
||||
|
||||
test "syntax" {
|
||||
_ = VTable;
|
||||
_ = reference;
|
||||
_ = release;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue