Serialize primitive_assembly

This commit is contained in:
Hamish Milne 2019-12-22 16:06:26 +00:00 committed by zhupengfei
parent c284192a87
commit 050c3bdee5
4 changed files with 20 additions and 2 deletions

5
TODO
View File

@ -7,16 +7,19 @@
☐ Perf stats ☐ Perf stats
☐ Settings ☐ Settings
☐ Telemetry session ☐ Telemetry session
☐ Replace SERIALIZE_AS_POD with BOOST_IS_BITWISE_SERIALIZABLE
✔ HW @done(19-08-13 15:41) ✔ HW @done(19-08-13 15:41)
✔ GPU regs @done(19-08-13 15:41) ✔ GPU regs @done(19-08-13 15:41)
✔ LCD regs @done(19-08-13 15:41) ✔ LCD regs @done(19-08-13 15:41)
☐ Video core @started(19-08-13 16:43) ☐ Video core @started(19-08-13 16:43)
✔ Geometry pipeline @done(19-12-22 15:52) ✔ Geometry pipeline @done(19-12-22 15:52)
Required more use of g_state
✔ PICA state @done(19-08-13 15:41) ✔ PICA state @done(19-08-13 15:41)
☐ Primitive assembly ✔ Primitive assembly @done(19-12-22 16:05)
✔ Shader @done(19-08-13 16:03) ✔ Shader @done(19-08-13 16:03)
☐ HLE @started(19-08-13 16:43) ☐ HLE @started(19-08-13 16:43)
☐ Kernel @started(19-08-13 16:43) ☐ Kernel @started(19-08-13 16:43)
Most of these require adding g_kernel
✔ Address arbiter @done(19-08-13 16:40) ✔ Address arbiter @done(19-08-13 16:40)
✔ Client port @done(19-08-13 16:40) ✔ Client port @done(19-08-13 16:40)
✔ Client session @done(19-08-13 16:40) ✔ Client session @done(19-08-13 16:40)

View File

@ -228,7 +228,7 @@ private:
ar & immediate; ar & immediate;
ar & gs_unit; ar & gs_unit;
ar & geometry_pipeline; ar & geometry_pipeline;
// ar & primitive_assembler; ar & primitive_assembler;
ar & vs_float_regs_counter; ar & vs_float_regs_counter;
ar & vs_uniform_write_buffer; ar & vs_uniform_write_buffer;
ar & gs_float_regs_counter; ar & gs_float_regs_counter;

View File

@ -6,6 +6,7 @@
#include <functional> #include <functional>
#include "video_core/regs_pipeline.h" #include "video_core/regs_pipeline.h"
namespace boost::serialization { class access; }
namespace Pica { namespace Pica {
@ -62,6 +63,17 @@ private:
VertexType buffer[2]; VertexType buffer[2];
bool strip_ready = false; bool strip_ready = false;
bool winding = false; bool winding = false;
template <class Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar & topology;
ar & buffer_index;
ar & buffer;
ar & strip_ready;
ar & winding;
}
friend class boost::serialization::access;
}; };
} // namespace Pica } // namespace Pica

View File

@ -16,6 +16,7 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "common/hash.h" #include "common/hash.h"
#include "common/vector_math.h" #include "common/vector_math.h"
#include "common/pod.h"
#include "video_core/pica_types.h" #include "video_core/pica_types.h"
#include "video_core/regs_rasterizer.h" #include "video_core/regs_rasterizer.h"
#include "video_core/regs_shader.h" #include "video_core/regs_shader.h"
@ -64,6 +65,8 @@ struct OutputVertex {
static void ValidateSemantics(const RasterizerRegs& regs); static void ValidateSemantics(const RasterizerRegs& regs);
static OutputVertex FromAttributeBuffer(const RasterizerRegs& regs, static OutputVertex FromAttributeBuffer(const RasterizerRegs& regs,
const AttributeBuffer& output); const AttributeBuffer& output);
SERIALIZE_AS_POD
}; };
#define ASSERT_POS(var, pos) \ #define ASSERT_POS(var, pos) \
static_assert(offsetof(OutputVertex, var) == pos * sizeof(float24), "Semantic at wrong " \ static_assert(offsetof(OutputVertex, var) == pos * sizeof(float24), "Semantic at wrong " \