UnleashedRecomp/UnleashedRecompLib/CMakeLists.txt
Skyth (Asilkan) d36aa26bac
Specialization constants, reverse Z and async PSO implementation. (#9)
* Specialization constant implementation for Vulkan.

* Implement DXIL library linking.

* Implement proper reverse Z & fix motion blur flicker.

* Mirage API mapping.

* Initial work for async PSO.

* Further async PSO work.

* Set pipeline names.

* Handle special layers writing depth.

* Handle bones in shadow pipeline.

* Fix additive mode setting wrong pipeline field.

* Pass models to compilation threads through shared pointers.

* Safety improvements.

* Allow DXIL linking to happen in parallel.

* Display more debug information.

* Queue unique models for compilation immediately.

* Put async PSO debug printing behind a macro.

* Kick off terrain models to pipeline compilation thread the moment they are made.

* Hook a different function to do waiting in.

* Fix pipelines getting dropped.

* Account for ConstTexCoord.

* Fix async PSO accounting for alpha to coverage even when MSAA is off.

* Remove "has bone" specialization constant.

* Sky shader compilation & more debugging helpers.

* Assign names to shaders during loading.

* Fix string symbol definitions.

* Print description of recently compiled render thread pipelines.

* Switch to an enum library that doesn't murder IntelliSense.

* Precompile pipelines for object icons.

* Skip fur pipelines.

* Skip printing info for pipelines compiled during loading.

* Precompile pipelines for Sonic's mouth, motion blur, and forced transparent objects.

* Precompile planar reflection shaders.

* Precompile sparkle shaders in loading screens.

* Precompile fur shader.

* Refactor model traversing to enqueue every single compilation to worker threads.

* Dynamically create pipeline threads depending on hardware concurrency.

* Fix MSAA depth resolve not accounting for reverse Z.

* Integrate smol-v.

* Implement PSO caching.

* Update ShaderRecomp & remove unused function.
2024-11-29 23:30:48 +03:00

55 lines
1.8 KiB
CMake

project("UnleashedRecompLib")
add_compile_options(
"/fp:strict"
"-march=sandybridge"
"-fno-strict-aliasing"
)
target_compile_definitions(PowerRecomp PRIVATE CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\")
set(SWA_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"
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp_shared.h"
)
foreach(i RANGE 0 260)
list(APPEND SWA_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp.${i}.cpp")
endforeach()
add_custom_command(
OUTPUT ${SWA_PPC_RECOMPILED_SOURCES}
COMMAND PowerRecomp
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/default.xex" "${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml"
)
set(SHADER_RECOMP_ROOT "${SWA_THIRDPARTY_ROOT}/ShaderRecomp/ShaderRecomp")
set(SHADER_RECOMP_INCLUDE "${SHADER_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}\"
)
file(GLOB SHADER_RECOMP_SOURCES
"${SHADER_RECOMP_ROOT}/*.h"
"${SHADER_RECOMP_ROOT}/*.cpp"
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp"
COMMAND ShaderRecomp
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${SHADER_RECOMP_SOURCES} ${SHADER_RECOMP_INCLUDE}
)
add_library(UnleashedRecompLib
${SWA_PPC_RECOMPILED_SOURCES}
"shader/shader_cache.h"
"shader/shader_cache.cpp"
)
target_include_directories(UnleashedRecompLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_precompile_headers(UnleashedRecompLib PUBLIC "ppc/ppc_recomp_shared.h")