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

View file

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

View file

@ -6,6 +6,7 @@
#include <functional>
#include "video_core/regs_pipeline.h"
namespace boost::serialization { class access; }
namespace Pica {
@ -62,6 +63,17 @@ private:
VertexType buffer[2];
bool strip_ready = 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

View file

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