gpu: implement Device.pushErrorScope
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
311f2967a5
commit
ec59471765
2 changed files with 13 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
|||
//! https://gpuweb.github.io/gpuweb/#gpuadapter
|
||||
const Feature = @import("enums.zig").Feature;
|
||||
const ErrorType = @import("enums.zig").ErrorType;
|
||||
const ErrorFilter = @import("enums.zig").ErrorFilter;
|
||||
const Limits = @import("data.zig").Limits;
|
||||
const Queue = @import("Queue.zig");
|
||||
const ShaderModule = @import("ShaderModule.zig");
|
||||
|
|
@ -74,8 +75,7 @@ pub const VTable = struct {
|
|||
// TODO: callback
|
||||
// popErrorScope: fn (ptr: *anyopaque, callback: ErrorCallback) bool,
|
||||
// WGPU_EXPORT bool wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata);
|
||||
// pushErrorScope: fn (ptr: *anyopaque, filter: ErrorFilter) void,
|
||||
// WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter);
|
||||
pushErrorScope: fn (ptr: *anyopaque, filter: ErrorFilter) void,
|
||||
// TODO: callback
|
||||
// setDeviceLostCallback: fn (ptr: *anyopaque, callback: DeviceLostCallback) void,
|
||||
// WGPU_EXPORT void wgpuDeviceSetDeviceLostCallback(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata);
|
||||
|
|
@ -108,6 +108,10 @@ pub inline fn loseForTesting(device: Device) void {
|
|||
device.vtable.loseForTesting(device.ptr);
|
||||
}
|
||||
|
||||
pub inline fn pushErrorScope(device: Device, filter: ErrorFilter) void {
|
||||
device.vtable.pushErrorScope(device.ptr, filter);
|
||||
}
|
||||
|
||||
pub inline fn createBindGroup(device: Device, descriptor: *const BindGroup.Descriptor) BindGroup {
|
||||
return device.vtable.createBindGroup(device.ptr, descriptor);
|
||||
}
|
||||
|
|
@ -214,6 +218,7 @@ test {
|
|||
_ = injectError;
|
||||
_ = loseForTesting;
|
||||
_ = createBindGroup;
|
||||
_ = pushErrorScope;
|
||||
_ = createBindGroupLayout;
|
||||
_ = createSampler;
|
||||
_ = createShaderModule;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ const ComputePipeline = @import("ComputePipeline.zig");
|
|||
const PresentMode = @import("enums.zig").PresentMode;
|
||||
const IndexFormat = @import("enums.zig").IndexFormat;
|
||||
const ErrorType = @import("enums.zig").ErrorType;
|
||||
const ErrorFilter = @import("enums.zig").ErrorFilter;
|
||||
|
||||
const ImageCopyBuffer = @import("structs.zig").ImageCopyBuffer;
|
||||
const ImageCopyTexture = @import("structs.zig").ImageCopyTexture;
|
||||
|
|
@ -376,6 +377,11 @@ const device_vtable = Device.VTable{
|
|||
return wrapBindGroup(c.wgpuDeviceCreateBindGroup(@ptrCast(c.WGPUDevice, ptr), &desc));
|
||||
}
|
||||
}).createBindGroup,
|
||||
.pushErrorScope = (struct {
|
||||
pub fn pushErrorScope(ptr: *anyopaque, filter: ErrorFilter) void {
|
||||
c.wgpuDevicePushErrorScope(@ptrCast(c.WGPUDevice, ptr), @enumToInt(filter));
|
||||
}
|
||||
}).pushErrorScope,
|
||||
.createBindGroupLayout = (struct {
|
||||
pub fn createBindGroupLayout(ptr: *anyopaque, descriptor: *const BindGroupLayout.Descriptor) BindGroupLayout {
|
||||
const desc = c.WGPUBindGroupLayoutDescriptor{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue