gpu: rename NullInterface -> StubInterface
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
0b63b6a41b
commit
898963619b
1 changed files with 5 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ const gpu = @import("main.zig");
|
||||||
/// it is resolved fully at comptime with no vtable indirection, etc.
|
/// it is resolved fully at comptime with no vtable indirection, etc.
|
||||||
pub const impl = blk: {
|
pub const impl = blk: {
|
||||||
if (@import("builtin").is_test) {
|
if (@import("builtin").is_test) {
|
||||||
break :blk NullInterface{};
|
break :blk StubInterface{};
|
||||||
} else {
|
} else {
|
||||||
const root = @import("root");
|
const root = @import("root");
|
||||||
if (!@hasField(root, "gpu_interface")) @compileError("expected to find `pub const gpu_interface: gpu.Interface(T) = T{};` in root file");
|
if (!@hasField(root, "gpu_interface")) @compileError("expected to find `pub const gpu_interface: gpu.Interface(T) = T{};` in root file");
|
||||||
|
|
@ -1048,8 +1048,8 @@ pub fn Export(comptime Impl: type) type {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A no-operation gpu.Interface implementation.
|
/// A stub gpu.Interface in which every function is implemented by `unreachable;`
|
||||||
pub const NullInterface = Interface(struct {
|
pub const StubInterface = Interface(struct {
|
||||||
pub inline fn createInstance(descriptor: *const InstanceDescriptor) ?Instance {
|
pub inline fn createInstance(descriptor: *const InstanceDescriptor) ?Instance {
|
||||||
_ = descriptor;
|
_ = descriptor;
|
||||||
unreachable;
|
unreachable;
|
||||||
|
|
@ -2291,6 +2291,6 @@ pub const NullInterface = Interface(struct {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test "null" {
|
test "stub" {
|
||||||
_ = Export(NullInterface);
|
_ = Export(StubInterface);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue