lapce / floem

A native Rust UI library with fine-grained reactivity
https://lap.dev/floem/
MIT License
3.06k stars 133 forks source link

GPU texture override #687

Open jrmoulton opened 1 week ago

jrmoulton commented 1 week ago

Vello has support for overriding an image with a WGPU texture as a method of rendering a texture directly in scene.

I think we can do something simliar in vger.

To implement this I think we can just add a method to the Render trait called override_image that matches the vello::Renderer::overide_image and then leave it up to implementers of View to handle creating the image and calling the override.

@alexthegoodman

alexthegoodman commented 1 week ago

@jrmoulton I think it'd be a great add. Although my wgpu integration was a bit more involved than rendering only a texture, I should say. I'm not sure how commonplace it is for people to want to integrate with the wgpu Surface, Frame, Resolve Frame, etc. but that's what my projects required.

alexthegoodman commented 1 week ago

@jrmoulton I also had to re-pipe the GPU Resources through to pass into my app, so I had access to Device and Queue.