Skip to content

graphics-drivers: Resolve files in a sysroot more correctly

Simon McVittie requested to merge wip/smcv/gfx-sysroot into main

Follow-up from !595 (merged).


  • !617 (merged)

  • graphics: Pass a SrtSysroot through all JSON-based drivers

    This swaps PvRuntime from using / to /proc/self/root to look up /.flatpak-info, but that seems like a net correctness improvement, since we don't expect the FEX-Emu rootfs to override that file anyway.

    Other than that, no functional change intended.

  • graphics: Use SrtSysroot to detect Flatpak in sysroot

    This prevents symlinks from inadvertently "escaping" from the sysroot, while also doing the right thing to take into account FEX-Emu's pseudo-overlayfs.

  • graphics: Use SrtSysroot to load Vulkan ICDs and EGL-related manifests

  • graphics-drivers-vulkan: Simplify "return error" paths

    This avoids repetition of the common code to construct a SrtVulkanLayer object in error state and prepend it to the list.

  • graphics-drivers-vulkan: Simplify partial/full success paths

    This avoids some overly long lines, and repetition of the code to prepend layers to the list.

  • graphics-drivers-vulkan: Resolve layer paths using SrtSysroot

    This avoids escaping from the sysroot if there is an absolute symlink, while still letting FEX-Emu rewrite paths while not acting on a sysroot.

  • graphics-drivers-json-based: Resolve drivers directory via SrtSysroot

    This avoids reading the wrong location if absolute symlinks are involved, while still allowing FEX-Emu to rewrite paths when not acting on a sysroot.

  • graphics: Use SrtSysroot to check whether libGL, etc. exist

    This avoids being tricked by absolute symlinks in a non-trivial sysroot.

  • graphics: Use SrtSysroot to open LD_LIBRARY_PATH entries

    This ensures that FEX-Emu's path rewriting is still effective.

  • graphics: Ignore non-directory LD_LIBRARY_PATH entries

    These can't possibly contain VDPAU modules.

  • graphics: Use SrtSysroot for JSON-manifest-based drivers

    Otherwise we will miss FEX-Emu's path rewriting.

  • graphics: Ignore non-directories when searching for JSON manifests

    If it isn't a directory, then it can't possibly contain files.

Edited by Simon McVittie

Merge request reports