diff --git a/.gitmodules b/.gitmodules index 2be86e3e76..103d9d0a46 100644 --- a/.gitmodules +++ b/.gitmodules @@ -35,3 +35,6 @@ [submodule "3rdparty/pugixml"] path = 3rdparty/pugixml url = https://github.com/RPCS3/pugixml +[submodule "3rdparty/cereal"] + path = 3rdparty/cereal + url = https://github.com/USCiLab/cereal.git diff --git a/.travis.yml b/.travis.yml index b4f8cf990a..cd41a3a39c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ before_install: fi; before_script: - - git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp + - git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal - mkdir build - cd build - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake ..; else cmake .. -DLLVM_DIR=/usr/local/opt/llvm36/lib/llvm-3.6/share/llvm/cmake; fi diff --git a/3rdparty/cereal b/3rdparty/cereal new file mode 160000 index 0000000000..42a45b6e15 --- /dev/null +++ b/3rdparty/cereal @@ -0,0 +1 @@ +Subproject commit 42a45b6e15fcbd1a3d65b033f5d4d0b2ef6c023d diff --git a/appveyor.yml b/appveyor.yml index a7b1f35e28..1d79648ae6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ test: off before_build: # until git for win 2.5 release with commit checkout - - git submodule update --init 3rdparty/ffmpeg 3rdparty/pugixml asmjit 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp rsx_program_decompiler + - git submodule update --init 3rdparty/ffmpeg 3rdparty/pugixml asmjit 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp rsx_program_decompiler 3rdparty/cereal - 7z x wxWidgets.7z -aos -oC:\rpcs3\wxWidgets > null - 7z x zlib.7z -aos -oC:\rpcs3\ > null - 7z x vulkan.7z -aos -oC:\rpcs3\Vulkan > null diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index c1b5e9649c..84cc0df059 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -135,6 +135,7 @@ ${LLVM_INCLUDE_DIRS} "${RPCS3_SRC_DIR}/../3rdparty/stblib" "${RPCS3_SRC_DIR}/../rsx_program_decompiler/rsx_decompiler" "${RPCS3_SRC_DIR}/../rsx_program_decompiler/shader_code" +"${RPCS3_SRC_DIR}/../3rdparty/cereal/include" ) if(WIN32) include_directories(BEFORE "${RPCS3_SRC_DIR}/../3rdparty/XAudio2_7") # Slimmed down version of minidx9 for XAudio2_7 only diff --git a/rpcs3/Emu/Memory/vm.h b/rpcs3/Emu/Memory/vm.h index 19f1f29b5f..a83823b301 100644 --- a/rpcs3/Emu/Memory/vm.h +++ b/rpcs3/Emu/Memory/vm.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include class thread_ctrl; diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 77cb887e8c..6bdedfca24 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -15,6 +15,7 @@ #include "Utilities/Thread.h" #include "Utilities/Timer.h" #include "Utilities/geometry.h" +#include "rsx_trace.h" extern u64 get_system_time(); diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 973241592a..bfb41544bc 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -8,6 +8,9 @@ #include "rsx_decode.h" #include "Emu/Cell/PPUCallback.h" +#include +#include + #include #include #include @@ -723,6 +726,13 @@ namespace rsx else if (rsx->capture_current_frame) { rsx->capture_current_frame = false; + std::stringstream os; + cereal::BinaryOutputArchive archive(os); + archive(frame_debug); + { + fs::file f(fs::get_config_dir() + "capture.txt", fs::rewrite); + f.write(os.str()); + } Emu.Pause(); } diff --git a/rpcs3/Emu/RSX/rsx_methods.h b/rpcs3/Emu/RSX/rsx_methods.h index b4ebddd00f..4ef9d34793 100644 --- a/rpcs3/Emu/RSX/rsx_methods.h +++ b/rpcs3/Emu/RSX/rsx_methods.h @@ -9,6 +9,9 @@ #include "rsx_vertex_data.h" #include "Utilities/geometry.h" +#include +#include + namespace rsx { //TODO @@ -123,6 +126,15 @@ namespace rsx void reset(); + template + void serialize(Archive & ar) + { + ar(transform_program, +// transform_constants, + registers + ); + } + u16 viewport_width() const { return decode().width(); diff --git a/rpcs3/Emu/RSX/rsx_trace.h b/rpcs3/Emu/RSX/rsx_trace.h index 8bbaadbd29..8d5c424228 100644 --- a/rpcs3/Emu/RSX/rsx_trace.h +++ b/rpcs3/Emu/RSX/rsx_trace.h @@ -5,6 +5,11 @@ #include "Utilities/types.h" #include "rsx_methods.h" +#include +#include +#include +#include + namespace rsx { struct frame_capture_data @@ -18,10 +23,29 @@ struct frame_capture_data std::array, 2> depth_stencil; std::vector index; u32 vertex_count; + + template + void serialize(Archive & ar) + { + ar(name); + ar(programs); + ar(state); + ar(color_buffer); + ar(depth_stencil); + ar(index); + } + }; std::vector > command_queue; std::vector draw_calls; + template + void serialize(Archive & ar) + { + ar(command_queue); + ar(draw_calls); + } + void reset() { command_queue.clear(); diff --git a/rpcs3_default.props b/rpcs3_default.props index 5466d413c5..92456daf1b 100644 --- a/rpcs3_default.props +++ b/rpcs3_default.props @@ -3,7 +3,7 @@ - .\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\wxWidgets\src\zlib;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src + .\;..\;..\asmjit\src\asmjit;..\Utilities\yaml-cpp\include;..\wxWidgets\src\zlib;..\3rdparty\ffmpeg\WindowsInclude;..\3rdparty\cereal\include;..\3rdparty\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(UniversalCRT_IncludePath);..\3rdparty\minidx12\Include;..\3rdparty\GSL\include;..\3rdparty\libpng;..\3rdparty\GL;..\3rdparty\stblib;..\3rdparty\OpenAL\include;..\3rdparty\pugixml\src $(SolutionDir)lib\$(Configuration)-$(Platform)\ $(SolutionDir)lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath) $(SolutionDir)tmp\$(ProjectName)-$(Configuration)-$(Platform)\