Commit c37a2936 authored by Mikhail Tergoev's avatar Mikhail Tergoev

vulkan is working

parent 3018c99e
......@@ -51,6 +51,7 @@ check_variables PP_USE_GSTREAMER "1"
check_variables PP_USE_D3D_EXTRAS "1"
check_variables PP_USE_SHADER_CACHE "1"
check_variables PP_USE_EAC_AND_BE "1"
check_variables PP_USE_WINE_DXGI "0"
check_variables WINE_WIN_START "start /wait /high /unix"
......@@ -60,9 +61,13 @@ else
export PP_WINE_CPU_TOPOLOGY=$WINE_CPU_TOPOLOGY""
fi
check_variables USE_OPENGL "0"
check_variables D8VK_VER "1.0"
check_variables DXVK_STABLE_VER "1.10.3"
check_variables DXVK_GIT_VER "2.2"
# check_variables DXVK_CONFIG_FILE "path/to/dxvk.conf"
check_variables VKD3D_STABLE_VER "2.8"
check_variables VKD3D_GIT_VER "2.9"
......@@ -81,7 +86,7 @@ print_var () { for vp in $@ ; do print_info "${vp}=${!vp}" ; done ;}
##### HELPER FUNCTIONS #####
try_copy_file () {
if [ ! -f "$1" ] ; then print_info "file $1 not found for copy" && return 1
if [ ! -f "$1" ] ; then print_debug "file $1 not found for copy" && return 1
elif [ -z "$2" ] ; then print_error "no way to copy file $1" && return 1
else
cp -f "$1" "$2"
......@@ -184,6 +189,50 @@ try_download () {
fi
}
try_copy_other_dll_to_pfx_64 () {
# добавить условие сравнение файла (копирование только при различии)
if [[ "$WINEARCH" == "win64" ]] ; then
try_copy_file "$1" "${WINEPREFIX}/drive_c/windows/system32/" && return 0 || return 1
else
print_info "WINEARCH != win64, skip copying a 64 bit file: $1.dll"
fi
}
try_copy_other_dll_to_pfx_32() {
# добавить условие сравнение файла (копирование только при различии)
if [[ "$WINEARCH" == "win64" ]] ; then
try_copy_file "$1" "${WINEPREFIX}/drive_c/windows/syswow64/" && return 0 || return 1
else
try_copy_file "$1" "${WINEPREFIX}/drive_c/windows/system32/" && return 0 || return 1
fi
}
try_copy_wine_dll_to_pfx_64 () {
# добавить условие сравнение файла (копирование только при различии)
if [[ "$WINEARCH" == "win64" ]] ; then
if [[ -d "${WINEDIR}/lib64/wine/x86_64-windows" ]]
then WINE_BUILD_DLL_64="${WINEDIR}/lib64/wine/x86_64-windows"
else WINE_BUILD_DLL_64="${WINEDIR}/lib64/wine"
fi
try_copy_file "$WINE_BUILD_DLL_64/$1" "${WINEPREFIX}/drive_c/windows/system32/" && return 0 || return 1
else
print_info "WINEARCH != win64, skip copying a 64 bit file: $1.dll"
fi
}
try_copy_wine_dll_to_pfx_32() {
# добавить условие сравнение файла (копирование только при различии)
if [[ -d "${WINEDIR}/lib/wine/i386-windows" ]]
then WINE_BUILD_DLL_32="${WINEDIR}/lib/wine/i386-windows"
else WINE_BUILD_DLL_32="${WINEDIR}/lib/wine"
fi
if [[ "$WINEARCH" == "win64" ]] ; then
try_copy_file "$WINE_BUILD_DLL_32/$1" "${WINEPREFIX}/drive_c/windows/syswow64/" && return 0 || return 1
else
try_copy_file "$WINE_BUILD_DLL_32/$1" "${WINEPREFIX}/drive_c/windows/system32/" && return 0 || return 1
fi
}
##### OVERRIDE VARIABLES FUNCTIONS #####
var_winedlloverride_update () {
if [ ! -z "${WINEDLLOVERRIDES}" ]
......@@ -220,9 +269,28 @@ var_vk_istance_layers_config_update () {
fi
}
##### USED WINED3D LIBRARY #####
init_opengl () {
if [[ "$USE_OPENGL" == 1 ]] ; then
WINED3D_FILES="d3d8 d3d9 d3d10_1 d3d10 d3d10core d3d11 dxgi d3d12 d3d12core"
for wined3dfiles in $WINED3D_FILES ; do
try_copy_wine_dll_to_pfx_64 "$wined3dfiles.dll"
try_copy_wine_dll_to_pfx_32 "$wined3dfiles.dll"
done
# check_variables WINE_D3D_CONFIG "renderer="
[[ "$MANGOHUD" == 1 ]] && MANGOHUD_RUN="mangohud --dlsym"
export DXVK_HUD=full
return 0
else
return 1
fi
}
##### CHECK VULKAN LIBRARY #####
check_and_download_d8vk () {
for D8VK_VAR_VER in "$D8VK_VER" $@ ; do
init_d8vk () {
check_variables USE_D8VK_VER "$D8VK_VER"
for D8VK_VAR_VER in "$USE_D8VK_VER" $@ ; do
if [[ ! -d "${PP_VULKAN_LIBDIR}/d8vk-$D8VK_VAR_VER" ]] ; then
D8VK_URL="https://github.com/AlpyneDreams/d8vk/releases/download/d8vk-v${D8VK_VAR_VER}/d8vk-v${D8VK_VAR_VER}.tar.gz"
D8VK_PACKAGE="${PP_VULKAN_LIBDIR}/d8vk-${D8VK_VAR_VER}.tar.gz"
......@@ -234,10 +302,15 @@ check_and_download_d8vk () {
fi
fi
done
try_copy_other_dll_to_pfx_32 "${PP_VULKAN_LIBDIR}/d8vk-$USE_D8VK_VER/x32/d3d8.dll"
var_winedlloverride_update d3d8=n
}
check_and_download_dxvk () {
for DXVK_VAR_VER in "$DXVK_STABLE_VER" "$DXVK_GIT_VER" $@ ; do
init_dxvk () {
check_variables USE_DXVK_VER "$DXVK_STABLE_VER"
for DXVK_VAR_VER in "$USE_DXVK_VER" $@ ; do
if [[ ! -d "${PP_VULKAN_LIBDIR}/dxvk-$DXVK_VAR_VER" ]] ; then
DXVK_URL="https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VAR_VER}/dxvk-${DXVK_VAR_VER}.tar.gz"
DXVK_PACKAGE="${PP_VULKAN_LIBDIR}/dxvk-${DXVK_VAR_VER}.tar.gz"
......@@ -249,10 +322,26 @@ check_and_download_dxvk () {
fi
fi
done
if [[ "${PP_USE_WINE_DXGI}" == 1 ]] ; then
DXVK_FILES="d3d9 d3d10_1 d3d10 d3d10core d3d11" # dxvk_config openvr_api_dxvk"
var_winedlloverride_update dxgi=b
else
DXVK_FILES="d3d9 d3d10_1 d3d10 d3d10core d3d11 dxgi" # dxvk_config openvr_api_dxvk"
fi
for dxvkfiles in $DXVK_FILES ; do
try_copy_other_dll_to_pfx_64 "${PP_VULKAN_LIBDIR}/dxvk-$USE_DXVK_VER/x64/$dxvkfiles.dll"
if try_copy_other_dll_to_pfx_32 "${PP_VULKAN_LIBDIR}/dxvk-$USE_DXVK_VER/x32/$dxvkfiles.dll"
then var_winedlloverride_update "$dxvkfiles=n"
fi
done
}
check_and_download_vkd3d () {
for VKD3D_VAR_VER in "$VKD3D_STABLE_VER" "$VKD3D_GIT_VER" $@ ; do
init_vkd3d () {
check_variables USE_VKD3D_VER "$VKD3D_STABLE_VER"
for VKD3D_VAR_VER in "$USE_VKD3D_VER" $@ ; do
if [[ ! -d "${PP_VULKAN_LIBDIR}/vkd3d-proton-$VKD3D_VAR_VER" ]] ; then
VKD3D_URL="https://github.com/HansKristian-Work/vkd3d-proton/releases/download/v${VKD3D_VAR_VER}/vkd3d-proton-${VKD3D_VAR_VER}.tar.zst"
VKD3D_PACKAGE="${PP_VULKAN_LIBDIR}/vkd3d-proton-${VKD3D_VAR_VER}.tar.zst"
......@@ -264,6 +353,14 @@ check_and_download_vkd3d () {
fi
fi
done
VKD3D_FILES="d3d12 d3d12core" # libvkd3d-shader-1 libvkd3d-proton-utils-3 libvkd3d-1
for vkd3dfiles in $VKD3D_FILES ; do
try_copy_other_dll_to_pfx_64 "${PP_VULKAN_LIBDIR}/vkd3d-proton-$USE_VKD3D_VER/x64/$vkd3dfiles.dll"
if try_copy_other_dll_to_pfx_32 "${PP_VULKAN_LIBDIR}/vkd3d-proton-$USE_VKD3D_VER/x86/$vkd3dfiles.dll"
then var_winedlloverride_update "$vkd3dfiles=n"
fi
done
}
##### INITIAL WINE SETTINGS #####
......@@ -322,10 +419,17 @@ init_wine_ver () {
done
else
# use system WINE
export WINELOADER=wine
export WINELOADER="wine"
export WINEDIR="/usr"
fi
}
##### INITIAL WINEPREFIX SETTINGS #####
init_wineprefix () {
# временная заглушка
check_variables WINEPREFIX "$HOME/.wine"
}
##### CHECK WINDOWS FILE #####
check_win_file () {
if [[ -f "$1" ]] ; then
......@@ -374,12 +478,19 @@ fi
. "$PP_USER_CONF"
check_win_file "$1"
check_and_download_d8vk
check_and_download_dxvk
check_and_download_vkd3d
# TODO: проверка ppdb файла рядом c exe, если нет то поиск в database и копирование в каталог с exe
# TODO: GUI
# TODO: проверка на автоустановку
init_wine_ver
init_wineprefix
if ! init_opengl ; then
init_d8vk
init_dxvk
init_vkd3d
fi
cd "$WIN_FILE_PATH"
"$WINELOADER" "$WIN_FILE_EXEC"
$MANGOHUD_RUN "$WINELOADER" "$WIN_FILE_EXEC"
exit 0
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