From 900468f8ec0bfba03b125715b2bb99dddee2428b Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Tue, 5 Sep 2023 19:15:23 +0100 Subject: [PATCH 1/7] Special K: Experimentally re-enable support for ReShade and Special K --- steamtinkerlaunch | 60 ++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index e3af1475..2038611a 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20230903-1" +PROGVERS="v14.0.20230906-1 (reenable-reshade-specialk)" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -5754,13 +5754,13 @@ function setShadDestDir { writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" writelog "INFO" "${FUNCNAME[0]} - therefore $RESH path redirect to the $SPEK directory is disabled" "E" -# SPEKRESHDIR="My Mods/${SPEK}/Plugins/ThirdParty/${RESH}" -# SHADDESTDIR="$GPFX/$DRCU/$STUS/$DOCS/$SPEKRESHDIR" -# else + SPEKRESHDIR="My Mods/${SPEK}/Plugins/ThirdParty/${RESH}" + SHADDESTDIR="$GPFX/$DRCU/$STUS/$DOCS/$SPEKRESHDIR" + else + # fi + setFullGameExePath "SHADDESTDIR" fi - # setFullGameExePath "SHADDESTDIR" -# fi - setFullGameExePath "SHADDESTDIR" + # setFullGameExePath "SHADDESTDIR" } function refreshProtList { @@ -8817,29 +8817,33 @@ function checkReshade { fi fi -#XXXXXXXXXXXXX + # EXPERIMENTALLY RE-ENABLED + # NOTE that this has no ReShade updating or version override checks, so it is missing many features that regular ReShade has! if [ "$USESPECIALK" -eq 1 ]; then writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" - #writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" + writelog "INFO" "${FUNCNAME[0]} - This has historically caused crashes, but has been experimentally re-enabled!" writelog "INFO" "${FUNCNAME[0]} - During the last test long ago this crashed the game" "E" writelog "INFO" "${FUNCNAME[0]} - therefore the $RESH install to the $SPEK directory redirect is disabled" "E" writelog "INFO" "${FUNCNAME[0]} - Might work meanwhile, you're welcome to re-animate the functions" "E" - # see also function prepareSpecialKReshade - -# writelog "INFO" "${FUNCNAME[0]} - Using ${RESH} and $SPEK together" -# mkProjDir "$SHADDESTDIR" -# if [ ! -f "$SHADDESTDIR/$RS_64" ]; then -# writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" -# cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" -# cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" -# cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" -# cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" -# else -# writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" -# fi - fi -# else + # see also function prepareSpecialKReshade + # This code should copy the raw ReShade DLLs into the game folder, though it does not seem to copy d3dcompiler_17 + # This is probably because d3dcompiler_47 should be installed as part of SpecialK installation + # + # using installRSdll would be overkill here, so we won't use it and will instead copy the raw files + writelog "INFO" "${FUNCNAME[0]} - Using ${RESH} and $SPEK together" + mkProjDir "$SHADDESTDIR" + if [ ! -f "$SHADDESTDIR/$RS_64" ]; then + writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" + cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" + cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" + cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" + cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" + else + writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" + fi + # fi + else if [ -f "$RSOLIST" ]; then writelog "INFO" "${FUNCNAME[0]} - ${RESH} has been disabled previously using '${PROGNAME,,}' - enabling it now" while read -r rsdll; do @@ -8864,7 +8868,7 @@ function checkReshade { writelog "INFO" "${FUNCNAME[0]} - Setting WINEDLLOVERRIDES for ${RESH}: dxgi=n,b;d3d9=n,b;${D3D47//.dll}=n,b;opengl32=n,b" export WINEDLLOVERRIDES="$WINEDLLOVERRIDES;dxgi=n,b;d3d9=n,b;${D3D47//.dll}=n,b;opengl32=n,b" -# fi + fi else if [ -f "$FRSINI" ]; then writelog "INFO" "${FUNCNAME[0]} - ${RESH} has been disabled by the user, so renaming '$FRSINI' to '$FRSOINI'" @@ -8996,8 +9000,10 @@ function prepareSpecialKReshade { writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" #writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" writelog "INFO" "${FUNCNAME[0]} - During the last test long ago this crashed the game" "E" - writelog "INFO" "${FUNCNAME[0]} - therefore the $RESH install to the $SPEK directory redirect is disabled" "E" - writelog "INFO" "${FUNCNAME[0]} - Might work meanwhile, you're welcome to re-animate the functions" "E" + writelog "WARN" "${FUNCNAME[0]} - This has been experimentally re-enabled, here be dragons!" + # writelog "INFO" "${FUNCNAME[0]} - therefore the $RESH install to the $SPEK directory redirect is disabled" "E" + # writelog "INFO" "${FUNCNAME[0]} - Might work meanwhile, you're welcome to re-animate the functions" "E" + writelog "WARN" "${FUNCNAME[0]} - This function call CURRENTLY DOES NOTHING and has unused code for specifying the location for the ReShade DLL" # see also function checkReshade # XXXXXXXXXXXXX From 0c4bed0120c13fea9da5fc3fc07b350dff541d73 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 9 Sep 2023 00:41:08 +0100 Subject: [PATCH 2/7] ReShade: Copy correct ReShade DLL names when using SpecialK --- steamtinkerlaunch | 91 ++++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index ec413fbd..578b3c9a 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20230907-1 (reenable-reshade-specialk)" +PROGVERS="v14.0.20230909-1 (reenable-reshade-specialk)" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -5748,20 +5748,22 @@ function fixShow { echo "${1//&/+}" } +## This function exists because previously, ReShade and ReShade+SpecialK were thought to need separate directories +## This is not the case; ReShade DLLs still go into the game folder with SpecialK, but are unnnamed, so both have the same SHADDESTDIR function setShadDestDir { autoCollectionSettings - if [ "$USESPECIALK" -eq 1 ] && [ "$USERESHADE" -eq 1 ]; then - writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" - writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" - writelog "INFO" "${FUNCNAME[0]} - therefore $RESH path redirect to the $SPEK directory is disabled" "E" - SPEKRESHDIR="My Mods/${SPEK}/Plugins/ThirdParty/${RESH}" - SHADDESTDIR="$GPFX/$DRCU/$STUS/$DOCS/$SPEKRESHDIR" - else + # if [ "$USESPECIALK" -eq 1 ] && [ "$USERESHADE" -eq 1 ]; then + # writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" + # writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" + # writelog "INFO" "${FUNCNAME[0]} - therefore $RESH path redirect to the $SPEK directory is disabled" "E" + # SPEKRESHDIR="My Mods/${SPEK}/Plugins/ThirdParty/${RESH}" + # SHADDESTDIR="$GPFX/$DRCU/$STUS/$DOCS/$SPEKRESHDIR" + # else # fi - setFullGameExePath "SHADDESTDIR" - fi - # setFullGameExePath "SHADDESTDIR" + # setFullGameExePath "SHADDESTDIR" + # fi + setFullGameExePath "SHADDESTDIR" } function refreshProtList { @@ -8716,7 +8718,8 @@ function installReshade { fi # Common conditional to install either 32bit/64bit ReShade DLLs, since process is same, just different DLL names - if [ "$USERESHADE" -eq 1 ]; then + # USESPECIALK check needed because we can't use custom DLL names when using SpecialK -- It expects the raw ReShade32/ReShade64 DLL names + if [ "$USERESHADE" -eq 1 ] && [ "$USESPECIALK" -eq 0 ]; then #d3d47 - Required for ReShade # NOTE 25/08/23: *Is* it still required? installd3d47dll "$D3D47_32" "$RSD3D47DLL" @@ -8762,6 +8765,29 @@ function installDepth3DReshade { fi } +# Install steps for ReShade and SpecialK are a bit different +function installReshadeForSpecialK { + + writelog "INFO" "${FUNCNAME[0]} - Installing ReShade DLLs for use with SpecialK (DLLs will not be renamed so SpecialK can read them)" + + # Raw copy ReShade DLLs using installRSdll -- Should make integrating things like ReShade update easier + # TODO how does the RSDLLNAMECONFLICTFOUND logic work for ReShade+SpecialK? Do we even have the ReShade.txt file or does it use SpecialK_Enabled.txt? + installRSdll "$RS_32" "0" "$RS_32" + installRSdll "$RS_64" "0" "$RS_64" + installRSdll "${RS_32//.dll/.json}" "0" "${RS_32//.dll/.json}" + installRSdll "${RS_64//.dll/.json}" "0" "${RS_64//.dll/.json}" + + # if [ ! -f "$SHADDESTDIR/$RS_64" ]; then + # writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" + # cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" + # cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" + # cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" + # cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" + # else + # writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" + # fi +} + function checkReshade { setShadDestDir @@ -8828,21 +8854,22 @@ function checkReshade { writelog "INFO" "${FUNCNAME[0]} - Might work meanwhile, you're welcome to re-animate the functions" "E" # see also function prepareSpecialKReshade - # This code should copy the raw ReShade DLLs into the game folder, though it does not seem to copy d3dcompiler_17 - # This is probably because d3dcompiler_47 should be installed as part of SpecialK installation + # This code should copy the raw ReShade DLLs into the game folder, not not d3dcompiler_47 + # d3dcompiler_47 should be installed as part of ReShade installation, and this is the only time d3dcompiler_47 should be used as SpecialK itself doesn't require it # # using installRSdll would be overkill here, so we won't use it and will instead copy the raw files writelog "INFO" "${FUNCNAME[0]} - Using ${RESH} and $SPEK together" mkProjDir "$SHADDESTDIR" - if [ ! -f "$SHADDESTDIR/$RS_64" ]; then - writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" - cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" - cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" - cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" - cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" - else - writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" - fi + installReshadeForSpecialK + # if [ ! -f "$SHADDESTDIR/$RS_64" ]; then + # writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" + # cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" + # cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" + # cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" + # cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" + # else + # writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" + # fi # fi else if [ -f "$RSOLIST" ]; then @@ -9099,15 +9126,7 @@ function useSpecialK { fi fi - # TODO this does not appear to be working! - IPAK="vcrun2022-$3" - if [ -f "$GPFX/${IPAK}_installed.txt" ]; then - writelog "SKIP" "${FUNCNAME[0]} - Skipping '$IPAK' - already installed" "E" - else - installSteWoShPak "$IPAK" "$GPFX" "$RUNWINE" - echo "$IPAK" > "$GPFX/${IPAK}_installed.txt" - fi - installd3d47dll "$4" "$SPEKDDIR" + # installd3d47dll "$4" "$SPEKDDIR" } function installSpekArchDll { @@ -9151,14 +9170,6 @@ function useSpecialK { writelog "INFO" "${FUNCNAME[0]} - Using '$SPEKDST' as $SPEK destination dll" - if [ -f "$GPFX/$DRCW/DirectX.log" ]; then - writelog "SKIP" "${FUNCNAME[0]} - Skipping 'dxsetup' - already installed" "E" - else - notiShow "$(strFix "$NOTY_INSTSTART" "dxsetup")" - installSteWoShPak "dxsetup" "$GPFX" "$RUNWINE" - notiShow "$(strFix "$NOTY_INSTSTOP" "dxsetup")" - fi - echo "$SPEKDST" > "$SPEKENA" if [ -f "$SPEKDST" ]; then From e9511049925a524bdcaa804898f7684e29afa669 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 9 Sep 2023 00:58:07 +0100 Subject: [PATCH 3/7] code cleanup --- steamtinkerlaunch | 75 +++++------------------------------------------ 1 file changed, 8 insertions(+), 67 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 413ca911..8a6c36b4 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -5752,17 +5752,7 @@ function fixShow { ## This is not the case; ReShade DLLs still go into the game folder with SpecialK, but are unnnamed, so both have the same SHADDESTDIR function setShadDestDir { autoCollectionSettings - - # if [ "$USESPECIALK" -eq 1 ] && [ "$USERESHADE" -eq 1 ]; then - # writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" - # writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" - # writelog "INFO" "${FUNCNAME[0]} - therefore $RESH path redirect to the $SPEK directory is disabled" "E" - # SPEKRESHDIR="My Mods/${SPEK}/Plugins/ThirdParty/${RESH}" - # SHADDESTDIR="$GPFX/$DRCU/$STUS/$DOCS/$SPEKRESHDIR" - # else - # fi - # setFullGameExePath "SHADDESTDIR" - # fi + setFullGameExePath "SHADDESTDIR" } @@ -8771,21 +8761,11 @@ function installReshadeForSpecialK { writelog "INFO" "${FUNCNAME[0]} - Installing ReShade DLLs for use with SpecialK (DLLs will not be renamed so SpecialK can read them)" # Raw copy ReShade DLLs using installRSdll -- Should make integrating things like ReShade update easier - # TODO how does the RSDLLNAMECONFLICTFOUND logic work for ReShade+SpecialK? Do we even have the ReShade.txt file or does it use SpecialK_Enabled.txt? - installRSdll "$RS_32" "0" "$RS_32" + # These DLLSs are not tracked, we should be tracking them in ReShade.txt so toggling ReShade off correctly removes them + # When turning ReShade off we should also check the DLL names and if SpecialK is no longer in use, to clean up a SpecialK+ReShade install (i.e. if using ReShade64.dll but SpecialK is off, just remove instead of renaming to .dll_off) installRSdll "$RS_32" "0" "$RS_32" installRSdll "$RS_64" "0" "$RS_64" installRSdll "${RS_32//.dll/.json}" "0" "${RS_32//.dll/.json}" installRSdll "${RS_64//.dll/.json}" "0" "${RS_64//.dll/.json}" - - # if [ ! -f "$SHADDESTDIR/$RS_64" ]; then - # writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" - # cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" - # cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" - # cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" - # cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" - # else - # writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" - # fi } function checkReshade { @@ -8847,30 +8827,14 @@ function checkReshade { # EXPERIMENTALLY RE-ENABLED # NOTE that this has no ReShade updating or version override checks, so it is missing many features that regular ReShade has! if [ "$USESPECIALK" -eq 1 ]; then - writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" - writelog "INFO" "${FUNCNAME[0]} - This has historically caused crashes, but has been experimentally re-enabled!" - writelog "INFO" "${FUNCNAME[0]} - During the last test long ago this crashed the game" "E" - writelog "INFO" "${FUNCNAME[0]} - therefore the $RESH install to the $SPEK directory redirect is disabled" "E" - writelog "INFO" "${FUNCNAME[0]} - Might work meanwhile, you're welcome to re-animate the functions" "E" - - # see also function prepareSpecialKReshade - # This code should copy the raw ReShade DLLs into the game folder, not not d3dcompiler_47 - # d3dcompiler_47 should be installed as part of ReShade installation, and this is the only time d3dcompiler_47 should be used as SpecialK itself doesn't require it - # - # using installRSdll would be overkill here, so we won't use it and will instead copy the raw files + writelog "WARN" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" + writelog "WARN" "${FUNCNAME[0]} - This has historically caused crashes, but has been experimentally re-enabled!" + writelog "WARN" "${FUNCNAME[0]} - Manual intervention may be required to fix crashes, such as renaming the SpecialK DLL to fix the SpecialK UI, or running dos2unix on INI files to fix crashes" + writelog "WARN" "${FUNCNAME[0]} - For more information, see: https://github.com/sonic2kk/steamtinkerlaunch/issues/894" + writelog "INFO" "${FUNCNAME[0]} - Using ${RESH} and $SPEK together" mkProjDir "$SHADDESTDIR" installReshadeForSpecialK - # if [ ! -f "$SHADDESTDIR/$RS_64" ]; then - # writelog "INFO" "${FUNCNAME[0]} - Copying '$RESHADESRCDIR/$RS_64' and friends to '$SHADDESTDIR'" - # cp "$RESHADESRCDIR/$RS_64" "$SHADDESTDIR" - # cp "$RESHADESRCDIR/$RS_32" "$SHADDESTDIR" - # cp "$RESHADESRCDIR/${RS_64//.dll/.json}" "$SHADDESTDIR" - # cp "$RESHADESRCDIR/${RS_32//.dll/.json}" "$SHADDESTDIR" - # else - # writelog "SKIP" "${FUNCNAME[0]} - Already have '$RS_64' in '$SHADDESTDIR'" - # fi - # fi else if [ -f "$RSOLIST" ]; then writelog "INFO" "${FUNCNAME[0]} - ${RESH} has been disabled previously using '${PROGNAME,,}' - enabling it now" @@ -9024,28 +8988,6 @@ function getSpecialKGameRenderApi { fi } -function prepareSpecialKReshade { - if [ "$USERESHADE" -eq 1 ]; then - writelog "INFO" "${FUNCNAME[0]} - Both '$SPEK' and '$RESH' are enabled." "E" - #writelog "INFO" "${FUNCNAME[0]} - Unfortunately the game currently crashes using Proton when both are enabled" - writelog "INFO" "${FUNCNAME[0]} - During the last test long ago this crashed the game" "E" - writelog "WARN" "${FUNCNAME[0]} - This has been experimentally re-enabled, here be dragons!" - # writelog "INFO" "${FUNCNAME[0]} - therefore the $RESH install to the $SPEK directory redirect is disabled" "E" - # writelog "INFO" "${FUNCNAME[0]} - Might work meanwhile, you're welcome to re-animate the functions" "E" - writelog "WARN" "${FUNCNAME[0]} - This function call CURRENTLY DOES NOTHING and has unused code for specifying the location for the ReShade DLL" - # see also function checkReshade - - # XXXXXXXXXXXXX - # maybe later: - # "[Import.ReShade64]" - # "Architecture=x64" - # "Role=ThirdParty" - # "When=PlugIn" - # "When=Early" - # "Filename=C:\users\steamuser\Documents\My Mods\SpecialK\PlugIns\ThirdParty\ReShade\ReShade64.dll" - fi -} - function prepareSpecialKIni { UWI="UsingWINE" UWIT="$UWI=true" @@ -9152,7 +9094,6 @@ function useSpecialK { SPEKENA="$SPEKDDIR/${SPEK}_enabled.txt" if [ "$USESPECIALK" -eq 1 ]; then - prepareSpecialKReshade prepareSpecialKIni UPSPEK=1 From 321091a829b7b1f2985905131a760ba5a2eb8cc1 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 9 Sep 2023 01:33:27 +0100 Subject: [PATCH 4/7] Special K: Use d3d11.dll for Direct3D 11 games Appears to be more compatible --- steamtinkerlaunch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 8a6c36b4..451f554c 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20230909-1 (reenable-reshade-specialk)" +PROGVERS="v14.0.20230909-2 (reenable-reshade-specialk)" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -8973,7 +8973,7 @@ function getSpecialKGameRenderApi { if [ -n "$RAPI" ]; then writelog "INFO" "${FUNCNAME[0]} - Found Render Api '$RAPI'" if [ "$RAPI" == "Direct3D 11" ]; then - SPEKDST="$SPEKDDIR/$DXGI" + SPEKDST="$SPEKDDIR/$D3D11" elif [ "$RAPI" == "Direct3D 9" ]; then SPEKDST="$SPEKDDIR/$D3D9" elif [ "$RAPI" == "OpenGL" ]; then From 710c8c46eaee340e6b7ba9416b75789254b01f33 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 9 Sep 2023 01:53:39 +0100 Subject: [PATCH 5/7] Special K: Default to d3d11.dll for unknown games --- steamtinkerlaunch | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 451f554c..3d51c875 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20230909-2 (reenable-reshade-specialk)" +PROGVERS="v14.0.20230909-3 (reenable-reshade-specialk)" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -8961,7 +8961,17 @@ function dlSpecialK { fi } -# TODO does this need updated for when a game has multiple APIs? See #580 +## Get rendering API from PCGamingWiki compatibility list +## This is missing some supported games (such as NieR:Replicant and Monster Hunter World) but is generally a good reference point +## +## For compatibility reasons we use d3d11.dll as the SpecialK DLL name for Direct3D 11 games, as this seems to be more compatible than dxgi.dll on Linux -- Mainly when it comes to using ReShade and SpecialK +## ReShade and SpecialK work better together for Direct3D 11 games if we use d3d11.dll as the name +## +## Behaviour is this: +## - If we find Direct3D 11 as the rendering API for our game, use d3d11.dll as the SpecialK DLL name +## - If we find an unknown rendering API for our game, use dxgi.dll as a fallback +## - If we cannot find our game in the list, assume D3D11 and fall back to d3d11.dll +## - TODO this point is not ideal, we should add an API override at some point function getSpecialKGameRenderApi { SPEKCOMP="$SPEKDLDIR/${SPEK}_compat.html" MAXAGE=1440 @@ -8972,7 +8982,9 @@ function getSpecialKGameRenderApi { RAPI="$(sed -n "/id=\"Compatibility_list\"/,$ p" "$SPEKCOMP" | grep -A1 "${GN// /\*.\*}" | tail -n1 | cut -d '>' -f2 | cut -d '<' -f1)" if [ -n "$RAPI" ]; then writelog "INFO" "${FUNCNAME[0]} - Found Render Api '$RAPI'" - if [ "$RAPI" == "Direct3D 11" ]; then + if [ "$RAPI" == "Direct3D 12" ]; then + SPEKDST="$SPEKDDIR/$DXGI" # Is this correct for DX12? + elif [ "$RAPI" == "Direct3D 11" ]; then SPEKDST="$SPEKDDIR/$D3D11" elif [ "$RAPI" == "Direct3D 9" ]; then SPEKDST="$SPEKDDIR/$D3D9" @@ -8984,7 +8996,7 @@ function getSpecialKGameRenderApi { fi else writelog "INFO" "${FUNCNAME[0]} - Could not find Render Api - assuming 'Direct3D 11'" - SPEKDST="$SPEKDDIR/$DXGI" + SPEKDST="$SPEKDDIR/$D3D11" fi } From afe7b4388a69fbe49a422777d62cf127a3547a94 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 9 Sep 2023 02:12:42 +0100 Subject: [PATCH 6/7] Special K: Only copy ReShade DLL matching current game architecture --- steamtinkerlaunch | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 3d51c875..73777c1b 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20230909-3 (reenable-reshade-specialk)" +PROGVERS="v14.0.20230909-4 (reenable-reshade-specialk)" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -8673,11 +8673,7 @@ function installReshade { writelog "INFO" "${FUNCNAME[0]} - No conflict found in old logfiles" fi - if [ -n "$ARCHALTEXE" ] && [[ ! "$ARCHALTEXE" =~ ${DUMMYBIN}$ ]]; then - CHARCH="$ARCHALTEXE" - else - CHARCH="$GP" - fi + getReShadeExeArch if [ -d "$INSTDESTDIR" ]; then # Get ReShade DLL names from comma separated list -- User will probably mostly only pass one, but this will handle cases where they might want multiple (ex: d3d9, opengl32) @@ -8730,6 +8726,10 @@ function installReshade { writelog "INFO" "${FUNCNAME[0]} - Writing '$CUSTRSDLL' to '$RSTXT'" appendToRSTXT "$CUSTRSDLL" done + else + if [ "$USESPECIALK" -eq 1 ]; then + writelog "SKIP" "${FUNCNAME[0]} - USERESHADE and USESPECIALK are enabled together, skipping custom ReShade DLL name as SpecialK needs specific ReShade DLL names" + fi fi # This makes sure if we updated any DLL names in RSDLLNAMEARR to end with '.dll' that these are written out to the game config file @@ -8755,17 +8755,39 @@ function installDepth3DReshade { fi } +# Get archiecture of executable that ReShade is being used for, so we know which DLL to copy (32bit/64bit) +function getReShadeExeArch { + if [ -n "$ARCHALTEXE" ] && [[ ! "$ARCHALTEXE" =~ ${DUMMYBIN}$ ]]; then + CHARCH="$ARCHALTEXE" + else + CHARCH="$GP" + fi +} + # Install steps for ReShade and SpecialK are a bit different function installReshadeForSpecialK { - writelog "INFO" "${FUNCNAME[0]} - Installing ReShade DLLs for use with SpecialK (DLLs will not be renamed so SpecialK can read them)" # Raw copy ReShade DLLs using installRSdll -- Should make integrating things like ReShade update easier # These DLLSs are not tracked, we should be tracking them in ReShade.txt so toggling ReShade off correctly removes them # When turning ReShade off we should also check the DLL names and if SpecialK is no longer in use, to clean up a SpecialK+ReShade install (i.e. if using ReShade64.dll but SpecialK is off, just remove instead of renaming to .dll_off) installRSdll "$RS_32" "0" "$RS_32" - installRSdll "$RS_64" "0" "$RS_64" - installRSdll "${RS_32//.dll/.json}" "0" "${RS_32//.dll/.json}" - installRSdll "${RS_64//.dll/.json}" "0" "${RS_64//.dll/.json}" + getReShadeExeArch + + # Very similar logic used for installReshade + if [ "$(getArch "$CHARCH")" == "32" ]; then + #32bit + writelog "INFO" "${FUNCNAME[0]} - Installing 32bit ${RESH} for ${SPEK} as '$CHARCH' is 32bit" + installRSdll "$RS_32" "0" "$RS_32" + installRSdll "${RS_32//.dll/.json}" "0" "${RS_32//.dll/.json}" + elif [ "$(getArch "$CHARCH")" == "64" ]; then + #64bit + writelog "INFO" "${FUNCNAME[0]} - Installing 64bit ${RESH} for ${SPEK} as '$CHARCH' is 64bit" + installRSdll "$RS_64" "0" "$RS_64" + installRSdll "${RS_64//.dll/.json}" "0" "${RS_64//.dll/.json}" + else + writelog "SKIP" "${FUNCNAME[0]} - ERROR in ${RESH}+${SPEK} installation - no file information detected for '$CHARCH' or any 'neighbor file' - setting USERESHADE=0 for this session" + export USERESHADE=0 + fi } function checkReshade { From 22c8c5222375c94e046e960b978bd826f967479c Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sat, 9 Sep 2023 03:11:40 +0100 Subject: [PATCH 7/7] version bump --- steamtinkerlaunch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 73777c1b..7e63d134 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20230909-4 (reenable-reshade-specialk)" +PROGVERS="v14.0.20230909-1" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com"