gpu: add TextureView.setLabel
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
e674250ec5
commit
d865d42aef
2 changed files with 13 additions and 5 deletions
|
|
@ -536,6 +536,11 @@ const texture_view_vtable = TextureView.VTable{
|
|||
c.wgpuTextureViewRelease(@ptrCast(c.WGPUTextureView, ptr));
|
||||
}
|
||||
}).release,
|
||||
.setLabel = (struct {
|
||||
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||
c.wgpuTextureViewSetLabel(@ptrCast(c.WGPUTextureView, ptr), label);
|
||||
}
|
||||
}).setLabel,
|
||||
};
|
||||
|
||||
fn wrapTexture(texture: c.WGPUTexture) Texture {
|
||||
|
|
@ -658,7 +663,7 @@ const render_bundle_encoder_vtable = RenderBundleEncoder.VTable{
|
|||
}).release,
|
||||
.setLabel = (struct {
|
||||
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||
c.wgpuRenderBundleSetLabel(@ptrCast(c.WGPURenderBundle, ptr), label);
|
||||
c.wgpuRenderBundleEncoderSetLabel(@ptrCast(c.WGPURenderBundleEncoder, ptr), label);
|
||||
}
|
||||
}).setLabel,
|
||||
};
|
||||
|
|
@ -828,7 +833,7 @@ const buffer_vtable = Buffer.VTable{
|
|||
}).release,
|
||||
.setLabel = (struct {
|
||||
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||
c.wgpuBufferLayoutSetLabel(@ptrCast(c.WGPUBufferLayout, ptr), label);
|
||||
c.wgpuBufferSetLabel(@ptrCast(c.WGPUBuffer, ptr), label);
|
||||
}
|
||||
}).setLabel,
|
||||
};
|
||||
|
|
@ -853,7 +858,7 @@ const command_buffer_vtable = CommandBuffer.VTable{
|
|||
}).release,
|
||||
.setLabel = (struct {
|
||||
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||
c.wgpuCommandBufferLayoutSetLabel(@ptrCast(c.WGPUCommandBufferLayout, ptr), label);
|
||||
c.wgpuCommandBufferSetLabel(@ptrCast(c.WGPUCommandBuffer, ptr), label);
|
||||
}
|
||||
}).setLabel,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ vtable: *const VTable,
|
|||
pub const VTable = struct {
|
||||
reference: fn (ptr: *anyopaque) void,
|
||||
release: fn (ptr: *anyopaque) void,
|
||||
// TODO:
|
||||
// WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label);
|
||||
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
|
||||
};
|
||||
|
||||
pub inline fn reference(texture_view: TextureView) void {
|
||||
|
|
@ -20,6 +19,10 @@ pub inline fn release(texture_view: TextureView) void {
|
|||
texture_view.vtable.release(texture_view.ptr);
|
||||
}
|
||||
|
||||
pub inline fn setLabel(texture_view: TextureView, label: [:0]const u8) void {
|
||||
texture_view.vtable.setLabel(texture_view.ptr, label);
|
||||
}
|
||||
|
||||
test "syntax" {
|
||||
_ = VTable;
|
||||
_ = reference;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue