Replace uses of SWA with UnleashedRecomp & rebrand the recompilers. (#138)

This commit is contained in:
Skyth (Asilkan) 2025-01-19 23:21:05 +03:00 committed by GitHub
parent 312f913a92
commit 1efb4943b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 147 additions and 153 deletions

12
.gitmodules vendored
View file

@ -1,12 +1,12 @@
[submodule "thirdparty/PowerRecomp"]
path = tools/PowerRecomp
url = https://github.com/hedge-dev/PowerRecomp
[submodule "tools/XenonRecomp"]
path = tools/XenonRecomp
url = https://github.com/hedge-dev/XenonRecomp.git
[submodule "thirdparty/ddspp"]
path = thirdparty/ddspp
url = https://github.com/redorav/ddspp.git
[submodule "thirdparty/ShaderRecomp"]
path = tools/ShaderRecomp
url = https://github.com/hedge-dev/ShaderRecomp.git
[submodule "tools/XenosRecomp"]
path = tools/XenosRecomp
url = https://github.com/hedge-dev/XenosRecomp.git
[submodule "thirdparty/libmspack"]
path = thirdparty/libmspack
url = https://github.com/kyz/libmspack

View file

@ -5,8 +5,8 @@ if(NOT DEFINED ENV{VCPKG_ROOT})
endif()
include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
set(SWA_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty)
set(SWA_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools)
set(UNLEASHED_RECOMP_THIRDPARTY_ROOT ${CMAKE_SOURCE_DIR}/thirdparty)
set(UNLEASHED_RECOMP_TOOLS_ROOT ${CMAKE_SOURCE_DIR}/tools)
set(CMAKE_CXX_STANDARD 20)
set(BUILD_SHARED_LIBS OFF)
@ -18,8 +18,8 @@ endif()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
add_subdirectory(${SWA_THIRDPARTY_ROOT})
add_subdirectory(${SWA_TOOLS_ROOT})
add_subdirectory(${UNLEASHED_RECOMP_THIRDPARTY_ROOT})
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT})
project("UnleashedRecomp-ALL")

View file

@ -1,15 +1,14 @@
project("UnleashedRecomp")
set(TARGET_NAME "SWA")
if (WIN32)
option(SWA_D3D12 "Add D3D12 support for rendering" ON)
option(UNLEASHED_RECOMP_D3D12 "Add D3D12 support for rendering" ON)
endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
option(SWA_FLATPAK "Configure the build for Flatpak compatibility." OFF)
option(UNLEASHED_RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF)
endif()
option(SWA_XAUDIO2 "Use XAudio2 for audio playback" OFF)
option(UNLEASHED_RECOMP_XAUDIO2 "Use XAudio2 for audio playback" OFF)
function(BIN2C)
cmake_parse_arguments(BIN2C_ARGS "" "TARGET_OBJ;SOURCE_FILE;DEST_FILE;ARRAY_NAME;COMPRESSION_TYPE" "" ${ARGN})
@ -64,16 +63,15 @@ else()
endif()
add_compile_definitions(
SWA_IMPL
SDL_MAIN_HANDLED
_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR # Microsoft wtf?
_CRT_SECURE_NO_WARNINGS)
set(SWA_PRECOMPILED_HEADERS
set(UNLEASHED_RECOMP_PRECOMPILED_HEADERS
"stdafx.h"
)
set(SWA_KERNEL_CXX_SOURCES
set(UNLEASHED_RECOMP_KERNEL_CXX_SOURCES
"kernel/imports.cpp"
"kernel/xdm.cpp"
"kernel/heap.cpp"
@ -82,13 +80,13 @@ set(SWA_KERNEL_CXX_SOURCES
"kernel/io/file_system.cpp"
)
set(SWA_LOCALE_CXX_SOURCES
set(UNLEASHED_RECOMP_LOCALE_CXX_SOURCES
"locale/config_locale.cpp"
"locale/locale.cpp"
)
if (WIN32)
set(SWA_OS_CXX_SOURCES
set(UNLEASHED_RECOMP_OS_CXX_SOURCES
"os/win32/logger_win32.cpp"
"os/win32/media_win32.cpp"
"os/win32/process_win32.cpp"
@ -96,7 +94,7 @@ if (WIN32)
"os/win32/version_win32.cpp"
)
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(SWA_OS_CXX_SOURCES
set(UNLEASHED_RECOMP_OS_CXX_SOURCES
"os/linux/logger_linux.cpp"
"os/linux/media_linux.cpp"
"os/linux/process_linux.cpp"
@ -105,11 +103,11 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
)
endif()
set(SWA_CPU_CXX_SOURCES
set(UNLEASHED_RECOMP_CPU_CXX_SOURCES
"cpu/guest_thread.cpp"
)
set(SWA_GPU_CXX_SOURCES
set(UNLEASHED_RECOMP_GPU_CXX_SOURCES
"gpu/video.cpp"
"gpu/imgui/imgui_common.cpp"
"gpu/imgui/imgui_font_builder.cpp"
@ -117,29 +115,29 @@ set(SWA_GPU_CXX_SOURCES
"gpu/rhi/plume_vulkan.cpp"
)
if (SWA_D3D12)
list(APPEND SWA_GPU_CXX_SOURCES
if (UNLEASHED_RECOMP_D3D12)
list(APPEND UNLEASHED_RECOMP_GPU_CXX_SOURCES
"gpu/rhi/plume_d3d12.cpp"
)
endif()
set(SWA_APU_CXX_SOURCES
set(UNLEASHED_RECOMP_APU_CXX_SOURCES
"apu/audio.cpp"
"apu/embedded_player.cpp"
)
if (SWA_XAUDIO2)
list(APPEND SWA_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp")
if (UNLEASHED_RECOMP_XAUDIO2)
list(APPEND UNLEASHED_RECOMP_APU_CXX_SOURCES "apu/driver/xaudio_driver.cpp")
else()
list(APPEND SWA_APU_CXX_SOURCES "apu/driver/sdl2_driver.cpp")
list(APPEND UNLEASHED_RECOMP_APU_CXX_SOURCES "apu/driver/sdl2_driver.cpp")
endif()
set(SWA_HID_CXX_SOURCES
set(UNLEASHED_RECOMP_HID_CXX_SOURCES
"hid/hid.cpp"
"hid/driver/sdl_hid.cpp"
)
set(SWA_PATCHES_CXX_SOURCES
set(UNLEASHED_RECOMP_PATCHES_CXX_SOURCES
"patches/ui/CHudPause_patches.cpp"
"patches/ui/CTitleStateIntro_patches.cpp"
"patches/ui/CTitleStateMenu_patches.cpp"
@ -158,7 +156,7 @@ set(SWA_PATCHES_CXX_SOURCES
"patches/video_patches.cpp"
)
set(SWA_UI_CXX_SOURCES
set(UNLEASHED_RECOMP_UI_CXX_SOURCES
"ui/achievement_menu.cpp"
"ui/achievement_overlay.cpp"
"ui/installer_wizard.cpp"
@ -171,7 +169,7 @@ set(SWA_UI_CXX_SOURCES
"ui/game_window.cpp"
)
set(SWA_INSTALL_CXX_SOURCES
set(UNLEASHED_RECOMP_INSTALL_CXX_SOURCES
"install/installer.cpp"
"install/iso_file_system.cpp"
"install/memory_mapped_file.cpp"
@ -187,56 +185,56 @@ set(SWA_INSTALL_CXX_SOURCES
"install/hashes/update.cpp"
)
set(SWA_USER_CXX_SOURCES
set(UNLEASHED_RECOMP_USER_CXX_SOURCES
"user/achievement_data.cpp"
"user/config.cpp"
)
set(SWA_MOD_CXX_SOURCES
set(UNLEASHED_RECOMP_MOD_CXX_SOURCES
"mod/mod_loader.cpp"
)
set(SWA_THIRDPARTY_SOURCES
"${SWA_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp"
"${SWA_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp"
"${SWA_THIRDPARTY_ROOT}/implot/implot.cpp"
"${SWA_THIRDPARTY_ROOT}/implot/implot_demo.cpp"
"${SWA_THIRDPARTY_ROOT}/implot/implot_items.cpp"
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source/smolv.cpp"
set(UNLEASHED_RECOMP_THIRDPARTY_SOURCES
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/backends/imgui_impl_sdl2.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_demo.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_draw.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_tables.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui/imgui_widgets.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_demo.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot/implot_items.cpp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack/lzxd.c"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c/aes.c"
"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source/smolv.cpp"
)
set(SWA_THIRDPARTY_INCLUDES
"${SWA_THIRDPARTY_ROOT}/concurrentqueue"
"${SWA_THIRDPARTY_ROOT}/ddspp"
"${SWA_THIRDPARTY_ROOT}/imgui"
"${SWA_THIRDPARTY_ROOT}/implot"
"${SWA_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
"${SWA_THIRDPARTY_ROOT}/magic_enum/include"
"${SWA_THIRDPARTY_ROOT}/stb"
"${SWA_THIRDPARTY_ROOT}/tiny-AES-c"
"${SWA_THIRDPARTY_ROOT}/TinySHA1"
"${SWA_THIRDPARTY_ROOT}/unordered_dense/include"
"${SWA_THIRDPARTY_ROOT}/volk"
"${SWA_THIRDPARTY_ROOT}/Vulkan-Headers/include"
"${SWA_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include"
"${SWA_TOOLS_ROOT}/bc_diff"
"${SWA_TOOLS_ROOT}/ShaderRecomp/thirdparty/smol-v/source"
set(UNLEASHED_RECOMP_THIRDPARTY_INCLUDES
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/concurrentqueue"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/ddspp"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/imgui"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/implot"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/libmspack/libmspack/mspack"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/magic_enum/include"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/stb"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/tiny-AES-c"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/TinySHA1"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/unordered_dense/include"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/volk"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/Vulkan-Headers/include"
"${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/VulkanMemoryAllocator/include"
"${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff"
"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/thirdparty/smol-v/source"
)
if (SWA_D3D12)
list(APPEND SWA_THIRDPARTY_INCLUDES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include")
list(APPEND SWA_THIRDPARTY_SOURCES "${SWA_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp")
if (UNLEASHED_RECOMP_D3D12)
list(APPEND UNLEASHED_RECOMP_THIRDPARTY_INCLUDES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/include")
list(APPEND UNLEASHED_RECOMP_THIRDPARTY_SOURCES "${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/D3D12MemoryAllocator/src/D3D12MemAlloc.cpp")
endif()
set_source_files_properties(${SWA_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
set_source_files_properties(${UNLEASHED_RECOMP_THIRDPARTY_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
set(SWA_CXX_SOURCES
set(UNLEASHED_RECOMP_CXX_SOURCES
"app.cpp"
"exports.cpp"
"main.cpp"
@ -244,40 +242,38 @@ set(SWA_CXX_SOURCES
"stdafx.cpp"
"version.cpp"
${SWA_KERNEL_CXX_SOURCES}
${SWA_LOCALE_CXX_SOURCES}
${SWA_OS_CXX_SOURCES}
${SWA_CPU_CXX_SOURCES}
${SWA_GPU_CXX_SOURCES}
${SWA_APU_CXX_SOURCES}
${SWA_HID_CXX_SOURCES}
${SWA_PATCHES_CXX_SOURCES}
${SWA_UI_CXX_SOURCES}
${SWA_INSTALL_CXX_SOURCES}
${SWA_USER_CXX_SOURCES}
${SWA_MOD_CXX_SOURCES}
${SWA_THIRDPARTY_SOURCES}
${UNLEASHED_RECOMP_KERNEL_CXX_SOURCES}
${UNLEASHED_RECOMP_LOCALE_CXX_SOURCES}
${UNLEASHED_RECOMP_OS_CXX_SOURCES}
${UNLEASHED_RECOMP_CPU_CXX_SOURCES}
${UNLEASHED_RECOMP_GPU_CXX_SOURCES}
${UNLEASHED_RECOMP_APU_CXX_SOURCES}
${UNLEASHED_RECOMP_HID_CXX_SOURCES}
${UNLEASHED_RECOMP_PATCHES_CXX_SOURCES}
${UNLEASHED_RECOMP_UI_CXX_SOURCES}
${UNLEASHED_RECOMP_INSTALL_CXX_SOURCES}
${UNLEASHED_RECOMP_USER_CXX_SOURCES}
${UNLEASHED_RECOMP_MOD_CXX_SOURCES}
${UNLEASHED_RECOMP_THIRDPARTY_SOURCES}
)
if (WIN32)
# Set up Win32 resources for application icon.
set(ICON_PATH "${PROJECT_SOURCE_DIR}/../UnleashedRecompResources/images/game_icon.ico")
configure_file("res/win32/res.rc.template" "${CMAKE_BINARY_DIR}/res.rc" @ONLY)
add_executable(UnleashedRecomp ${SWA_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc")
add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES} "${CMAKE_BINARY_DIR}/res.rc")
else()
add_executable(UnleashedRecomp ${SWA_CXX_SOURCES})
add_executable(UnleashedRecomp ${UNLEASHED_RECOMP_CXX_SOURCES})
endif()
set_target_properties(UnleashedRecomp PROPERTIES OUTPUT_NAME ${TARGET_NAME})
if (SWA_FLATPAK)
if (UNLEASHED_RECOMP_FLATPAK)
target_compile_definitions(UnleashedRecomp PRIVATE "GAME_INSTALL_DIRECTORY=\"/var/data\"")
endif()
if (SWA_D3D12)
if (UNLEASHED_RECOMP_D3D12)
find_package(directx-headers CONFIG REQUIRED)
find_package(directx12-agility CONFIG REQUIRED)
target_compile_definitions(UnleashedRecomp PRIVATE SWA_D3D12)
target_compile_definitions(UnleashedRecomp PRIVATE UNLEASHED_RECOMP_D3D12)
endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
@ -286,7 +282,7 @@ endif()
find_package(directx-dxc REQUIRED)
if (SWA_D3D12)
if (UNLEASHED_RECOMP_D3D12)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/D3D12)
add_custom_command(TARGET UnleashedRecomp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_PROPERTY:Microsoft::DirectX12-Core,IMPORTED_LOCATION_RELEASE> ${CMAKE_CURRENT_BINARY_DIR}/D3D12
@ -324,7 +320,7 @@ target_link_libraries(UnleashedRecomp PRIVATE
msdf-atlas-gen::msdf-atlas-gen
nfd::nfd
o1heap
PowerUtils
XenonUtils
SDL2::SDL2-static
SDL2_mixer
tomlplusplus::tomlplusplus
@ -335,7 +331,7 @@ target_link_libraries(UnleashedRecomp PRIVATE
target_include_directories(UnleashedRecomp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/api"
${SWA_THIRDPARTY_INCLUDES}
${UNLEASHED_RECOMP_THIRDPARTY_INCLUDES}
)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
@ -344,12 +340,12 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(UnleashedRecomp PRIVATE ${X11_LIBRARIES})
endif()
target_precompile_headers(UnleashedRecomp PUBLIC ${SWA_PRECOMPILED_HEADERS})
target_precompile_headers(UnleashedRecomp PUBLIC ${UNLEASHED_RECOMP_PRECOMPILED_HEADERS})
function(compile_shader FILE_PATH TARGET_NAME)
set(FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu/shader/${FILE_PATH}.hlsl)
cmake_path(GET FILE_PATH STEM VARIABLE_NAME)
if (SWA_D3D12)
if (UNLEASHED_RECOMP_D3D12)
add_custom_command(
OUTPUT ${FILE_PATH}.dxil.h
COMMAND ${DIRECTX_DXC_TOOL} -T ${TARGET_NAME} -HV 2021 -all-resources-bound -Wno-ignored-attributes -Fh ${FILE_PATH}.dxil.h ${FILE_PATH} -Vn g_${VARIABLE_NAME}_dxil

View file

@ -7,11 +7,9 @@
// Number of samples in a frame
#define XAUDIO_NUM_SAMPLES 256
#ifdef SWA_IMPL
void XAudioInitializeSystem();
void XAudioRegisterClient(PPCFunc* callback, uint32_t param);
void XAudioSubmitFrame(void* samples);
#endif
uint32_t XAudioRegisterRenderDriverClient(be<uint32_t>* callback, be<uint32_t>* driver);
uint32_t XAudioUnregisterRenderDriverClient(uint32_t driver);

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -1,4 +1,4 @@
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -1,6 +1,6 @@
#pragma once
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef __spirv__

View file

@ -34,9 +34,9 @@
#include <magic_enum/magic_enum.hpp>
#endif
#include "../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
#include "../../tools/XenosRecomp/XenosRecomp/shader_common.h"
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
#include "shader/copy_vs.hlsl.dxil.h"
#include "shader/csd_filter_ps.hlsl.dxil.h"
#include "shader/csd_no_tex_vs.hlsl.dxil.h"
@ -84,7 +84,7 @@ extern "C"
namespace plume
{
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
extern std::unique_ptr<RenderInterface> CreateD3D12Interface();
#endif
#ifdef SDL_VULKAN_ENABLED
@ -198,7 +198,7 @@ static void SetDirtyValue(bool& dirtyState, T& dest, const T& src)
}
}
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
static bool g_vulkan = false;
#else
static constexpr bool g_vulkan = true;
@ -619,7 +619,7 @@ static void LoadEmbeddedResources()
g_shaderCache = std::make_unique<uint8_t[]>(g_spirvCacheDecompressedSize);
ZSTD_decompress(g_shaderCache.get(), g_spirvCacheDecompressedSize, g_compressedSpirvCache, g_spirvCacheCompressedSize);
}
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
else
{
g_shaderCache = std::make_unique<uint8_t[]>(g_dxilCacheDecompressedSize);
@ -1111,7 +1111,7 @@ static GuestShader* g_csdShader;
static std::unique_ptr<GuestShader> g_enhancedMotionBlurShader;
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
#define CREATE_SHADER(NAME) \
g_device->createShader( \
@ -1440,7 +1440,7 @@ void Video::CreateHostDevice(const char *sdlVideoDriver)
GameWindow::Init(sdlVideoDriver);
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
g_vulkan = DetectWine() || Config::GraphicsAPI == EGraphicsAPI::Vulkan;
#endif
@ -1452,7 +1452,7 @@ void Video::CreateHostDevice(const char *sdlVideoDriver)
#else
g_interface = CreateVulkanInterface();
#endif
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
else
g_interface = CreateD3D12Interface();
#endif
@ -3108,7 +3108,7 @@ static RenderShader* GetOrLinkShader(GuestShader* guestShader, uint32_t specCons
shader = guestShader->linkedShaders[specConstants].get();
}
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
if (shader == nullptr)
{
static Mutex g_compiledSpecConstantLibraryBlobMutex;

View file

@ -285,7 +285,7 @@ struct GuestShader : GuestResource
std::unique_ptr<RenderShader> shader;
struct ShaderCacheEntry* shaderCacheEntry = nullptr;
ankerl::unordered_dense::map<uint32_t, std::unique_ptr<RenderShader>> linkedShaders;
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
std::vector<ComPtr<IDxcBlob>> shaderBlobs;
ComPtr<IDxcBlobEncoding> libraryBlob;
#endif

View file

@ -13,7 +13,7 @@ using Microsoft::WRL::ComPtr;
#include <pwd.h>
#endif
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
#include <dxcapi.h>
#endif

View file

@ -214,7 +214,7 @@ void GameWindow::Init(const char* sdlVideoDriver)
if (!IsPositionValid())
GameWindow::ResetDimensions();
s_pWindow = SDL_CreateWindow("SWA", s_x, s_y, s_width, s_height, GetWindowFlags());
s_pWindow = SDL_CreateWindow("Unleashed Recompiled", s_x, s_y, s_width, s_height, GetWindowFlags());
if (IsFullscreen())
SDL_ShowCursor(SDL_DISABLE);

View file

@ -45,7 +45,7 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EVoiceLanguage)
CONFIG_DEFINE_ENUM_TEMPLATE(EGraphicsAPI)
{
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
{ "D3D12", EGraphicsAPI::D3D12 },
#endif
{ "Vulkan", EGraphicsAPI::Vulkan }

View file

@ -56,7 +56,7 @@ enum class EVoiceLanguage : uint32_t
enum class EGraphicsAPI : uint32_t
{
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
D3D12,
#endif
Vulkan

View file

@ -21,7 +21,7 @@ CONFIG_DEFINE_LOCALISED("Audio", bool, Subtitles, true);
CONFIG_DEFINE_LOCALISED("Audio", bool, MusicAttenuation, false);
CONFIG_DEFINE_LOCALISED("Audio", bool, BattleTheme, true);
#ifdef SWA_D3D12
#ifdef UNLEASHED_RECOMP_D3D12
CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12);
#else
CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::Vulkan);

View file

@ -2,7 +2,7 @@
#include <mod/mod_loader.h>
#define USER_DIRECTORY "SWA"
#define USER_DIRECTORY "UnleashedRecomp"
#ifndef GAME_INSTALL_DIRECTORY
#define GAME_INSTALL_DIRECTORY "."

View file

@ -12,11 +12,11 @@ else()
add_compile_options(-ffp-model=strict)
endif()
target_compile_definitions(PowerRecomp PRIVATE
CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\"
HEADER_FILE_PATH=\"${SWA_TOOLS_ROOT}/PowerRecomp/PowerUtils/ppc_context.h\")
target_compile_definitions(XenonRecomp PRIVATE
XENON_RECOMP_CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\"
XENON_RECOMP_HEADER_FILE_PATH=\"${UNLEASHED_RECOMP_TOOLS_ROOT}/XenonRecomp/XenonUtils/ppc_context.h\")
set(SWA_PPC_RECOMPILED_SOURCES
set(UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_config.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_context.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_func_mapping.cpp"
@ -24,37 +24,37 @@ set(SWA_PPC_RECOMPILED_SOURCES
)
foreach(i RANGE 0 260)
list(APPEND SWA_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp.${i}.cpp")
list(APPEND UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp.${i}.cpp")
endforeach()
add_custom_command(
OUTPUT ${SWA_PPC_RECOMPILED_SOURCES}
COMMAND $<TARGET_FILE:PowerRecomp>
OUTPUT ${UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES}
COMMAND $<TARGET_FILE:XenonRecomp>
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/default.xex" "${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml"
)
set(SHADER_RECOMP_ROOT "${SWA_TOOLS_ROOT}/ShaderRecomp/ShaderRecomp")
set(SHADER_RECOMP_INCLUDE "${SHADER_RECOMP_ROOT}/shader_common.h")
set(XENOS_RECOMP_ROOT "${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp/XenosRecomp")
set(XENOS_RECOMP_INCLUDE "${XENOS_RECOMP_ROOT}/shader_common.h")
target_compile_definitions(ShaderRecomp PRIVATE
SHADER_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\"
SHADER_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\"
SHADER_RECOMP_INCLUDE_INPUT=\"${SHADER_RECOMP_INCLUDE}\"
target_compile_definitions(XenosRecomp PRIVATE
XENOS_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\"
XENOS_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\"
XENOS_RECOMP_INCLUDE_INPUT=\"${XENOS_RECOMP_INCLUDE}\"
)
file(GLOB SHADER_RECOMP_SOURCES
"${SHADER_RECOMP_ROOT}/*.h"
"${SHADER_RECOMP_ROOT}/*.cpp"
file(GLOB XENOS_RECOMP_SOURCES
"${XENOS_RECOMP_ROOT}/*.h"
"${XENOS_RECOMP_ROOT}/*.cpp"
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp"
COMMAND $<TARGET_FILE:ShaderRecomp>
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${SHADER_RECOMP_SOURCES} ${SHADER_RECOMP_INCLUDE}
COMMAND $<TARGET_FILE:XenosRecomp>
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${XENOS_RECOMP_SOURCES} ${XENOS_RECOMP_INCLUDE}
)
add_library(UnleashedRecompLib
${SWA_PPC_RECOMPILED_SOURCES}
${UNLEASHED_RECOMP_PPC_RECOMPILED_SOURCES}
"shader/shader_cache.h"
"shader/shader_cache.cpp"
)

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Name=Unleashed Recompiled
Exec=/app/bin/SWA
Exec=/app/bin/UnleashedRecomp
Type=Application
Icon=io.github.hedge_dev.unleashedrecomp
Categories=Game;

View file

@ -20,10 +20,10 @@
"name": "UnleashedRecomp",
"buildsystem": "simple",
"build-commands": [
"cmake --preset linux-release -DSWA_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE",
"cmake --preset linux-release -DUNLEASHED_RECOMP_FLATPAK=ON -DSDL2MIXER_VORBIS=VORBISFILE",
"cmake --build out/build/linux-release",
"mkdir -p /app/bin",
"cp out/build/linux-release/UnleashedRecomp/SWA /app/bin/SWA",
"cp out/build/linux-release/UnleashedRecomp/UnleashedRecomp /app/bin/UnleashedRecomp",
"install -Dm644 UnleashedRecompResources/images/game_icon.png /app/share/icons/hicolor/128x128/apps/${FLATPAK_ID}.png",
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml",
"install -Dm644 flatpak/io.github.hedge_dev.unleashedrecomp.desktop /app/share/applications/${FLATPAK_ID}.desktop"

View file

@ -15,8 +15,8 @@ set(SDL2MIXER_OPUS OFF)
set(SDL2MIXER_VORBIS "VORBISFILE")
set(SDL2MIXER_WAVPACK OFF)
add_subdirectory("${SWA_THIRDPARTY_ROOT}/msdf-atlas-gen")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/nativefiledialog-extended")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/o1heap")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL")
add_subdirectory("${SWA_THIRDPARTY_ROOT}/SDL_mixer")
add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/msdf-atlas-gen")
add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/nativefiledialog-extended")
add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/o1heap")
add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/SDL")
add_subdirectory("${UNLEASHED_RECOMP_THIRDPARTY_ROOT}/SDL_mixer")

View file

@ -1,5 +1,5 @@
add_subdirectory(${SWA_TOOLS_ROOT}/bc_diff)
add_subdirectory(${SWA_TOOLS_ROOT}/file_to_c)
add_subdirectory(${SWA_TOOLS_ROOT}/fshasher)
add_subdirectory(${SWA_TOOLS_ROOT}/PowerRecomp)
add_subdirectory(${SWA_TOOLS_ROOT}/ShaderRecomp)
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/bc_diff)
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/file_to_c)
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/fshasher)
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/XenonRecomp)
add_subdirectory(${UNLEASHED_RECOMP_TOOLS_ROOT}/XenosRecomp)

@ -1 +0,0 @@
Subproject commit 7fb8af1bad9ecb22d5fa9c1b72555cdf7c22db02

@ -1 +0,0 @@
Subproject commit 66c618cc72db3a46778caa9b9dd1a5328e8c3765

1
tools/XenonRecomp Submodule

@ -0,0 +1 @@
Subproject commit 87e350906ba41cb01aedcc6cb3a94aac24d75251

1
tools/XenosRecomp Submodule

@ -0,0 +1 @@
Subproject commit ab277869d428295fe6398b5f2708f20b6998e6cb