Revert "WayVR: Vulkano dmabuf attempt"

This reverts commit 45ab38c310.
This commit is contained in:
galister
2025-04-07 07:34:56 +09:00
parent b830c826a0
commit 4cb12a2a01
3 changed files with 21 additions and 69 deletions
+12 -49
View File
@@ -1,8 +1,11 @@
use glam::{vec3a, Affine2, Vec3, Vec3A};
use std::{cell::RefCell, collections::HashMap, rc::Rc, sync::Arc};
use vulkano::{command_buffer::CommandBufferUsage, image::view::ImageView};
use vulkano::{
command_buffer::CommandBufferUsage,
image::{view::ImageView, SubresourceLayout},
};
use wayvr_ipc::packet_server::{self, PacketServer, WvrStateChanged};
use wlx_capture::frame::{DmabufFrame, FrameFormat, FramePlane};
use wlx_capture::frame::{DmabufFrame, FourCC, FrameFormat, FramePlane};
use crate::{
backend::{
@@ -604,66 +607,26 @@ impl WayVRRenderer {
anyhow::bail!("Failed to fetch WayVR display")
};
let drm_formats = &self.graphics.drm_formats;
let mut drm_format = None;
for fmt in drm_formats {
if fmt.fourcc.value == 0x3432_4258
/* XB24 */
{
drm_format = Some(fmt);
log::info!("format fourcc {} mod {:?}", fmt.fourcc.value, fmt.modifiers);
break;
}
}
let Some(drm_format) = drm_format else {
anyhow::bail!("Couldn't find XB24 dmabuf format");
};
let tex = self.graphics.dmabuf_texture(DmabufFrame {
format: FrameFormat {
width: u32::from(disp.width),
height: u32::from(disp.height),
fourcc: drm_format.fourcc,
modifier: drm_format.modifiers[1], /* FIXME !!!!!!!!!!!!!!!!!!!!!!!!!!! */
..Default::default()
},
num_planes: 1,
planes,
})?;
/*let layouts: Vec<SubresourceLayout> = vec![SubresourceLayout {
offset: data.offset as _,
size: 0,
row_pitch: data.stride as _,
array_pitch: None,
depth_pitch: None,
}];
let frame = DmabufFrame {
format: FrameFormat {
width: u32::from(disp.width),
height: u32::from(disp.height),
fourcc: drm_format.fourcc,
modifier: DRM_FORMAT_MOD_INVALID, /* possibly not proper? */
fourcc: FourCC {
value: data.mod_info.fourcc,
},
modifier: data.mod_info.modifiers[0], /* possibly not proper? */
..Default::default()
},
num_planes: 1,
planes,
};
let tex = self.graphics.dmabuf_texture_ex(
frame,
vulkano::image::ImageTiling::DrmFormatModifier,
layouts,
&data.mod_info.modifiers,
)?;*/
drop(wayvr);
let tex = self.graphics.dmabuf_texture(frame)?;
self.vk_image = Some(tex.clone());
self.vk_image_view = Some(vulkano::image::view::ImageView::new_default(tex)?);
self.vk_image_view = Some(vulkano::image::view::ImageView::new_default(tex).unwrap());
Ok(())
}
}