Files
aria 993bc0f88f Integrate native Rime and stabilize input, output, and rendering
- Add optional modifier-only Super binding whose tap is cancelled by
  other input, focus changes, grabs, locks, and session teardown.
- Ship the native ferese-rime user service, Rime defaults, installer
  inventory, package dependencies, session environment, and docs.
- Vendor Smithay 8a27023 with the SHM texture-cache format fix and add
  GPU regressions for format changes and resize snapshots.
- Release reused CRTC owners before staging output modes, then restore
  changed outputs before former owners when a transaction fails.
- Wait for resize-capture GPU completion, expand filtered surface
  damage, and preserve IME popup origin under fractional scaling.
- Mark weekends like holidays in both calendar layouts.
2026-10-30 03:13:43 +09:00

62 lines
1.7 KiB
Rust

use drm_fourcc::{DrmFourcc, DrmModifier};
use smithay::backend::{
allocator::{
Allocator, Buffer,
dmabuf::AsDmabuf,
vulkan::{ImageUsageFlags, VulkanAllocator},
},
vulkan::{Instance, PhysicalDevice, version::Version},
};
fn main() {
if let Ok(env_filter) = tracing_subscriber::EnvFilter::try_from_default_env() {
tracing_subscriber::fmt().with_env_filter(env_filter).init();
} else {
tracing_subscriber::fmt().init();
}
println!(
"Available instance extensions: {:?}",
Instance::enumerate_extensions().unwrap().collect::<Vec<_>>()
);
println!();
let instance = Instance::new(Version::VERSION_1_3, None).unwrap();
for (idx, phy) in PhysicalDevice::enumerate(&instance).unwrap().enumerate() {
println!(
"Device #{}: {} v{}, {:?}",
idx,
phy.name(),
phy.api_version(),
phy.driver()
);
}
let physical_device = PhysicalDevice::enumerate(&instance)
.unwrap()
.next()
.expect("No physical devices");
// The allocator should create buffers that are suitable as render targets.
let mut allocator = VulkanAllocator::new(&physical_device, ImageUsageFlags::COLOR_ATTACHMENT).unwrap();
let image = allocator
.create_buffer(100, 200, DrmFourcc::Argb8888, &[DrmModifier::Linear])
.expect("create");
assert_eq!(image.width(), 100);
assert_eq!(image.height(), 200);
let image_dmabuf = image.export().expect("Export dmabuf");
drop(image);
let _image2 = allocator
.create_buffer(200, 200, DrmFourcc::Argb8888, &[DrmModifier::Linear])
.expect("create");
drop(allocator);
drop(image_dmabuf);
}