Skip to content

[Core][P1] BeetlePSX: fix video output via native libretro HW render path #2637

@github-actions

Description

@github-actions

Problem

BeetlePSX (Mednafen PSX libretro core with hardware upscaling) builds and loads in Provenance. Audio plays. However, video output is broken when running via the native libretro bridge. BeetlePSX can use either OpenGL ES or Vulkan for hardware rendering.

Part of the native libretro frontend epic and #2624.

Background

BeetlePSX offers two hardware renderers:

  • OpenGL ES (default on mobile) -- easier integration, uses GLES3 FBO path
  • Vulkan -- higher quality, requires MoltenVK surface integration

For the first working milestone, the GL ES path should be targeted. Vulkan support can follow once the Vulkan/MoltenVK ticket is complete.

Root Cause

Same as Flycast: RETRO_ENVIRONMENT_SET_HW_RENDER is handled by creating an EAGLContext, but rendered frames are never delivered to the Metal display pipeline.

Additionally, BeetlePSX may require:

  • RETRO_ENVIRONMENT_SET_HW_SHARED_CONTEXT for async GPU work
  • RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER to select GLES3 vs Vulkan

Blocked By

  • OpenGL ES FBO -> Metal texture blit pipeline
  • Thread-safe GL context lifecycle + retro_run frame loop
  • Complete environment callback coverage (for preferred HW render + shared context)

For Vulkan path:

  • Vulkan/MoltenVK -> CAMetalLayer integration

Testing

BeetlePSX test cases:

  • Any PS1 game (SCPH-1001 BIOS required)
  • Hardware renderer shows upscaled geometry vs software mode
  • Compare video quality to Mednafen/RetroArch PSX path

Acceptance Criteria

  • BeetlePSX (GL ES renderer) displays video on physical iOS device
  • Resolution upscaling option works (2x, 4x internal resolution)
  • No regression: RetroArch-wrapped BeetlePSX path still works
  • Vulkan path tracked separately in the Vulkan/MoltenVK ticket

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1audiosound or music relatedblockerblocks a releasecore: Mednafenisolated to PSX, Lynx, NEC, WS, SNK, VB core: Mednafen (unless paired)graphicsgraphics, artwork, visuals only (no code)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions