do not require ext_image_drm_format_modifier

This commit is contained in:
galister
2024-06-05 20:13:47 +09:00
parent 3a3cda7a45
commit 7641a662dc
2 changed files with 26 additions and 11 deletions

View File

@@ -46,8 +46,7 @@ use crate::{
},
config::{def_pw_tokens, PwTokenMap},
graphics::{
fourcc_to_vk, WlxCommandBuffer, WlxPipeline, WlxPipelineLegacy, DMA_BUF_SUPPORTED,
DRM_FORMAT_MOD_INVALID,
fourcc_to_vk, WlxCommandBuffer, WlxPipeline, WlxPipelineLegacy, DRM_FORMAT_MOD_INVALID,
},
hid::{MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT},
state::{AppSession, AppState, ScreenMeta},
@@ -365,10 +364,18 @@ impl OverlayRenderer for ScreenRenderer {
}
fn render(&mut self, app: &mut AppState) -> anyhow::Result<()> {
if !self.capture.is_ready() {
let supports_dmabuf = DMA_BUF_SUPPORTED && self.capture.supports_dmbuf();
let supports_dmabuf = app
.graphics
.device
.enabled_extensions()
.ext_external_memory_dma_buf
&& self.capture.supports_dmbuf();
let allow_dmabuf = &*app.session.config.capture_method != "pw_fallback"
&& &*app.session.config.capture_method != "screencopy";
let capture_method = app.session.config.capture_method.clone();
let drm_formats = DRM_FORMATS.get_or_init({
let graphics = app.graphics.clone();
move || {
@@ -377,7 +384,7 @@ impl OverlayRenderer for ScreenRenderer {
return vec![];
}
if !allow_dmabuf {
log::info!("Not using DMA-buf capture due to pw_fallback");
log::info!("Not using DMA-buf capture due to {}", capture_method);
return vec![];
}
log::warn!("Using DMA-buf capture. If screens are blank for you, switch to SHM using:");