zig-webgpu-gen

git clone git://git.electrosoup.com/zig-webgpu-gen
Log | Files | Refs

commit 00159740b8978a757f6e3c67bf61586ad4a286a1
parent ffed5fc46fc8b98700184a2915742a89375698ae
Author: Christian Ermann <christianermann@gmail.com>
Date:   Sun,  1 Mar 2026 19:18:29 -0800

Begin defining functions

Diffstat:
Msrc/main.zig | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/main.zig b/src/main.zig @@ -681,6 +681,14 @@ const Function = struct { try writer.writeAll("void"); } try writer.writeAll(" {\n"); + + try renderIndent(indent + 1, writer); + try writer.writeAll("c.wgpu"); + try snakeToPascal(self.name, writer); + try writer.writeAll("(\n"); + try renderIndent(indent + 1, writer); + try writer.writeAll(");\n"); + try renderIndent(indent, writer); try writer.writeAll("}\n"); } @@ -767,6 +775,11 @@ fn renderHeader(writer: anytype) !void { \\ \\const std = @import("std"); \\ + \\const c = @cImport({ + \\ @cInclude("webgpu.h"); + \\ @cInclude("wgpu.h"); + \\}); + \\ \\pub const ChainedStruct = extern struct { \\ next: ?*const ChainedStruct, \\ struct_type: SType,