Skip to content

[pull] master from libretro:master#981

Merged
pull[bot] merged 6 commits intoAlexandre1er:masterfrom
libretro:master
Apr 30, 2026
Merged

[pull] master from libretro:master#981
pull[bot] merged 6 commits intoAlexandre1er:masterfrom
libretro:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 30, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Drop shadows for XMB icons, text, and thumbnails were force-disabled
in gdi_frame alongside menu_shader_pipeline. The latter is correct --
GDI has no programmable pipeline, so the animated XMB backgrounds
(Ribbon / Snow / Bokeh / etc.) can't run. But shadow draws are just
black-tinted textured quads and tinted glyphs, which the
texture-modulated slow path in gdi_blit_texture_modulated and the
tinted-glyph path in gdi_font_render_line handle correctly: pixels
land as premultiplied black with the shadow alpha, AlphaBlend with
AC_SRC_OVER + AC_SRC_ALPHA composites them as expected.

Carryover from the legacy driver that predated those paths. gl1 has
the same clobber for the same legacy reason; left alone here since
its fixed-function tint behaviour hasn't been verified.
Same fix as 709d462 for GDI. gl1 was clobbering xmb_shadows_enable
alongside menu_shader_pipeline. The latter is correct -- gl1
fixed-function has no programmable pipeline, so the animated XMB
backgrounds (Ribbon / Snow / Bokeh / etc.) can't run. But shadow
draws are just vertex-color-modulated textured quads: the default
GL_MODULATE texture environment with vertex color (0,0,0,a) plus
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) darkens the
destination to dst*(1-a), and the gl1 raster font driver's
drop_x/drop_y path handles text shadows the same way.
Brings the SDL2 video driver to feature parity with the modern menu
drivers (XMB / Ozone / MaterialUI / RGUI) plus widgets, FPS overlay,
Display Statistics, input overlay, and load-content animation.

Previously the SDL2 driver only supported RGUI's software bitmap
path: gfx_display dispatch was wired to no driver, get_overlay_interface
was NULL, set_osd_msg unconditionally went through the legacy bitmap
font, and the video size was never published to video_driver_set_size.
Anything beyond RGUI either silently no-op'd or rendered to the wrong
place against the wrong dimensions.

This adds:

  - gfx_display_ctx_sdl2:
      * blend_begin / blend_end (SDL_RenderSetDrawBlendMode)
      * draw - two paths: a plain-quad path for gfx_display_draw_quad
        callers (vtx == NULL, n == 4) and a vertex-array path for
        slice / 9-patch / per-vertex-color callers.  Both honour the
        canonical gl1_menu_vertexes triangle-strip layout (vertex 0
        = bottom-left in GL bottom-up coords -> bottom-left in SDL
        screen space after Y flip), the top-down tex_coord
        convention from gfx_display.c, draw->scale_factor for XMB
        tab zoom, and draw->rotation for the spinning hourglass
        (rotate corners around centre using cosf/sinf).
      * scissor_begin / scissor_end (SDL_RenderSetClipRect, with the
        bottom-up to top-down flip RA's scissor convention requires).
      * pipeline draws (ribbon / snow / bokeh) are stubbed - SDL's
        high-level renderer doesn't expose custom shaders, so these
        return early and XMB falls back to the static gradient.

  - sdl2_raster_font:
      * FreeType atlas uploaded as ARGB8888 with white-RGB and the
        FreeType alpha (so SDL_SetTextureColorMod tints crisply).
      * render_msg with newline splitting via a render_message
        wrapper that walks '\n' and offsets each segment by one
        line-height (XMB sublabels and Display Statistics depend on
        this).
      * get_glyph / get_message_width / get_line_metrics for upstream
        consumers (font_flush no-ops; bind_block is unused, every
        call goes through immediate-draw).

  - poke->set_osd_msg dispatch:
      * Was the bug masking proper menu/widget text - the original
        driver hardcoded the bitmap OSD font.  Now dispatches to the
        supplied font's render_msg when a font_data_t* is passed,
        falling back to the bitmap font only for the legacy
        font=NULL OSD path.

  - poke->load_texture / unload_texture:
      * Was NULL.  Without it, gfx_white_texture is never registered
        and every plain-quad call has no source texture, so widgets
        and menu items rendered as solid-colour blocks with no
        alpha modulation.

  - get_overlay_interface (input overlay):
      * Six callbacks (enable, load, tex_geom, vertex_geom,
        full_screen, set_alpha) plus a per-frame render path.
      * Coordinate convention: vertex_geom stores values verbatim
        (no y-flip).  SDL_RenderCopy operates in y-down pixel space
        like GDI's AlphaBlend, so the d3d/gl-style flip would be a
        bug here - mirrors gdi_overlay_vertex_geom.

  - Display Statistics overlay:
      * font_driver_init_osd / free_osd to register the SDL2 raster
        font as video_font_driver.  Renders stat_text via
        font_driver_render_msg with osd_stat_params, suppressed
        while the menu is alive (matching gdi/d3d8/d3d9).

  - Frame-loop wiring:
      * menu_driver_frame, gfx_widgets_frame, the stats overlay,
        and the input overlay all need the full-window viewport
        rather than the aspect-corrected game viewport.  Wrapped
        each in SDL_RenderGetViewport / SetViewport / restore so
        the next frame's core blit lands in the right place.

  - video_driver_set_size in sdl_refresh_viewport:
      * Tells the rest of RA the actual window size.  Without it
        video_st->width/height retain core geometry (e.g. 320x240),
        widgets size themselves to that tiny coordinate space, and
        the entire UI ends up drawing into the top-left corner of
        the framebuffer.  Mirrors what vga / gx2 / d3d8 / d3d9
        common do.

  - Settings whitelist (configuration.c:check_menu_driver_compatibility):
      * Added 's' case so XMB / Ozone / MaterialUI no longer get
        rejected when the active video driver is sdl2.

  - sdl2_raster_font registered in:
      * gfx/font_driver.c (FONT_DRIVER_RENDER_SDL2 dispatch)
      * gfx/font_driver.h (extern declaration)
      * gfx/video_defines.h (FONT_DRIVER_RENDER_SDL2 enum)
      * gfx/gfx_display.c / .h (GFX_VIDEO_DRIVER_SDL2 enum +
        gfx_display_ctx_sdl2 entry in the drivers table)

Requires SDL >= 2.0.18 for SDL_RenderGeometry; older SDL keeps the
RGUI-only behaviour via #if SDL_VERSION_ATLEAST guards.

Tested at 4K@120Hz fullscreen, plus all four menu drivers, the
neo-retropad touch overlay, FPS / Display Statistics overlays, and
the load-content animation against d3d9_hlsl as the reference
backend.  Visual output matches d3d9_hlsl pixel-for-pixel except for
the deliberately-stubbed XMB pipeline shaders.
@pull pull Bot locked and limited conversation to collaborators Apr 30, 2026
@pull pull Bot added the ⤵️ pull label Apr 30, 2026
@pull pull Bot merged commit 3fe82fb into Alexandre1er:master Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant