Make shader_f16 optional because it does not work in webgl
This commit is contained in:
parent
251254ad51
commit
346faf2e79
1 changed files with 8 additions and 1 deletions
|
|
@ -295,6 +295,13 @@ impl Compositor {
|
|||
..limits
|
||||
});
|
||||
|
||||
// Request SHADER_F16 only if the adapter supports it (e.g., not available in WebGL2)
|
||||
let required_features = if adapter.features().contains(wgpu::Features::SHADER_F16) {
|
||||
wgpu::Features::SHADER_F16
|
||||
} else {
|
||||
wgpu::Features::empty()
|
||||
};
|
||||
|
||||
let mut errors = Vec::new();
|
||||
|
||||
for required_limits in limits {
|
||||
|
|
@ -303,7 +310,7 @@ impl Compositor {
|
|||
label: Some(
|
||||
"iced_wgpu::window::compositor device descriptor",
|
||||
),
|
||||
required_features: wgpu::Features::SHADER_F16,
|
||||
required_features,
|
||||
required_limits: required_limits.clone(),
|
||||
memory_hints: wgpu::MemoryHints::MemoryUsage,
|
||||
trace: wgpu::Trace::Off,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue