1
0
Fork 0
forked from wry/wry

render: implement a vulkan renderer

This commit is contained in:
Julian Orth 2024-02-03 15:19:20 +01:00
parent 4ba8550da8
commit cf332e8436
66 changed files with 4287 additions and 239 deletions

View file

@ -35,6 +35,7 @@ use {
},
},
ahash::AHashMap,
jay_config::video::GfxApi,
std::{
cell::{Cell, RefCell},
ops::Deref,
@ -169,16 +170,17 @@ impl UsrJayRenderCtxOwner for PortalDisplay {
}
if self.render_ctx.get().is_none() {
let drm = Drm::open_existing(fd);
let ctx = match create_gfx_context(&drm) {
Ok(c) => c,
Err(e) => {
log::error!(
"Could not create render context from drm device: {}",
ErrorFmt(e)
);
return;
}
};
let ctx =
match create_gfx_context(&self.state.eng, &self.state.ring, &drm, GfxApi::OpenGl) {
Ok(c) => c,
Err(e) => {
log::error!(
"Could not create render context from drm device: {}",
ErrorFmt(e)
);
return;
}
};
let ctx = Rc::new(PortalRenderCtx { dev_id, ctx });
self.render_ctx.set(Some(ctx.clone()));
self.state.render_ctxs.set(dev_id, Rc::downgrade(&ctx));

View file

@ -218,7 +218,6 @@ impl GuiElement for Button {
&tex.texture,
tx.round() as _,
ty.round() as _,
ARGB8888,
None,
None,
r.scale(),
@ -321,7 +320,6 @@ impl GuiElement for Label {
&tex.texture,
tx.round() as _,
ty.round() as _,
ARGB8888,
None,
None,
r.scale(),