From 96221fa13ece8e2dfe452b199d1573d6390816cd Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sat, 30 Jul 2022 22:19:21 -0700 Subject: [PATCH] gpu: document implementation initialization Signed-off-by: Stephen Gutekanst --- gpu/src/dawn_impl.zig | 2 ++ gpu/src/interface.zig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gpu/src/dawn_impl.zig b/gpu/src/dawn_impl.zig index dbe1b8bf..d931dab9 100644 --- a/gpu/src/dawn_impl.zig +++ b/gpu/src/dawn_impl.zig @@ -8,6 +8,8 @@ const c = @cImport({ var procs: c.DawnProcTable = undefined; /// A Dawn implementation of the gpu.Interface, which merely directs calls to the Dawn proc table. +/// +/// Before use, it must be `.init()`ialized in order to set the global proc table. pub const Interface = gpu.Interface(struct { pub fn init() @This() { procs = c.machDawnGetProcTable(); diff --git a/gpu/src/interface.zig b/gpu/src/interface.zig index 36b563d4..b73a051b 100644 --- a/gpu/src/interface.zig +++ b/gpu/src/interface.zig @@ -2,6 +2,8 @@ const gpu = @import("main.zig"); /// The gpu.Interface implementation that is used by the entire program. Only one may exist, since /// it is resolved fully at comptime with no vtable indirection, etc. +/// +/// Depending on the implementation, it may need to be `.init()`ialized before use. pub const Impl = blk: { if (@import("builtin").is_test) { break :blk StubInterface;