gpu: add ShaderModule.setLabel

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-11 09:15:10 -07:00 committed by Stephen Gutekanst
parent c90f22811d
commit 7c94856ed6
2 changed files with 10 additions and 1 deletions

View file

@ -480,6 +480,11 @@ const shader_module_vtable = ShaderModule.VTable{
c.wgpuShaderModuleRelease(@ptrCast(c.WGPUShaderModule, ptr));
}
}).release,
.setLabel = (struct {
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
c.wgpuShaderModuleSetLabel(@ptrCast(c.WGPUShaderModule, ptr), label);
}
}).setLabel,
};
fn wrapSwapChain(swap_chain: c.WGPUSwapChain) SwapChain {

View file

@ -10,7 +10,7 @@ pub const VTable = struct {
release: fn (ptr: *anyopaque) void,
// TODO:
// WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata);
// WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label);
setLabel: fn (ptr: *anyopaque, label: [:0]const u8) void,
};
pub inline fn reference(queue: ShaderModule) void {
@ -21,6 +21,10 @@ pub inline fn release(queue: ShaderModule) void {
queue.vtable.release(queue.ptr);
}
pub inline fn setLabel(queue: ShaderModule, label: [:0]const u8) void {
queue.vtable.setLabel(queue.ptr, label);
}
pub const CodeTag = enum {
spirv,
wgsl,