gpu: add RequestDeviceCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
3f3f647b99
commit
cd4021fa56
2 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata);
|
|
||||||
|
|
||||||
// Methods of Adapter
|
// Methods of Adapter
|
||||||
// WGPU_EXPORT bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature);
|
// WGPU_EXPORT bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature);
|
||||||
export fn wgpuAdapterHasFeature(adapter: gpu.Adapter, feature: gpu.FeatureName) bool {
|
export fn wgpuAdapterHasFeature(adapter: gpu.Adapter, feature: gpu.FeatureName) bool {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ const Device = @import("device.zig").Device;
|
||||||
const DeviceDescriptor = @import("device.zig").DeviceDescriptor;
|
const DeviceDescriptor = @import("device.zig").DeviceDescriptor;
|
||||||
const FeatureName = @import("types.zig").FeatureName;
|
const FeatureName = @import("types.zig").FeatureName;
|
||||||
const SupportedLimits = @import("types.zig").SupportedLimits;
|
const SupportedLimits = @import("types.zig").SupportedLimits;
|
||||||
|
const RequestDeviceStatus = @import("types.zig").RequestDeviceStatus;
|
||||||
const impl = @import("interface.zig").impl;
|
const impl = @import("interface.zig").impl;
|
||||||
|
|
||||||
pub const Adapter = *opaque {
|
pub const Adapter = *opaque {
|
||||||
|
|
@ -25,6 +26,13 @@ pub const Adapter = *opaque {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const RequestDeviceCallback = fn (
|
||||||
|
status: RequestDeviceStatus,
|
||||||
|
device: Device,
|
||||||
|
message: [*:0]const u8,
|
||||||
|
userdata: *anyopaque,
|
||||||
|
) callconv(.C) void;
|
||||||
|
|
||||||
pub const AdapterType = enum(u32) {
|
pub const AdapterType = enum(u32) {
|
||||||
discrete_gpu,
|
discrete_gpu,
|
||||||
integrated_gpu,
|
integrated_gpu,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue