Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
vulkan-window
example toskia-safe/examples
, complementing the existing windowing examples for OpenGL, Metal, and D3D. It's admittedly pretty bulky by comparison, but perhaps unavoidably so given how many low-level pieces Vulkan requires you to configure before getting started.The approach taken here is a mixture of the Vulkano triangle demo, @pragmatrix's Emergent renderer, and the excellent Skulpin crate (which the maintainer has sadly moved on from at this point). Most of the comments from the triangle demo have been left in place to explain the voluminous setup boilerplate, but could be stripped out or condensed to make the code less of a wall-of-text.
One thing that I'm too much of a Vulkan neophyte to figure out is how to combine what is (I think?) currently a 2-pass rendering process into one. At the moment, the DirectContext does its rasterization, hands the resulting bitmap back to the cpu, then sends it back to the gpu through the swapchain. But I get the impression that Skulpin's texture shader-based approach was able to have skia's output go directly to the framebuffer?