mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
rsx: implement serialization of rsx states.
This commit is contained in:
parent
2528fc4555
commit
15500d4ee9
4 changed files with 47 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include "Utilities/Thread.h"
|
#include "Utilities/Thread.h"
|
||||||
#include "Utilities/Timer.h"
|
#include "Utilities/Timer.h"
|
||||||
#include "Utilities/geometry.h"
|
#include "Utilities/geometry.h"
|
||||||
|
#include "rsx_trace.h"
|
||||||
|
|
||||||
extern u64 get_system_time();
|
extern u64 get_system_time();
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
#include "rsx_decode.h"
|
#include "rsx_decode.h"
|
||||||
#include "Emu/Cell/PPUCallback.h"
|
#include "Emu/Cell/PPUCallback.h"
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
|
#include <cereal/archives/binary.hpp>
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -723,6 +726,13 @@ namespace rsx
|
||||||
else if (rsx->capture_current_frame)
|
else if (rsx->capture_current_frame)
|
||||||
{
|
{
|
||||||
rsx->capture_current_frame = false;
|
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();
|
Emu.Pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
#include "rsx_vertex_data.h"
|
#include "rsx_vertex_data.h"
|
||||||
#include "Utilities/geometry.h"
|
#include "Utilities/geometry.h"
|
||||||
|
|
||||||
|
#include <cereal/types/array.hpp>
|
||||||
|
#include <cereal/types/unordered_map.hpp>
|
||||||
|
|
||||||
namespace rsx
|
namespace rsx
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
|
@ -123,6 +126,15 @@ namespace rsx
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
template<typename Archive>
|
||||||
|
void serialize(Archive & ar)
|
||||||
|
{
|
||||||
|
ar(transform_program,
|
||||||
|
// transform_constants,
|
||||||
|
registers
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
u16 viewport_width() const
|
u16 viewport_width() const
|
||||||
{
|
{
|
||||||
return decode<NV4097_SET_VIEWPORT_HORIZONTAL>().width();
|
return decode<NV4097_SET_VIEWPORT_HORIZONTAL>().width();
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
#include "Utilities/types.h"
|
#include "Utilities/types.h"
|
||||||
#include "rsx_methods.h"
|
#include "rsx_methods.h"
|
||||||
|
|
||||||
|
#include <cereal/types/vector.hpp>
|
||||||
|
#include <cereal/types/array.hpp>
|
||||||
|
#include <cereal/types/string.hpp>
|
||||||
|
#include <cereal/types/utility.hpp>
|
||||||
|
|
||||||
namespace rsx
|
namespace rsx
|
||||||
{
|
{
|
||||||
struct frame_capture_data
|
struct frame_capture_data
|
||||||
|
@ -18,10 +23,29 @@ struct frame_capture_data
|
||||||
std::array<std::vector<gsl::byte>, 2> depth_stencil;
|
std::array<std::vector<gsl::byte>, 2> depth_stencil;
|
||||||
std::vector<gsl::byte> index;
|
std::vector<gsl::byte> index;
|
||||||
u32 vertex_count;
|
u32 vertex_count;
|
||||||
|
|
||||||
|
template<typename Archive>
|
||||||
|
void serialize(Archive & ar)
|
||||||
|
{
|
||||||
|
ar(name);
|
||||||
|
ar(programs);
|
||||||
|
ar(state);
|
||||||
|
ar(color_buffer);
|
||||||
|
ar(depth_stencil);
|
||||||
|
ar(index);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
std::vector<std::pair<u32, u32> > command_queue;
|
std::vector<std::pair<u32, u32> > command_queue;
|
||||||
std::vector<draw_state> draw_calls;
|
std::vector<draw_state> draw_calls;
|
||||||
|
|
||||||
|
template<typename Archive>
|
||||||
|
void serialize(Archive & ar)
|
||||||
|
{
|
||||||
|
ar(command_queue);
|
||||||
|
ar(draw_calls);
|
||||||
|
}
|
||||||
|
|
||||||
void reset()
|
void reset()
|
||||||
{
|
{
|
||||||
command_queue.clear();
|
command_queue.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue