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;
|
const use_legacy_api = pl.surface == null;
|
||||||
if (!use_legacy_api) {
|
if (!use_legacy_api) {
|
||||||
pl.swap_chain = params.device.nativeCreateSwapChain(pl.surface, &pl.target_desc);
|
pl.swap_chain = params.device.nativeCreateSwapChain(pl.surface, &pl.target_desc);
|
||||||
} else {
|
} else pl.swap_chain.?.configure(
|
||||||
c.wgpuSwapChainConfigure(
|
pl.swap_chain_format,
|
||||||
@ptrCast(c.WGPUSwapChain, pl.swap_chain.?.ptr),
|
.render_attachment,
|
||||||
@enumToInt(pl.swap_chain_format),
|
pl.target_desc.width,
|
||||||
c.WGPUTextureUsage_RenderAttachment,
|
pl.target_desc.height,
|
||||||
@intCast(u32, pl.target_desc.width),
|
|
||||||
@intCast(u32, pl.target_desc.height),
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
pl.current_desc = pl.target_desc;
|
pl.current_desc = pl.target_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue