libretro / libretro/RetroArch

[Vulkan] VkInstance/VkDevice are cached rather than destroyed on content close, leaving external layers (OBS vkcapture) attached to a dead swapchain

Open
#18,752 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Is there an existing issue for this?
  • This is a bug in RetroArch frontend
  • I have searched the existing issues
Description

Not sure if this is a core issue or issue with Retroarch itself, but the vulkan layers seem to live on even after exiting the app and not being released. That leads into a situation where with game capture on Linux when exiting the game leads to frozen image in game capture.

The new vulkan layers when starting a game won't get captured because the old one is still on and not released.
Not really sure if it is the cores responsibility or Retroarch responsibility to kill off the vulkan layer.

Expected behavior

The vulkan layer would be released properly and a new one spawned so that the capturing of it works automatically.

Steps to reproduce the bug
  1. Have Linux vkcapture installed with OBS.
  2. Set the OBS_VKCAPTURE=1 env variable to Retroarch.
  3. Look in OBS with the game capture source.
  4. Start Retroarch with glcore renderer.
  5. Have lets say PS1 emulator have it's renderer in Vulkan.
  6. Start PS1 emulator game.
  7. Close the PS1 emulator game.
  8. Notice that the OBS game capture screen is frozen with the game image last when closed.
  9. Start the game again and it will still have the vulkan layer that is frozen being captured in OBS.
Version/Commit

1.22.2

Bisect Results

No.

Present in the nightly version

I don't know

Platform & operating system

Linux x86

Affected Cores

I think all of them.

Environment information

KDE Wayland
Vulkan
Flatpak

Relevant log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by tracing Vulkan VkInstance/VkDevice and swapchain lifetime across content close, then reproduce with OBS_VKCAPTURE=1 on Linux using the listed steps. Done means the external capture layer no longer remains attached to the closed swapchain and a newly started game is captured correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.