Commit 9e6d3008 authored by Boria138's avatar Boria138

Completely finished the job

parent 8c041522
......@@ -202,6 +202,15 @@ var_vk_istance_layers_config_update () {
return 0
}
var_ld_library_path_update() {
if [ ! -z "${LD_LIBRARY_PATH}" ]; then
export LD_LIBRARY_PATH="$1:$LD_LIBRARY_PATH"
else
export LD_LIBRARY_PATH="$1"
fi
return 0
}
unpack_tar_zst () {
set -o pipefail
unset PW_ZSTD_PORT
......@@ -818,7 +827,7 @@ pw_check_and_download_plugins () {
}
check_nvidia_rtx () {
if echo "$LSPCI_VGA" | grep -i "nvidia" ; then
if [[ $(echo "$LSPCI_VGA" | grep -i "nvidia") ]] ; then
# Turing (without nvidia 16XX)
[[ "$LSPCI_VGA" == *TU[0-9]* ]] && [[ "$LSPCI_VGA" != *TU11[6-7]* ]] && return 0
# Ampere
......@@ -830,7 +839,7 @@ check_nvidia_rtx () {
}
check_hybrid_graphicks () {
if echo "$LSPCI_VGA" | grep -i nvidia | grep -iE '(intel|amd)'
if [[ $(echo "$LSPCI_VGA" | grep -i nvidia | grep -i -E '(intel|amd)') ]]
then return 0
else return 1
fi
......
......@@ -142,11 +142,11 @@ pw_tray_icon () {
${loc_tray_winefile}!bash -c pw_tray_winefile!"$PW_GUI_ICON_PATH/port_winefile.png"|| \
${loc_tray_tascmng}!bash -c pw_tray_taskmgr!"$PW_GUI_ICON_PATH/port_winefile.png"|| \
${loc_tray_cangelog}!bash -c open_changelog!"$PW_GUI_ICON_PATH/port_changelog.png"|| \
${loc_tray_force_exit} !bash -c tray_icon_click_exit!"$PW_GUI_ICON_PATH/port_exit.png"||" 2>/dev/null &
${loc_tray_force_exit} !bash -c tray_icon_click_exit!"$PW_GUI_ICON_PATH/port_exit.png"||" 2>/dev/null &
return 0
}
pw_gui_for_edit_db () {
KEY_EDIT_DB_GUI=$RANDOM
if echo "${MANGOHUD_CONFIG}" | grep "fps_limit" ; then
......@@ -159,6 +159,11 @@ pw_gui_for_edit_db () {
else
CPU_LIMIT_VAR="disabled"
fi
if [[ ! -z "${PW_AMD_VULKAN_USE}" ]] && [[ "${PW_AMD_VULKAN_USE}" != "default" ]] ; then
AMD_VULKAN_VAR="${PW_AMD_VULKAN_USE}"
else
AMD_VULKAN_VAR="default"
fi
GET_REFRASH_RATE="30!45!60!75!120!144!165!240"
......@@ -183,9 +188,9 @@ pw_gui_for_edit_db () {
}
edit_db_field_add $@
old_IFS=$IFS
IFS="%"
IFS="%"
"${pw_yad_v12_3}" --plug=$KEY_EDIT_DB_GUI --tabnum="1" --form --separator=" " --columns=4 ${ADD_CHK_BOX_EDIT_DB} \
1> "${PORT_WINE_TMP_PATH}/tmp_output_yad_edit_db" 2>/dev/null &
1> "${PORT_WINE_TMP_PATH}/tmp_output_yad_edit_db" 2>/dev/null &
IFS=$old_IFS
case ${PW_WINDOWS_VER} in
......@@ -201,7 +206,7 @@ pw_gui_for_edit_db () {
--field="${loc_gui_arg_exe}!${loc_gui_arg_exe_help} :CBE" "\\${LAUNCH_PARAMETERS[@]}!-dx11 -skipintro 1" \
--field=":LBL" "" \
--field="${loc_gui_cpu_limit}!${loc_gui_cpu_limit_help} :CB" "${CPU_LIMIT_VAR}!disabled!${GET_LOGICAL_CORE}" \
--field="${loc_gui_amd_vulkan_select}!${loc_gui_amd_vulkan_select} :CB" "${AMD_VUKAN_VAR}!default!amdvlk!amdgpupro!radv!radv_gpl!radv_aco" \
--field="${loc_gui_amd_vulkan_select}!${loc_gui_amd_vulkan_select} :CB" "${AMD_VULKAN_VAR}!default!amdvlk!amdgpupro!radv!radv_gpl!radv_aco" \
--field="${loc_gui_mango_fps}!${loc_gui_mango_fps_help} :CB" "${FPS_LIMIT_VAR}!disabled!${GET_REFRASH_RATE}" 2>/dev/null 1> "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" 2>/dev/null &
"${pw_yad_v12_3}" --paned --key="$KEY_EDIT_DB_GUI" --title "EDIT_DB" --text-align=center --height="650" \
--text "${loc_gui_edit_db} <b>${PORTWINE_DB}</b>\n ${loc_gui_edit_db_help}" --separator=" " --borders=3 \
......@@ -210,7 +215,7 @@ pw_gui_for_edit_db () {
--button="${loc_gui_open_db}"!!"${loc_gui_open_db_help}":150 \
--button="${loc_gui_save_changes}"!!"${loc_gui_save_changes_help}":0 2>/dev/null
YAD_STATUS="$?"
case "$YAD_STATUS" in
case "$YAD_STATUS" in
1) /usr/bin/env bash -c ${pw_full_command_line[*]} & exit 0 ;;
150) xdg-open "${PORTWINE_DB_FILE}" & exit 0 ;;
252) exit 0 ;;
......@@ -233,7 +238,7 @@ pw_gui_for_edit_db () {
WINEDLLOVERRIDES=`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $3}'`
LAUNCH_PARAMETERS=`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $5}'`
CPU_LIMIT="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $7}'`"
AMD_VULKAN="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $8}'`"
PW_AMD_VULKAN_USE="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $8}'`"
FPS_LIMIT="`cat "${PORT_WINE_TMP_PATH}/tmp_output_yad_fps_limit" | awk -F"%" '{print $9}'`"
if [[ "${FPS_LIMIT}" != "disabled" ]] && [[ "${FPS_LIMIT_VAR}" != "disabled" ]] ; then
......@@ -250,41 +255,37 @@ pw_gui_for_edit_db () {
else
export PW_WINE_CPU_TOPOLOGY="disabled"
fi
if [[ "${AMD_VULKAN}" == "amdvlk" ]] ; then
if [[ "${PW_AMD_VULKAN_USE}" == "amdvlk" ]] ; then
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
if [[ $(grep -i -E '(rosa|redos|nobara|linuxmint|ubuntu|centos|rhel|fedora)' "/etc/os-release") ]] ; then
export VK_ICD_FILENAMES="/opt/amdgpu/etc/vulkan/icd.d/amd_icd32.json:/opt/amdgpu/etc/vulkan/icd.d/amd_icd64.json"
else
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/amd_icd32.json:/usr/share/vulkan/icd.d/amd_icd64.json"
fi
elif [[ "${AMD_VULKAN}" == "amdgpupro" ]] ; then
elif [[ "${PW_AMD_VULKAN_USE}" == "amdgpupro" ]] ; then
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
if [[ $(grep -i -E '(rosa|redos|nobara|linuxmint|ubuntu|centos|rhel|fedora)' "/etc/os-release") ]] ; then
export VK_ICD_FILENAMES="/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd32.json:/opt/amdgpu-pro/etc/vulkan/icd.d/amd_icd64.json"
export LD_LIBRARY_PATH="/opt/amdgpu/libdrm/lib64:/opt/amdgpu/libdrm/lib32:$LD_LIBRARY_PATH"
var_ld_library_path_update "/opt/amdgpu/libdrm/lib64:/opt/amdgpu/libdrm/lib32"
else
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/amd_pro_icd32.json:/usr/share/vulkan/icd.d/amd_pro_icd64.json"
fi
elif [[ "${AMD_VULKAN}" == "radv" ]] ; then
elif [[ "${PW_AMD_VULKAN_USE}" == "radv" ]] ; then
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json"
elif [[ "${AMD_VULKAN}" == "radv_aco" ]] ; then
elif [[ "${PW_AMD_VULKAN_USE}" == "radv_aco" ]] ; then
unset RADV_PERFTEST
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
export RADV_PERFTEST=aco
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json"
elif [[ "${AMD_VULKAN}" == "radv_gpl" ]] ; then
elif [[ "${PW_AMD_VULKAN_USE}" == "radv_gpl" ]] ; then
unset RADV_PERFTEST
export DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1=1
export RADV_PERFTEST=gpl
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/radeon_icd.i686.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json"
fi
# Debug echo (nedded delete)
echo $VK_ICD_FILENAMES
echo $RADV_PERFTEST
echo $AMD_VULKAN
echo "pw_gui_for_edit_db PORTWINE_DB_FILE=$PORTWINE_DB_FILE"
edit_db_from_gui $@ MANGOHUD_CONFIG LAUNCH_PARAMETERS PW_WINDOWS_VER PW_DLL_INSTALL WINEDLLOVERRIDES PW_WINE_CPU_TOPOLOGY
edit_db_from_gui $@ MANGOHUD_CONFIG LAUNCH_PARAMETERS PW_WINDOWS_VER PW_DLL_INSTALL WINEDLLOVERRIDES PW_WINE_CPU_TOPOLOGY PW_AMD_VULKAN_USE
return 0
}
......@@ -377,7 +378,7 @@ gui_proton_downloader () {
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
fi
if [ ! -z `cat "${PORT_WINE_TMP_PATH}/tmp_proton_set" | awk '{print $1}'` ] ; then
export VERSION_WINE_GIT="`cat "${PORT_WINE_TMP_PATH}/tmp_proton_set"`"
elif [ ! -z `cat "${PORT_WINE_TMP_PATH}/tmp_proton_pw_set" | awk '{print $1}'` ] ; then
......@@ -410,14 +411,14 @@ gui_proton_downloader () {
break
fi
done
if [[ ! -z "${VERSION_INSTALLED_WINE}" ]]; then
try_remove_dir "${PORT_WINE_PATH}/data/dist/${VERSION_INSTALLED_WINE}"
unset VERSION_INSTALLED_WINE
/usr/bin/env bash -c ${pw_full_command_line[*]} &
exit 0
fi
print_info "Download and install ${VERSION_WINE_GIT}..."
PW_WINE_ARCHIVE="$(echo ${URL_VERSION_PROTON_GIT} | awk -F'/' '{print $NF}' | awk -F'.tar' '{print $1}')"
if try_download_to_path "${URL_VERSION_PROTON_GIT}" "${PORT_WINE_PATH}/data/tmp/" ; then
......@@ -469,11 +470,11 @@ gui_vkBasalt () {
VKBASALT_FFX_CAS_GUI=75
fi
export old_IFS=$IFS
export IFS="%"
export IFS="%"
"${pw_yad_v12_3}" --plug=$KEY_FX_GUI --tabnum="1" --form --columns=5 --separator=" " \
--text-align=center --text="$loc_gui_vkbasalt_top" \
${ADD_GUI_FX} 1> "${PORT_WINE_TMP_PATH}/tmp_yad_basalt_set" 2>/dev/null &
export IFS="${old_IFS}"
export IFS="${old_IFS}"
"${pw_yad_v12_3}" --plug=$KEY_FX_GUI --tabnum="2" --separator=" " --form \
--field="AMD FidelityFX - Contrast Adaptive Sharpening"!"$loc_gui_ffx_cas":SCL "${VKBASALT_FFX_CAS_GUI}" \
......@@ -505,7 +506,7 @@ gui_vkBasalt () {
export INT_COUNT_FX=$(( ${INT_COUNT_FX} + 1 ))
done
GUI_FX_RESULT="${GUI_FX_RESULT}cas"
export PW_VKBASALT_EFFECTS="${GUI_FX_RESULT}"
export PW_VKBASALT_EFFECTS="${GUI_FX_RESULT}"
if [[ "$YAD_CAS_SET" == "0" ]] ; then
export PW_VKBASALT_FFX_CAS="0"
......@@ -534,7 +535,7 @@ portwine_create_shortcut () {
create_menu_desktop_shortcut=$(echo "$OUTPUT" | awk -F'|' '{ print $3 }')
try_remove_file "${PORT_WINE_PATH}/${name_desktop}.desktop"
mv -f "${PORT_WINE_PATH}/data/img/${PORTPROTON_NAME}.png" "${PORT_WINE_PATH}/data/img/${name_desktop}.png"
echo "[Desktop Entry]" > "${PORT_WINE_PATH}/${name_desktop}.desktop"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment