gpu: use Queue.submit in example

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-08 00:57:33 -07:00 committed by Stephen Gutekanst
parent bf93ae0f81
commit 6e175ba0f3

View file

@ -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);