gpu: add TODOs about unsetting callbacks

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-31 11:00:28 -07:00 committed by Stephen Gutekanst
parent 45b5e4ce23
commit be402d4b6d

View file

@ -67,7 +67,12 @@ pub const Device = opaque {
return Impl.deviceCreateComputePipeline(device, descriptor); return Impl.deviceCreateComputePipeline(device, descriptor);
} }
pub inline fn createComputePipelineAsync(device: *Device, descriptor: *const ComputePipeline.Descriptor, callback: CreateComputePipelineAsyncCallback, userdata: ?*anyopaque) void { pub inline fn createComputePipelineAsync(
device: *Device,
descriptor: *const ComputePipeline.Descriptor,
callback: CreateComputePipelineAsyncCallback,
userdata: ?*anyopaque,
) void {
Impl.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata); Impl.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata);
} }
@ -99,7 +104,12 @@ pub const Device = opaque {
return Impl.deviceCreateRenderPipeline(device, descriptor); return Impl.deviceCreateRenderPipeline(device, descriptor);
} }
pub inline fn createRenderPipelineAsync(device: *Device, descriptor: *const RenderPipeline.Descriptor, callback: CreateRenderPipelineAsyncCallback, userdata: ?*anyopaque) void { pub inline fn createRenderPipelineAsync(
device: *Device,
descriptor: *const RenderPipeline.Descriptor,
callback: CreateRenderPipelineAsyncCallback,
userdata: ?*anyopaque,
) void {
Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata); Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata);
} }
@ -147,7 +157,11 @@ pub const Device = opaque {
Impl.deviceLoseForTesting(device); Impl.deviceLoseForTesting(device);
} }
pub inline fn popErrorScope(device: *Device, callback: ErrorCallback, userdata: ?*anyopaque) bool { pub inline fn popErrorScope(
device: *Device,
callback: ErrorCallback,
userdata: ?*anyopaque,
) bool {
return Impl.devicePopErrorScope(device, callback, userdata); return Impl.devicePopErrorScope(device, callback, userdata);
} }
@ -155,7 +169,12 @@ pub const Device = opaque {
Impl.devicePushErrorScope(device, filter); Impl.devicePushErrorScope(device, filter);
} }
pub inline fn setDeviceLostCallback(device: *Device, callback: Device.LostCallback, userdata: ?*anyopaque) void { // TODO: presumably callback should be nullable for unsetting
pub inline fn setDeviceLostCallback(
device: *Device,
callback: Device.LostCallback,
userdata: ?*anyopaque,
) void {
Impl.deviceSetDeviceLostCallback(device, callback, userdata); Impl.deviceSetDeviceLostCallback(device, callback, userdata);
} }
@ -163,11 +182,21 @@ pub const Device = opaque {
Impl.deviceSetLabel(device, label); Impl.deviceSetLabel(device, label);
} }
pub inline fn setLoggingCallback(device: *Device, callback: LoggingCallback, userdata: ?*anyopaque) void { // TODO: presumably callback should be nullable for unsetting
pub inline fn setLoggingCallback(
device: *Device,
callback: LoggingCallback,
userdata: ?*anyopaque,
) void {
Impl.deviceSetLoggingCallback(device, callback, userdata); Impl.deviceSetLoggingCallback(device, callback, userdata);
} }
pub inline fn setUncapturedErrorCallback(device: *Device, callback: ErrorCallback, userdata: ?*anyopaque) void { // TODO: presumably callback should be nullable for unsetting
pub inline fn setUncapturedErrorCallback(
device: *Device,
callback: ErrorCallback,
userdata: ?*anyopaque,
) void {
Impl.deviceSetUncapturedErrorCallback(device, callback, userdata); Impl.deviceSetUncapturedErrorCallback(device, callback, userdata);
} }