gpu: rename native -> NativeInstance
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
5656d3252a
commit
9888d8fe36
2 changed files with 20 additions and 7 deletions
|
|
@ -2,12 +2,18 @@
|
||||||
const c = @import("c.zig").c;
|
const c = @import("c.zig").c;
|
||||||
const Interface = @import("Interface.zig");
|
const Interface = @import("Interface.zig");
|
||||||
|
|
||||||
/// Returns a native webgpu.h implementation of the gpu.Interface, wrapping the given WGPUInstance.
|
const NativeInstance = @This();
|
||||||
pub fn native(instance: c.WGPUInstance) Interface {
|
|
||||||
// TODO: implement Interface
|
/// The WGPUInstance that is wrapped by this native instance.
|
||||||
_ = instance;
|
instance: c.WGPUInstance,
|
||||||
|
|
||||||
|
/// Returns the gpu.Interface for interacting with this native instance.
|
||||||
|
pub fn interface(native: NativeInstance) Interface {
|
||||||
|
_ = native;
|
||||||
@panic("not implemented");
|
@panic("not implemented");
|
||||||
|
|
||||||
|
// TODO: implement Interface
|
||||||
|
|
||||||
// TODO: implement Device interface
|
// TODO: implement Device interface
|
||||||
|
|
||||||
// TODO: implement Adapter interface:
|
// TODO: implement Adapter interface:
|
||||||
|
|
@ -18,3 +24,8 @@ pub fn native(instance: c.WGPUInstance) Interface {
|
||||||
// WGPU_EXPORT bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits);
|
// WGPU_EXPORT bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits);
|
||||||
// WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties);
|
// WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Wraps a native WGPUInstance to provide an implementation of the gpu.Interface.
|
||||||
|
pub fn wrap(instance: c.WGPUInstance) NativeInstance {
|
||||||
|
return .{ .instance = instance };
|
||||||
|
}
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
//!
|
//!
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const Interface = @import("Interface.zig");
|
const Interface = @import("Interface.zig");
|
||||||
const native = @import("native.zig").native;
|
const NativeInstance = @import("NativeInstance.zig");
|
||||||
|
|
||||||
const Adapter = @import("Adapter.zig");
|
const Adapter = @import("Adapter.zig");
|
||||||
const Device = @import("Device.zig");
|
const Device = @import("Device.zig");
|
||||||
|
|
@ -26,10 +26,12 @@ const FeatureName = @import("feature_name.zig").FeatureName;
|
||||||
const SupportedLimits = @import("supported_limits.zig").SupportedLimits;
|
const SupportedLimits = @import("supported_limits.zig").SupportedLimits;
|
||||||
|
|
||||||
test "syntax" {
|
test "syntax" {
|
||||||
|
_ = Interface;
|
||||||
|
_ = NativeInstance;
|
||||||
|
|
||||||
_ = Adapter;
|
_ = Adapter;
|
||||||
_ = Device;
|
_ = Device;
|
||||||
_ = Interface;
|
|
||||||
_ = native;
|
|
||||||
_ = FeatureName;
|
_ = FeatureName;
|
||||||
_ = SupportedLimits;
|
_ = SupportedLimits;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue