gpu: document implementation initialization
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
34c2590d18
commit
96221fa13e
2 changed files with 4 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue