1
0
Fork 0
forked from wry/wry

autocommit 2022-01-29 00:49:52 CET

This commit is contained in:
Julian Orth 2022-01-29 00:49:52 +01:00
parent b11a36729c
commit 85b019101a
41 changed files with 1322 additions and 61 deletions

View file

@ -40,7 +40,7 @@ impl EglDevice {
}
let mut dpy = EglDisplay {
exts: DisplayExt::empty(),
formats: AHashMap::new(),
formats: Rc::new(AHashMap::new()),
dev: *self,
dpy,
};
@ -68,7 +68,7 @@ impl EglDevice {
if !dpy.exts.intersects(DisplayExt::KHR_SURFACELESS_CONTEXT) {
return Err(RenderError::SurfacelessContext);
}
dpy.formats = query_formats(dpy.dpy)?;
dpy.formats = Rc::new(query_formats(dpy.dpy)?);
Ok(Rc::new(dpy))
}

View file

@ -26,7 +26,7 @@ use std::rc::Rc;
#[derive(Debug, Clone)]
pub struct EglDisplay {
pub exts: DisplayExt,
pub formats: AHashMap<u32, &'static Format>,
pub formats: Rc<AHashMap<u32, &'static Format>>,
pub dev: EglDevice,
pub dpy: EGLDisplay,
}

View file

@ -1,4 +1,4 @@
use crate::drm::drm::Drm;
use crate::drm::drm::{DrmDevice};
use crate::render::egl::device::EglDevice;
use crate::render::egl::sys::{
eglBindAPI, EGLAttrib, EGLLabelKHR, EGLenum, EGLint, EGL_DEBUG_MSG_CRITICAL_KHR,
@ -63,8 +63,7 @@ pub fn init() -> Result<(), RenderError> {
Ok(())
}
pub fn find_drm_device(drm: &Drm) -> Result<Option<EglDevice>, RenderError> {
let drm_dev = drm.get_device()?;
pub fn find_drm_device(drm_dev: &DrmDevice) -> Result<Option<EglDevice>, RenderError> {
for device in query_devices()? {
if device.exts.contains(DeviceExt::EXT_DEVICE_DRM) {
let device_file = device.query_string(EGL_DRM_DEVICE_FILE_EXT)?;

View file

@ -3,6 +3,7 @@ use uapi::c;
pub type EGLint = i32;
pub type EGLenum = c::c_uint;
pub type EGLBoolean = c::c_uint;
#[allow(dead_code)]
pub type EGLuint64KHR = u64;
pub type EGLAttrib = isize;