zgpu

git clone git://git.electrosoup.com/zgpu
Log | Files | Refs | Submodules | README

commit 36abab12b15fcd5709558a0b2d23d28a8aab26d7
parent 7c537cbc796a39d42a2a9592fcae2875aafcee7c
Author: Christian Ermann <christianermann@gmail.com>
Date:   Sun, 20 Apr 2025 19:51:20 -0700

Extract WGPU cImports into a single file

Diffstat:
Asrc/c.zig | 4++++
Msrc/common.zig | 4+---
Msrc/instance.zig | 5+----
Msrc/logging.zig | 4+---
Msrc/surface.zig | 5+----
5 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/c.zig b/src/c.zig @@ -0,0 +1,4 @@ +pub const c = @cImport({ + @cInclude("webgpu.h"); + @cInclude("wgpu.h"); +}); diff --git a/src/common.zig b/src/common.zig @@ -1,6 +1,4 @@ -const c = @cImport({ - @cInclude("webgpu.h"); -}); +const c = @import("c.zig").c; pub const SType = enum(u32) { invalid = 0x00000000, diff --git a/src/instance.zig b/src/instance.zig @@ -1,8 +1,5 @@ -const c = @cImport({ - @cInclude("webgpu.h"); - @cInclude("wgpu.h"); -}); +const c = @import("c.zig").c; const ChainedStruct = @import("common.zig").ChainedStruct; const Surface = @import("surface.zig").Surface; diff --git a/src/logging.zig b/src/logging.zig @@ -1,8 +1,6 @@ const std = @import("std"); -const c = @cImport({ - @cInclude("wgpu.h"); -}); +const c = @import("c.zig").c; pub const LogLevel = enum(u32) { off = 0x00000000, diff --git a/src/surface.zig b/src/surface.zig @@ -1,7 +1,4 @@ -const c = @cImport({ - @cInclude("webgpu.h"); -}); - +const c = @import("c.zig").c; const ChainedStruct = @import("common.zig").ChainedStruct; // WGPUSurface