[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 15/18] ui/sdl: try to instantiate the matching opengl rend
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH v2 15/18] ui/sdl: try to instantiate the matching opengl renderer |
Date: |
Mon, 13 Mar 2023 13:42:55 +0400 |
Hi
On Fri, Mar 10, 2023 at 2:03 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Tue, Mar 07, 2023 at 03:56:34PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > User can still bypass the QEMU choice with SDL_RENDER_DRIVER environment
> > variable. (for some reason, specifying a driver disables batching and
> > breaks rendering, so enable it explicitly)
>
> What problem is this change actually fixing ? Can you explain here.
Simply that -display sdl,gl=es didn't actually use OpenGL ES without this.
Using OpenGL ES allows to use ANGLE, which works generally better than
Windows/OEM OpenGL.
>
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> > ui/sdl2.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/ui/sdl2.c b/ui/sdl2.c
> > index 592eca3e1c..e83ea53628 100644
> > --- a/ui/sdl2.c
> > +++ b/ui/sdl2.c
> > @@ -99,7 +99,18 @@ void sdl2_window_create(struct sdl2_console *scon)
> > surface_width(scon->surface),
> > surface_height(scon->surface),
> > flags);
> > + if (scon->opengl) {
> > + const char *driver = "opengl";
> > +
> > + if (scon->opts->gl == DISPLAYGL_MODE_ES) {
> > + driver = "opengles2";
> > + }
> > +
> > + SDL_SetHint(SDL_HINT_RENDER_DRIVER, driver);
> > + SDL_SetHint(SDL_HINT_RENDER_BATCHING, "1");
> > + }
> > scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0);
> > +
> > if (scon->opengl) {
> > scon->winctx = SDL_GL_CreateContext(scon->real_window);
> > }
> > --
> > 2.39.2
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>
>
--
Marc-André Lureau
- [PATCH v2 13/18] ui/egl: print EGL error, helping debugging, (continued)
- [PATCH v2 12/18] ui/shader: fix #version directive must occur on first line, marcandre . lureau, 2023/03/07
- [PATCH v2 15/18] ui/sdl: try to instantiate the matching opengl renderer, marcandre . lureau, 2023/03/07
- [PATCH v2 16/18] ui: introduce egl_init(), marcandre . lureau, 2023/03/07
- [PATCH v2 17/18] ui/dbus: do not require opengl & gbm, marcandre . lureau, 2023/03/07
- [PATCH v2 18/18] ui/dbus: restrict opengl to gbm-enabled config, marcandre . lureau, 2023/03/07
- Re: [PATCH v2 00/18] ui: dbus & misc fixes, Marc-André Lureau, 2023/03/09