mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2024-11-21 20:49:15 +01:00
Remove shader cache and make it optional (#238)
This commit is contained in:
parent
26f5fcc952
commit
466b766cfa
@ -87,11 +87,15 @@ add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/RecompiledPatches/patches_bin.c
|
|||||||
DEPENDS ${CMAKE_SOURCE_DIR}/patches/patches.bin
|
DEPENDS ${CMAKE_SOURCE_DIR}/patches/patches.bin
|
||||||
)
|
)
|
||||||
|
|
||||||
# Generate mm_shader_cache.c from the MM shader cache
|
# Generate mm_shader_cache.c from the MM shader cache if it exists
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.c ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.h
|
if (EXISTS ${CMAKE_SOURCE_DIR}/shadercache/mm_shader_cache.bin)
|
||||||
COMMAND file_to_c ${CMAKE_SOURCE_DIR}/shadercache/mm_shader_cache.bin mm_shader_cache_bytes ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.c ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.h
|
set(HAS_MM_SHADER_CACHE TRUE)
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/shadercache/mm_shader_cache.bin
|
add_compile_definitions(HAS_MM_SHADER_CACHE)
|
||||||
)
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.c ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.h
|
||||||
|
COMMAND file_to_c ${CMAKE_SOURCE_DIR}/shadercache/mm_shader_cache.bin mm_shader_cache_bytes ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.c ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.h
|
||||||
|
DEPENDS ${CMAKE_SOURCE_DIR}/shadercache/mm_shader_cache.bin
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Recompile patches elf into patches.c
|
# Recompile patches elf into patches.c
|
||||||
add_custom_command(OUTPUT
|
add_custom_command(OUTPUT
|
||||||
@ -159,10 +163,12 @@ set (SOURCES
|
|||||||
${CMAKE_SOURCE_DIR}/rsp/njpgdspMain.cpp
|
${CMAKE_SOURCE_DIR}/rsp/njpgdspMain.cpp
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/lib/RmlUi/Backends/RmlUi_Platform_SDL.cpp
|
${CMAKE_SOURCE_DIR}/lib/RmlUi/Backends/RmlUi_Platform_SDL.cpp
|
||||||
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (HAS_MM_SHADER_CACHE)
|
||||||
|
list(APPEND SOURCES ${CMAKE_CURRENT_BINARY_DIR}/mm_shader_cache.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(Zelda64Recompiled PRIVATE
|
target_include_directories(Zelda64Recompiled PRIVATE
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
${CMAKE_SOURCE_DIR}/lib/concurrentqueue
|
${CMAKE_SOURCE_DIR}/lib/concurrentqueue
|
||||||
|
0
shadercache/.gitkeep
Normal file
0
shadercache/.gitkeep
Normal file
Binary file not shown.
@ -17,7 +17,9 @@
|
|||||||
#include "xxHash/xxh3.h"
|
#include "xxHash/xxh3.h"
|
||||||
#include "../ultramodern/ultramodern.hpp"
|
#include "../ultramodern/ultramodern.hpp"
|
||||||
#include "../../RecompiledPatches/patches_bin.h"
|
#include "../../RecompiledPatches/patches_bin.h"
|
||||||
|
#ifdef HAS_MM_SHADER_CACHE
|
||||||
#include "mm_shader_cache.h"
|
#include "mm_shader_cache.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
inline uint32_t byteswap(uint32_t val) {
|
inline uint32_t byteswap(uint32_t val) {
|
||||||
@ -411,7 +413,11 @@ void recomp::start(ultramodern::WindowHandle window_handle, const ultramodern::a
|
|||||||
if (!recomp::load_stored_rom(recomp::Game::MM)) {
|
if (!recomp::load_stored_rom(recomp::Game::MM)) {
|
||||||
recomp::message_box("Error opening stored ROM! Please restart this program.");
|
recomp::message_box("Error opening stored ROM! Please restart this program.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAS_MM_SHADER_CACHE
|
||||||
ultramodern::load_shader_cache({mm_shader_cache_bytes, sizeof(mm_shader_cache_bytes)});
|
ultramodern::load_shader_cache({mm_shader_cache_bytes, sizeof(mm_shader_cache_bytes)});
|
||||||
|
#endif
|
||||||
|
|
||||||
init(rdram, &context);
|
init(rdram, &context);
|
||||||
try {
|
try {
|
||||||
recomp_entrypoint(rdram, &context);
|
recomp_entrypoint(rdram, &context);
|
||||||
|
Loading…
Reference in New Issue
Block a user