gpu: convert Texture.Usage to packed struct

This commit is contained in:
Silver 2022-04-07 03:25:58 +01:00 committed by Stephen Gutekanst
parent adf5332969
commit 614322edc7
4 changed files with 35 additions and 14 deletions

View file

@ -504,7 +504,7 @@ const device_vtable = Device.VTable{
const desc = c.WGPUSwapChainDescriptor{
.nextInChain = null,
.label = if (descriptor.label) |l| l else null,
.usage = @enumToInt(descriptor.usage),
.usage = @bitCast(u32, descriptor.usage),
.format = @enumToInt(descriptor.format),
.width = descriptor.width,
.height = descriptor.height,
@ -1017,7 +1017,7 @@ const swap_chain_vtable = SwapChain.VTable{
c.wgpuSwapChainConfigure(
@ptrCast(c.WGPUSwapChain, ptr),
@enumToInt(format),
@enumToInt(allowed_usage),
@bitCast(u32, allowed_usage),
width,
height,
);