mach/gpu/src/RenderPipeline.zig
Stephen Gutekanst 8684195e19 gpu: implement RenderPipeline
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-03-19 00:51:48 -07:00

28 lines
836 B
Zig

const RenderPipeline = @This();
/// The type erased pointer to the RenderPipeline implementation
/// Equal to c.WGPURenderPipeline 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 wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex);
// WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label);
};
pub inline fn reference(pipeline: RenderPipeline) void {
pipeline.vtable.reference(pipeline.ptr);
}
pub inline fn release(pipeline: RenderPipeline) void {
pipeline.vtable.release(pipeline.ptr);
}
test "syntax" {
_ = VTable;
_ = reference;
_ = release;
}