gpu: add Adapter.reference
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
6d954555fb
commit
6a3e011809
3 changed files with 14 additions and 12 deletions
|
|
@ -1,14 +1,3 @@
|
||||||
// WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter);
|
|
||||||
export fn wgpuAdapterReference(adapter: gpu.Adapter) void {
|
|
||||||
impl.adapterReference(adapter);
|
|
||||||
}
|
|
||||||
pub inline fn adapterReference(adapter: gpu.Adapter) void {
|
|
||||||
_ = adapter;
|
|
||||||
}
|
|
||||||
pub inline fn reference(adapter: Adapter) void {
|
|
||||||
impl.adapterReference(adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
// WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter);
|
// WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter);
|
||||||
export fn wgpuAdapterRelease(adapter: gpu.Adapter) void {
|
export fn wgpuAdapterRelease(adapter: gpu.Adapter) void {
|
||||||
impl.adapterRelease(adapter);
|
impl.adapterRelease(adapter);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ pub const Adapter = *opaque {
|
||||||
pub inline fn requestDevice(adapter: Adapter, descriptor: ?*const DeviceDescriptor, callback: RequestDeviceCallback, userdata: *anyopaque) void {
|
pub inline fn requestDevice(adapter: Adapter, descriptor: ?*const DeviceDescriptor, callback: RequestDeviceCallback, userdata: *anyopaque) void {
|
||||||
impl.adapterRequestDevice(adapter, descriptor, callback, userdata);
|
impl.adapterRequestDevice(adapter, descriptor, callback, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn reference(adapter: Adapter) void {
|
||||||
|
impl.adapterReference(adapter);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const RequestDeviceCallback = fn (
|
pub const RequestDeviceCallback = fn (
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ pub fn Interface(comptime Impl: type) type {
|
||||||
assertDecl(Impl, "adapterGetProperties", fn (adapter: gpu.Adapter, properties: *gpu.AdapterProperties) callconv(.Inline) void);
|
assertDecl(Impl, "adapterGetProperties", fn (adapter: gpu.Adapter, properties: *gpu.AdapterProperties) callconv(.Inline) void);
|
||||||
assertDecl(Impl, "adapterHasFeature", fn (adapter: gpu.Adapter, feature: gpu.FeatureName) callconv(.Inline) bool);
|
assertDecl(Impl, "adapterHasFeature", fn (adapter: gpu.Adapter, feature: gpu.FeatureName) callconv(.Inline) bool);
|
||||||
assertDecl(Impl, "adapterRequestDevice", fn (adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) callconv(.Inline) void);
|
assertDecl(Impl, "adapterRequestDevice", fn (adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) callconv(.Inline) void);
|
||||||
// assertDecl(Impl, "adapterReference", fn (adapter: gpu.Adapter) callconv(.Inline) void);
|
assertDecl(Impl, "adapterReference", fn (adapter: gpu.Adapter) callconv(.Inline) void);
|
||||||
// assertDecl(Impl, "adapterRelease", fn (adapter: gpu.Adapter) callconv(.Inline) void);
|
// assertDecl(Impl, "adapterRelease", fn (adapter: gpu.Adapter) callconv(.Inline) void);
|
||||||
// assertDecl(Impl, "bindGroupSetLabel", fn (bind_group: gpu.BindGroup, label: [*:0]const u8) callconv(.Inline) void);
|
// assertDecl(Impl, "bindGroupSetLabel", fn (bind_group: gpu.BindGroup, label: [*:0]const u8) callconv(.Inline) void);
|
||||||
// assertDecl(Impl, "bindGroupReference", fn (bind_group: gpu.BindGroup) callconv(.Inline) void);
|
// assertDecl(Impl, "bindGroupReference", fn (bind_group: gpu.BindGroup) callconv(.Inline) void);
|
||||||
|
|
@ -271,6 +271,11 @@ pub fn Export(comptime Impl: type) type {
|
||||||
export fn wgpuAdapterRequestDevice(adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) void {
|
export fn wgpuAdapterRequestDevice(adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) void {
|
||||||
Impl.adapterRequestDevice(adapter, descriptor, callback, userdata);
|
Impl.adapterRequestDevice(adapter, descriptor, callback, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter);
|
||||||
|
export fn wgpuAdapterReference(adapter: gpu.Adapter) void {
|
||||||
|
Impl.adapterReference(adapter);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -322,6 +327,10 @@ pub const NullInterface = Interface(struct {
|
||||||
_ = callback;
|
_ = callback;
|
||||||
_ = userdata;
|
_ = userdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn adapterReference(adapter: gpu.Adapter) void {
|
||||||
|
_ = adapter;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test "null" {
|
test "null" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue