1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

wgpu: add support for user-level command buffers + viewport clarification (#2230)

* wgpu: add support for user-level command buffers
* updated wgpu demo app
This commit is contained in:
Clement Rey
2022-11-04 09:54:29 +01:00
committed by GitHub
parent 4d1e858a52
commit fcb00723bc
5 changed files with 88 additions and 42 deletions

View File

@@ -135,12 +135,18 @@ impl Custom3d {
// Device and Queue, which can be used, for instance, to update buffers and uniforms before
// rendering.
//
// You can use the main `CommandEncoder` that is passed-in, return an arbitrary number
// of user-defined `CommandBuffer`s, or both.
// The main command buffer, as well as all user-defined ones, will be submitted together
// to the GPU in a single call.
//
// The paint callback is called after prepare and is given access to the render pass, which
// can be used to issue draw commands.
let cb = egui_wgpu::CallbackFn::new()
.prepare(move |device, queue, _encoder, paint_callback_resources| {
let resources: &TriangleRenderResources = paint_callback_resources.get().unwrap();
resources.prepare(device, queue, angle);
Vec::new()
})
.paint(move |_info, render_pass, paint_callback_resources| {
let resources: &TriangleRenderResources = paint_callback_resources.get().unwrap();