Prevent infinite recursion when using Mesa zink.
When using zink (`MESA_LOADER_DRIVER_OVERRIDE=zink`), running any app (OpenGL or Vulkan), will trigger running `glxinfo`. Unsetting of `LD_PRELOAD` is not sufficient, because if using `zink`, it will load Vulkan, and load Vulkan implicit layer for Mangohud, using `/usr/share/vulkan/implicit_layer.d/MangoHud.json`, which will cause it to reenter this function in another process, causing infinite recursion (until the Vulkan driver finally errors out with too many VkDevices / contexts created). I have easily have seen recursion depths of 200+ until this happen, and sometimes takes up to 2 minutes, with 2000 extra shell and `cut` processes in the process tree. Fix this by marking recursion entrance. This makes glxmark start in less than 1 second, instead about 60 seconds. When at it us `glxinfo -B`, which is significantly faster on zink, yet provides all information we need.pull/460/head
parent
185941a857
commit
c92f805c2d
Loading…
Reference in New Issue