opengl: Use glxgallium Mesa when VirtualGL is not appropriate

This commit is contained in:
Tyson Whitehead
2019-06-05 20:07:19 -04:00
parent cd8953a282
commit 3aeab1dd97
3 changed files with 97 additions and 25 deletions

View File

@@ -205,29 +205,22 @@ VGL_patch() {
#
# mv "$file" "${file%/*}/.${file##*/}.vgl"
# cat > "$file" <<EOF
#! @bash@/bin/bash
# exec -a "\$0" "$(patchelf --print-interpreter "${file%/*}/.${file##*/}.vgl")" \${VGL_DISPLAY:+--preload "@virtualglLib@/lib/libvglfaker.so"} "${file%/*}/.${file##*/}.vgl" "\$@"
#! @bash@
# exec -a "\$0" "$(patchelf --print-interpreter "${file%/*}/.${file##*/}.vgl")" \${VGL_DISPLAY:+--preload "@virtualglLib@"} "${file%/*}/.${file##*/}.vgl" "\$@"
# EOF
# chmod +x "$file"
# VGL version may need fixing up to ensure libglfaker.so gets loaded at the start
printf 'Wrapping and patching for VirtualGL: %q\n' "$file" >&2
cp -a "$file" "${file%/*}/.${file##*/}.vgl-yes"
VGL_elfFilterLibsS "${file%/*}/.${file##*/}.vgl-yes" 'VGL_testSuffixNoneS '"$(VGL_quote '[[ $1 =~ ^(.*/)?libvglfaker.so ]]')"' @virtualglLib@/lib/libvglfaker.so'
# patchelf --add-needed @virtualglLib@/lib/libvglfaker.so "${file%/*}/.${file##*/}.vgl-yes"
# Non-VGL versions may need fixing to load libXext so NVIDIA binary libs are happy
#
# Ugly, but putting this here instead of with the NVIDIA libs, allows us not to to fix one version for all
# Non-VGL is fine as we link it against mesa_glxgallium
mv "$file" "${file%/*}/.${file##*/}.vgl-no"
VGL_elfFilterLibsS "${file%/*}/.${file##*/}.vgl-no" 'VGL_testSuffixNoneS '"$(VGL_quote '[[ $1 =~ ^(.*/)?libXext.so ]]')"' libXext.so.6'
VGL_elfFilterRPathS "${file%/*}/.${file##*/}.vgl-no" 'VGL_testSuffixNoneS '"$(VGL_quote '[[ $1 = @libXext@/lib ]]')"' @libXext@/lib'
# Replace with chooser script based on whether VGL_DISPLAY is set or not
cat > "$file" <<EOF
#! @bash@/bin/bash
#! @bash@
if [ -z "\$VGL_DISPLAY" ]; then
exec -a "\$0" "${file%/*}/.${file##*/}.vgl-no" "\$@"