gpu: add ComputePipeline.setLabel

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 09:04:01 -07:00 committed by Stephen Gutekanst
parent 0ec0d7a947
commit 17cb400075
2 changed files with 10 additions and 1 deletions

View file

@ -10,7 +10,7 @@ pub const VTable = struct {
release: fn (ptr: *anyopaque) void,
// TODO:
// WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex);
// WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label);
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
};
pub inline fn reference(pipeline: ComputePipeline) void {
@ -21,6 +21,10 @@ pub inline fn release(pipeline: ComputePipeline) void {
pipeline.vtable.release(pipeline.ptr);
}
pub inline fn setLabel(pipeline: ComputePipeline, label: [:0]const u8) void {
pipeline.vtable.setLabel(pipeline.ptr, label);
}
test "syntax" {
_ = VTable;
_ = reference;

View file

@ -881,6 +881,11 @@ const compute_pipeline_vtable = ComputePipeline.VTable{
c.wgpuComputePipelineRelease(@ptrCast(c.WGPUComputePipeline, ptr));
}
}).release,
.setLabel = (struct {
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
c.wgpuComputePipelineSetLabel(@ptrCast(c.WGPUComputePipeline, ptr), label);
}
}).setLabel,
};
test "syntax" {