gl: Fixes for asahi linux

This commit is contained in:
kd-11 2024-07-31 03:36:08 +03:00 committed by kd-11
parent 7884bcc21d
commit f64c912d02
9 changed files with 43 additions and 6 deletions

View file

@ -11,9 +11,11 @@ gl_gs_frame::gl_gs_frame(QScreen* screen, const QRect& geometry, const QIcon& ap
{
setSurfaceType(QSurface::OpenGLSurface);
m_format.setRenderableType(QSurfaceFormat::OpenGL);
m_format.setMajorVersion(4);
m_format.setMinorVersion(3);
m_format.setProfile(QSurfaceFormat::CoreProfile);
m_format.setAlphaBufferSize(0);
m_format.setDepthBufferSize(0);
m_format.setSwapBehavior(QSurfaceFormat::SwapBehavior::DoubleBuffer);
if (g_cfg.video.debug_output)

View file

@ -113,8 +113,14 @@ gs_frame::gs_frame(QScreen* screen, const QRect& geometry, const QIcon& appIcon,
setScreen(screen);
setGeometry(geometry);
setTitle(qstr(m_window_title));
setVisibility(startup_visibility);
create();
if (g_cfg.video.renderer != video_renderer::opengl)
{
// Do not display the window before OpenGL is configured!
// This works fine in windows and X11 but wayland-egl will crash later.
setVisibility(startup_visibility);
create();
}
// TODO: enable in Qt6
//m_shortcut_handler = new shortcut_handler(gui::shortcuts::shortcut_handler_id::game_window, this, m_gui_settings);
@ -1216,3 +1222,8 @@ void gs_frame::progress_set_limit(int limit)
{
m_progress_indicator->set_range(0, limit);
}
bool gs_frame::has_alpha()
{
return format().hasAlpha();
}

View file

@ -89,6 +89,7 @@ protected:
void flip(draw_context_t context, bool skip_frame = false) override;
int client_width() override;
int client_height() override;
bool has_alpha() override;
bool event(QEvent* ev) override;