mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-12 22:14:58 +00:00
rsx: implement serialization of rsx states.
This commit is contained in:
parent
2528fc4555
commit
15500d4ee9
@ -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();
|
||||
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include "rsx_decode.h"
|
||||
#include "Emu/Cell/PPUCallback.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <cereal/archives/binary.hpp>
|
||||
|
||||
#include <thread>
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,9 @@
|
||||
#include "rsx_vertex_data.h"
|
||||
#include "Utilities/geometry.h"
|
||||
|
||||
#include <cereal/types/array.hpp>
|
||||
#include <cereal/types/unordered_map.hpp>
|
||||
|
||||
namespace rsx
|
||||
{
|
||||
//TODO
|
||||
@ -123,6 +126,15 @@ namespace rsx
|
||||
|
||||
void reset();
|
||||
|
||||
template<typename Archive>
|
||||
void serialize(Archive & ar)
|
||||
{
|
||||
ar(transform_program,
|
||||
// transform_constants,
|
||||
registers
|
||||
);
|
||||
}
|
||||
|
||||
u16 viewport_width() const
|
||||
{
|
||||
return decode<NV4097_SET_VIEWPORT_HORIZONTAL>().width();
|
||||
|
@ -5,6 +5,11 @@
|
||||
#include "Utilities/types.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
|
||||
{
|
||||
struct frame_capture_data
|
||||
@ -18,10 +23,29 @@ struct frame_capture_data
|
||||
std::array<std::vector<gsl::byte>, 2> depth_stencil;
|
||||
std::vector<gsl::byte> index;
|
||||
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<draw_state> draw_calls;
|
||||
|
||||
template<typename Archive>
|
||||
void serialize(Archive & ar)
|
||||
{
|
||||
ar(command_queue);
|
||||
ar(draw_calls);
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
command_queue.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user