gpu: add ExternalTexture.setLabel
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
17cb400075
commit
bf81debf42
2 changed files with 10 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ pub const VTable = struct {
|
|||
release: fn (ptr: *anyopaque) void,
|
||||
// TODO:
|
||||
// WGPU_EXPORT void wgpuExternalTextureDestroy(WGPUExternalTexture externalTexture);
|
||||
// WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture, char const * label);
|
||||
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
||||
};
|
||||
|
||||
pub inline fn reference(texture: ExternalTexture) void {
|
||||
|
|
@ -21,6 +21,10 @@ pub inline fn release(texture: ExternalTexture) void {
|
|||
texture.vtable.release(texture.ptr);
|
||||
}
|
||||
|
||||
pub inline fn setLabel(texture: ExternalTexture, label: [:0]const u8) void {
|
||||
texture.vtable.setLabel(texture.ptr, label);
|
||||
}
|
||||
|
||||
test "syntax" {
|
||||
_ = VTable;
|
||||
_ = reference;
|
||||
|
|
|
|||
|
|
@ -711,6 +711,11 @@ const external_texture_vtable = ExternalTexture.VTable{
|
|||
c.wgpuExternalTextureRelease(@ptrCast(c.WGPUExternalTexture, ptr));
|
||||
}
|
||||
}).release,
|
||||
.setLabel = (struct {
|
||||
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||
c.wgpuExternalTextureSetLabel(@ptrCast(c.WGPUExternalTexture, ptr), label);
|
||||
}
|
||||
}).setLabel,
|
||||
};
|
||||
|
||||
fn wrapBindGroup(group: c.WGPUBindGroup) BindGroup {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue