diff --git a/rutabaga_gfx/src/rutabaga_core.rs b/rutabaga_gfx/src/rutabaga_core.rs index 49a70d62d3..9d76068a1d 100644 --- a/rutabaga_gfx/src/rutabaga_core.rs +++ b/rutabaga_gfx/src/rutabaga_core.rs @@ -1305,8 +1305,6 @@ impl RutabagaBuilder { )); } - #[allow(unused_mut)] - let mut fallback_2d = false; if self.default_component != RutabagaComponentType::Rutabaga2D { #[cfg(feature = "virgl_renderer")] if self.default_component == RutabagaComponentType::VirglRenderer { @@ -1323,7 +1321,7 @@ impl RutabagaBuilder { push_capset(RUTABAGA_CAPSET_DRM); } else { log::warn!("error initializing gpu backend=virglrenderer, falling back to 2d."); - fallback_2d = true; + self.default_component = RutabagaComponentType::Rutabaga2D; }; } @@ -1351,7 +1349,7 @@ impl RutabagaBuilder { push_capset(RUTABAGA_CAPSET_CROSS_DOMAIN); } - if self.default_component == RutabagaComponentType::Rutabaga2D || fallback_2d { + if self.default_component == RutabagaComponentType::Rutabaga2D { let rutabaga_2d = Rutabaga2D::init(fence_handler.clone())?; rutabaga_components.insert(RutabagaComponentType::Rutabaga2D, rutabaga_2d); }