aetna_vulkano/lib.rs
1//! Native Vulkan backend for custom Aetna hosts.
2//!
3//! Most applications should implement `aetna_core::App` and run it
4//! through `aetna-winit-wgpu`. Use this crate directly when you are
5//! validating backend parity or embedding Aetna into an existing Vulkan
6//! renderer built on `vulkano`.
7//!
8//! The public entry point is [`Runner`]. Its surface mirrors
9//! `aetna-wgpu::Runner` where the GPU APIs allow it: the host owns the
10//! window, device, queue, swapchain, and event loop; the runner owns
11//! Aetna interaction state, layout/draw-op preparation, Vulkan
12//! pipelines, text atlas images, and icon rendering.
13//!
14//! WGSL remains the shader source language. This backend uses [`naga`]
15//! to compile WGSL to SPIR-V when building pipelines so custom shader
16//! fixtures can be shared with the `wgpu` backend.
17
18mod icon;
19mod image;
20mod instance;
21pub mod naga_compile;
22mod pipeline;
23pub mod runner;
24mod surface;
25mod text;
26
27pub use naga_compile::{CompileError, wgsl_to_spirv};
28pub use runner::{LayoutPrepared, PointerMove, PrepareResult, PrepareTimings, Runner};
29pub use surface::{VulkanoAppTexture, app_texture};
30
31/// Vulkan device features the runner's stock pipelines depend on.
32/// Hosts must merge this with their own required features when calling
33/// `Device::new(..., DeviceCreateInfo { enabled_features, .. })` —
34/// otherwise pipeline construction panics with a SPIR-V validation
35/// error like "uses the SPIR-V capability `SampleRateShading`".
36///
37/// Currently this is just `sample_rate_shading`, used by
38/// `stock::rounded_rect`'s `@interpolate(perspective, sample)` to keep
39/// quad antialiasing one screen-pixel wide under MSAA. Wgpu's
40/// device-creation flow turns this on by default; vulkano's doesn't.
41pub fn required_device_features() -> vulkano::device::DeviceFeatures {
42 vulkano::device::DeviceFeatures {
43 sample_rate_shading: true,
44 ..vulkano::device::DeviceFeatures::empty()
45 }
46}