gpu: internalize Instance types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
223f10446a
commit
b6eb989dfa
3 changed files with 6 additions and 6 deletions
|
|
@ -7,6 +7,10 @@ const RequestAdapterOptions = @import("main.zig").RequestAdapterOptions;
|
|||
const Impl = @import("interface.zig").Impl;
|
||||
|
||||
pub const Instance = opaque {
|
||||
pub const Descriptor = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
};
|
||||
|
||||
pub inline fn createSurface(instance: *Instance, descriptor: *const SurfaceDescriptor) Surface {
|
||||
return Impl.instanceCreateSurface(instance, descriptor);
|
||||
}
|
||||
|
|
@ -30,7 +34,3 @@ pub const RequestAdapterCallback = fn (
|
|||
message: ?[*:0]const u8,
|
||||
userdata: *anyopaque,
|
||||
) callconv(.C) void;
|
||||
|
||||
pub const InstanceDescriptor = extern struct {
|
||||
next_in_chain: ?*const ChainedStruct = null,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1221,7 +1221,7 @@ pub fn Export(comptime T: type) type {
|
|||
|
||||
/// A stub gpu.Interface in which every function is implemented by `unreachable;`
|
||||
pub const StubInterface = Interface(struct {
|
||||
pub inline fn createInstance(descriptor: ?*const Instance.Descriptor) ?Instance {
|
||||
pub inline fn createInstance(descriptor: ?*const Instance.Descriptor) ?*Instance {
|
||||
_ = descriptor;
|
||||
unreachable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ pub const RenderPassDescriptor = extern struct {
|
|||
timestamp_writes: ?[*]const RenderPassTimestampWrite = null,
|
||||
};
|
||||
|
||||
pub inline fn createInstance(descriptor: ?*const instance.InstanceDescriptor) ?*instance.Instance {
|
||||
pub inline fn createInstance(descriptor: ?*const instance.Instance.Descriptor) ?*instance.Instance {
|
||||
return interface.Impl.createInstance(descriptor);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue