gpu: Changes needed for latest Dawn (generated-2022-04-18).
This commit is contained in:
parent
b2ac779180
commit
bd28946397
4 changed files with 20 additions and 4 deletions
|
|
@ -249,6 +249,7 @@ pub const Descriptor = struct {
|
||||||
label: ?[*:0]const u8 = null,
|
label: ?[*:0]const u8 = null,
|
||||||
required_features: ?[]Feature = null,
|
required_features: ?[]Feature = null,
|
||||||
required_limits: ?Limits = null,
|
required_limits: ?Limits = null,
|
||||||
|
default_queue: ?Queue.Descriptor = null,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const LostReason = enum(u32) {
|
pub const LostReason = enum(u32) {
|
||||||
|
|
|
||||||
|
|
@ -280,6 +280,7 @@ const adapter_vtable = Adapter.VTable{
|
||||||
.requiredFeaturesCount = if (descriptor.required_features) |f| @intCast(u32, f.len) else 0,
|
.requiredFeaturesCount = if (descriptor.required_features) |f| @intCast(u32, f.len) else 0,
|
||||||
.requiredFeatures = if (descriptor.required_features) |f| @ptrCast([*]const c_uint, f.ptr) else null,
|
.requiredFeatures = if (descriptor.required_features) |f| @ptrCast([*]const c_uint, f.ptr) else null,
|
||||||
.requiredLimits = if (required_limits) |*l| l else null,
|
.requiredLimits = if (required_limits) |*l| l else null,
|
||||||
|
.defaultQueue = if (descriptor.default_queue) |q| .{ .nextInChain = null, .label = q.label } else .{ .nextInChain = null, .label = null },
|
||||||
};
|
};
|
||||||
|
|
||||||
const cCallback = (struct {
|
const cCallback = (struct {
|
||||||
|
|
@ -520,10 +521,19 @@ const device_vtable = Device.VTable{
|
||||||
}).nativeCreateSwapChain,
|
}).nativeCreateSwapChain,
|
||||||
.createTexture = (struct {
|
.createTexture = (struct {
|
||||||
pub fn createTexture(ptr: *anyopaque, descriptor: *const Texture.Descriptor) Texture {
|
pub fn createTexture(ptr: *anyopaque, descriptor: *const Texture.Descriptor) Texture {
|
||||||
return wrapTexture(c.wgpuDeviceCreateTexture(
|
const desc = c.WGPUTextureDescriptor{
|
||||||
@ptrCast(c.WGPUDevice, ptr),
|
.nextInChain = null,
|
||||||
@ptrCast(*const c.WGPUTextureDescriptor, descriptor),
|
.label = if (descriptor.label) |l| l else null,
|
||||||
));
|
.usage = @bitCast(u32, descriptor.usage),
|
||||||
|
.dimension = @enumToInt(descriptor.dimension),
|
||||||
|
.size = @bitCast(c.WGPUExtent3D, descriptor.size),
|
||||||
|
.format = @enumToInt(descriptor.format),
|
||||||
|
.mipLevelCount = descriptor.mip_level_count,
|
||||||
|
.sampleCount = descriptor.sample_count,
|
||||||
|
.viewFormatCount = if (descriptor.view_formats) |vf| @intCast(u32, vf.len) else 0,
|
||||||
|
.viewFormats = if (descriptor.view_formats) |vf| @ptrCast([*]const c.WGPUTextureFormat, vf.ptr) else null,
|
||||||
|
};
|
||||||
|
return wrapTexture(c.wgpuDeviceCreateTexture(@ptrCast(c.WGPUDevice, ptr), &desc));
|
||||||
}
|
}
|
||||||
}).createTexture,
|
}).createTexture,
|
||||||
.destroy = (struct {
|
.destroy = (struct {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,10 @@ pub const WorkDoneCallback = struct {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const Descriptor = struct {
|
||||||
|
label: ?[*:0]const u8 = null,
|
||||||
|
};
|
||||||
|
|
||||||
pub const WorkDoneStatus = enum(u32) {
|
pub const WorkDoneStatus = enum(u32) {
|
||||||
Success = 0x00000000,
|
Success = 0x00000000,
|
||||||
Error = 0x00000001,
|
Error = 0x00000001,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ pub const Descriptor = struct {
|
||||||
format: Format,
|
format: Format,
|
||||||
mip_level_count: u32,
|
mip_level_count: u32,
|
||||||
sample_count: u32,
|
sample_count: u32,
|
||||||
|
view_formats: ?[]const Format = null,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Usage = packed struct {
|
pub const Usage = packed struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue