Log available formats and alpha modes in wgpu:🪟:compositor
This commit is contained in:
parent
81bed94148
commit
8a8c1ab2c8
3 changed files with 14 additions and 4 deletions
|
|
@ -5,4 +5,7 @@ edition = "2021"
|
|||
publish = false
|
||||
|
||||
[dependencies]
|
||||
iced = { path = "../.." }
|
||||
iced.workspace = true
|
||||
iced.features = ["debug"]
|
||||
|
||||
tracing-subscriber = "0.3"
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ use iced::{
|
|||
};
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
Gradient::run(Settings {
|
||||
window: window::Settings {
|
||||
transparent: true,
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ impl Compositor {
|
|||
|
||||
let mut formats = capabilities.formats.iter().copied();
|
||||
|
||||
log::info!("Available formats: {formats:#?}");
|
||||
|
||||
let format = if color::GAMMA_CORRECTION {
|
||||
formats.find(wgpu::TextureFormat::is_srgb)
|
||||
} else {
|
||||
|
|
@ -80,12 +82,15 @@ impl Compositor {
|
|||
capabilities.formats.first().copied()
|
||||
});
|
||||
|
||||
let alphas = capabilities.alpha_modes;
|
||||
let preferred_alpha = if alphas
|
||||
let alpha_modes = capabilities.alpha_modes;
|
||||
|
||||
log::info!("Available alpha modes: {alpha_modes:#?}");
|
||||
|
||||
let preferred_alpha = if alpha_modes
|
||||
.contains(&wgpu::CompositeAlphaMode::PostMultiplied)
|
||||
{
|
||||
wgpu::CompositeAlphaMode::PostMultiplied
|
||||
} else if alphas
|
||||
} else if alpha_modes
|
||||
.contains(&wgpu::CompositeAlphaMode::PreMultiplied)
|
||||
{
|
||||
wgpu::CompositeAlphaMode::PreMultiplied
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue