gpu: example: use SwapChain.configure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
ef3eed7afb
commit
1315c6eb53
1 changed files with 6 additions and 9 deletions
|
|
@ -182,15 +182,12 @@ fn frame(params: FrameParams) !void {
|
|||
const use_legacy_api = pl.surface == null;
|
||||
if (!use_legacy_api) {
|
||||
pl.swap_chain = params.device.nativeCreateSwapChain(pl.surface, &pl.target_desc);
|
||||
} else {
|
||||
c.wgpuSwapChainConfigure(
|
||||
@ptrCast(c.WGPUSwapChain, pl.swap_chain.?.ptr),
|
||||
@enumToInt(pl.swap_chain_format),
|
||||
c.WGPUTextureUsage_RenderAttachment,
|
||||
@intCast(u32, pl.target_desc.width),
|
||||
@intCast(u32, pl.target_desc.height),
|
||||
} else pl.swap_chain.?.configure(
|
||||
pl.swap_chain_format,
|
||||
.render_attachment,
|
||||
pl.target_desc.width,
|
||||
pl.target_desc.height,
|
||||
);
|
||||
}
|
||||
pl.current_desc = pl.target_desc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue