From e427dbc5749bbf97a156f34a57d36d8d0201b566 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Tue, 26 Jul 2022 19:41:59 -0700 Subject: [PATCH] gpu: implement ShaderModule methods Signed-off-by: Stephen Gutekanst --- gpu/src/shader_module.zig | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/gpu/src/shader_module.zig b/gpu/src/shader_module.zig index a5bd2bfb..945859af 100644 --- a/gpu/src/shader_module.zig +++ b/gpu/src/shader_module.zig @@ -1,17 +1,23 @@ const ChainedStruct = @import("types.zig").ChainedStruct; +const CompilationInfoCallback = @import("types.zig").CompilationInfoCallback; +const impl = @import("interface.zig").impl; pub const ShaderModule = *opaque { - // TODO - // pub inline fn shaderModuleGetCompilationInfo(shader_module: gpu.ShaderModule, callback: gpu.CompilationInfoCallback, userdata: *anyopaque) void { + pub inline fn getCompilationInfo(shader_module: ShaderModule, callback: CompilationInfoCallback, userdata: *anyopaque) void { + impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata); + } - // TODO - // pub inline fn shaderModuleSetLabel(shader_module: gpu.ShaderModule, label: [*:0]const u8) void { + pub inline fn setLabel(shader_module: ShaderModule, label: [*:0]const u8) void { + impl.shaderModuleSetLabel(shader_module, label); + } - // TODO - // pub inline fn shaderModuleReference(shader_module: gpu.ShaderModule) void { + pub inline fn reference(shader_module: ShaderModule) void { + impl.shaderModuleReference(shader_module); + } - // TODO - // pub inline fn shaderModuleRelease(shader_module: gpu.ShaderModule) void { + pub inline fn release(shader_module: ShaderModule) void { + impl.shaderModuleRelease(shader_module); + } }; pub const ShaderModuleDescriptor = extern struct {