gpu: use Queue.submit in example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
bf93ae0f81
commit
6e175ba0f3
1 changed files with 3 additions and 2 deletions
|
|
@ -225,10 +225,11 @@ fn frame(params: FrameParams) !void {
|
||||||
c.wgpuRenderPassEncoderEnd(pass);
|
c.wgpuRenderPassEncoderEnd(pass);
|
||||||
c.wgpuRenderPassEncoderRelease(pass);
|
c.wgpuRenderPassEncoderRelease(pass);
|
||||||
|
|
||||||
const commands = c.wgpuCommandEncoderFinish(encoder, null);
|
var commands = c.wgpuCommandEncoderFinish(encoder, null);
|
||||||
c.wgpuCommandEncoderRelease(encoder);
|
c.wgpuCommandEncoderRelease(encoder);
|
||||||
|
|
||||||
c.wgpuQueueSubmit(@ptrCast(c.WGPUQueue, params.queue.ptr), 1, &commands);
|
const buf = gpu.CommandBuffer{ .ptr = &commands, .vtable = undefined };
|
||||||
|
params.queue.submit(1, &buf);
|
||||||
c.wgpuCommandBufferRelease(commands);
|
c.wgpuCommandBufferRelease(commands);
|
||||||
c.wgpuSwapChainPresent(pl.swap_chain.?);
|
c.wgpuSwapChainPresent(pl.swap_chain.?);
|
||||||
c.wgpuTextureViewRelease(back_buffer_view);
|
c.wgpuTextureViewRelease(back_buffer_view);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue