Comments (12)
Once textures are supported softrenderer looks also like a useful debugging and fallback graphical backend.
from smithay.
handling resize of the backend surface (when running embedded, as glutin/x11/wayland)
handling modesetting (for the tty backend)
I would suggest, we just don't handle these in the general trait. Instead handle them in the specific backend type.
support opengl-less setups?
I was asking myself if this is possible. Almost every compositor uses gles, is this a requirement? If it is not, I would like to experiment with vulkano
for example in the future.
I was thinking if the GraphicsBackend
should maybe be just a generic output to render on, that is actually implemented by a sub type of the actual backend types.
E.g.
pub trait Output
{
fn render(&mut self, buffer: &[u8], format: FormatEnum);
fn swap(&mut self);
}
pub struct GlutinBackend;
impl GlutinBackend
{
fn create_output(&mut self) -> GlutinOutput;
}
pub struct GlutinOutput(GlutinWindow);
impl Output for GlutinOutput {
/// implementation
}
pub struct DrmBackend<H: DrmHandler>(H);
impl<H: DrmHandler> DrmBackend<H> {
fn new(handler: H) -> DrmBackend<H> {
DrmBackend(handler)
}
}
pub trait DrmHandler
{
//warning we should probably not transfer ownership here, consider this an example
//that every backend may work totally differently
fn output_attached(&mut self, output: DrmOutput);
fn output_detached(&mut self, output DrmOutput);
}
pub struct DrmOutput;
impl Output for DrmOutput
{
// implementation
}
from smithay.
I think it'll be necessary to separate into different traits depending on the rendering kind: cpu rendering vs OpenGL rendering (vs vulkan ?), rather than a single generic Output
trait.
Something along the lines of
trait CpuRender {
fn render(&mut self, buffer: &[u8], format: Format);
}
trait OpenGlRender {
// Direct access to the OpenGL context, the caller is responsible for doing whatever
// they need to draw, swap_buffers, and everything
}
I'm not sure what exactly should go in the OpenGlRender
trait, but as a rule of thumb, I'd say we should at least be able to impl the Backend
trait of glium on top of it:
impl<B: OpenGlRender> glium::backend::Backend for B {
...
}
from smithay.
Thats a totally different idea. I thought we want to hide how the rendering itself works and just pass the buffers into it.
Exposing the rendering framework over the backend and let the user take complete control over the rendering process is also a cool idea.
I think I like you approach better, after all I did criticize wlc for it's abstractions. Do we actually need a rendering trait like this?
from smithay.
Not sure actually, about what traits are needed.
However, my global course of action would be to first define the lowest-possible abstractions, and then if applicable build more high-level abstractions on top of them.
I don't want to reach a point where performance is terrible because the abstractions where badly designed. And for example, if we want to support EGL from clients, the ability to play nice with mesa and pass around drm buffers from the clients directly to our opengl renderer is crutial.
Also, the backend should not make any assumption about what the user draws will look like. After all,a 3D environment is a perfectly valid compositor !
from smithay.
Alright, so maybe we should not start with any GraphicsTrait
, but instead just provide something to render at first and experiment with multiple backends.
from smithay.
Maybe we could indeed just develop the backends, and then try to build a common abstraction over them. It'll probably be a much easier route.
Do you want to start takling the glutin backend? For now I think I'll focus on implementing the missing bits of wayland-server
, and the client-handling part.
from smithay.
Do you want to start takling the glutin backend? For now I think I'll focus on implementing the missing bits of wayland-server, and the client-handling part.
Sure thing. But I would also like to have a Discussion issue on the wayland side, if you already know, what needs to be done. The sooner, I have something to actually render, the easier writing the backends will be, so I will maybe help you with some of the wayland related issues to have something to test with.
from smithay.
You're right, I'll create an issue about that and put in there what I already know.
from smithay.
Just a quick update, I was quite busy the last days with changing my linux distribution on my laptop and some work related stuff, I will probably start with the glutin backend this evening.
from smithay.
Okay, no problem, I'm quite busy these days too to be honest.
from smithay.
Looks like we settled on something. :)
from smithay.
Related Issues (20)
- Missing key release events on winit backend results in permanently pressed modifiers
- wvkbd crashes when touching a key HOT 9
- Possibly wrong window geometry size with wp-viewporter HOT 4
- aa8d87a214 broke pointer input in foot HOT 1
- Stuck in listener.accept
- Add blurred Element support to `OutputDamageTracker`
- Initial commit of an XdgToplevel with a buffer already attached doesn't result in an error
- `DrmDevice::new` with disable_connectors = true causes vrr_capable property to get stuck at 0 HOT 3
- `prop_mapping` cache in `AtomicDrmDevice` doesn't handle connector hotplug
- Cursor and overlay elements overwrite primary plane in `RenderFrameResult::blit_frame_result` HOT 5
- Pasting images from wayland -> x11 truncates/corrupts the image HOT 1
- Reduce cloning around opaque region vectors
- `wlr_layer`'s `pre_commit_hook` can post an error, disconnecting the client, leading to a panic later on in the `commit` handling HOT 5
- Send an event, if Xwayland exits unexpectedly HOT 1
- Crop element causes invalid rendering for buffer transforms 1, 3, 5, 7
- Build error on s390x: src/wayland/shm/pool.rs:311:15 ..mem::zeroed() field `__glibc_reserved0` is private HOT 2
- Niri fails to init display in QEMU, smithay error message HOT 7
- app_id for nested compositors HOT 4
- Pointer surface focus not checked before button press
- `KbdRc` and `SeatRc` are leaked HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smithay.