gpu: implement Device.tick
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
789f6291e4
commit
482d5aaa34
2 changed files with 11 additions and 2 deletions
|
|
@ -87,8 +87,7 @@ pub const VTable = struct {
|
|||
// TODO: callback
|
||||
// setUncapturedErrorCallback: fn (ptr: *anyopaque, callback: UncapturedErrorCallback) void,
|
||||
// WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata);
|
||||
// tick: fn (ptr: *anyopaque) void,
|
||||
// WGPU_EXPORT void wgpuDeviceTick(WGPUDevice device);
|
||||
tick: fn (ptr: *anyopaque) void,
|
||||
};
|
||||
|
||||
pub inline fn reference(device: Device) void {
|
||||
|
|
@ -154,6 +153,10 @@ pub inline fn createRenderPipelineAsync(
|
|||
device.vtable.createRenderPipelineAsync(device.ptr, descriptor, callback);
|
||||
}
|
||||
|
||||
pub inline fn tick(device: Device) void {
|
||||
device.vtable.tick(device.ptr);
|
||||
}
|
||||
|
||||
pub const Descriptor = struct {
|
||||
label: ?[*:0]const u8 = null,
|
||||
required_features: ?[]Feature = null,
|
||||
|
|
@ -180,6 +183,7 @@ test {
|
|||
_ = createComputePipelineAsync;
|
||||
_ = createRenderPipeline;
|
||||
_ = createRenderPipelineAsync;
|
||||
_ = tick;
|
||||
_ = Descriptor;
|
||||
_ = LostReason;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -533,6 +533,11 @@ const device_vtable = Device.VTable{
|
|||
);
|
||||
}
|
||||
}).createRenderPipelineAsync,
|
||||
.tick = (struct {
|
||||
pub fn tick(ptr: *anyopaque) void {
|
||||
c.wgpuDeviceTick(@ptrCast(c.WGPUDevice, ptr));
|
||||
}
|
||||
}.tick),
|
||||
};
|
||||
|
||||
inline fn convertComputePipelineDescriptor(descriptor: *const ComputePipeline.Descriptor) c.WGPUComputePipelineDescriptor {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue