mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 10:48:36 +12:00
Improve bitwise serialization trait
This commit is contained in:
parent
9cbcce671d
commit
76bfe54c7e
7 changed files with 15 additions and 15 deletions
|
@ -29,7 +29,7 @@ namespace vm
|
||||||
using type = T;
|
using type = T;
|
||||||
using addr_type = std::remove_cv_t<AT>;
|
using addr_type = std::remove_cv_t<AT>;
|
||||||
|
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
_ptr_base() = default;
|
_ptr_base() = default;
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ namespace vm
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using addr_type = std::remove_cv_t<AT>;
|
using addr_type = std::remove_cv_t<AT>;
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
_ptr_base() = default;
|
_ptr_base() = default;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace vm
|
||||||
|
|
||||||
_var_base& operator=(const _var_base&) = delete;
|
_var_base& operator=(const _var_base&) = delete;
|
||||||
|
|
||||||
static constexpr bool enable_bitcopy = false;
|
using enable_bitcopy = std::false_type; // Disable bitcopy inheritence
|
||||||
|
|
||||||
_var_base()
|
_var_base()
|
||||||
: pointer(A::alloc(sizeof(T), alignof(T)))
|
: pointer(A::alloc(sizeof(T), alignof(T)))
|
||||||
|
@ -81,7 +81,7 @@ namespace vm
|
||||||
|
|
||||||
_var_base& operator=(const _var_base&) = delete;
|
_var_base& operator=(const _var_base&) = delete;
|
||||||
|
|
||||||
static constexpr bool enable_bitcopy = false;
|
using enable_bitcopy = std::false_type; // Disable bitcopy inheritence
|
||||||
|
|
||||||
_var_base(u32 count)
|
_var_base(u32 count)
|
||||||
: pointer(A::alloc(u32{sizeof(T)} * count, alignof(T)))
|
: pointer(A::alloc(u32{sizeof(T)} * count, alignof(T)))
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace rsx
|
||||||
// simple block to hold ps3 address and data
|
// simple block to hold ps3 address and data
|
||||||
struct memory_block
|
struct memory_block
|
||||||
{
|
{
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
u32 offset; // Offset in rsx address space
|
u32 offset; // Offset in rsx address space
|
||||||
u32 location; // rsx memory location of the block
|
u32 location; // rsx memory location of the block
|
||||||
|
@ -41,7 +41,7 @@ namespace rsx
|
||||||
|
|
||||||
struct tile_info
|
struct tile_info
|
||||||
{
|
{
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
u32 tile;
|
u32 tile;
|
||||||
u32 limit;
|
u32 limit;
|
||||||
|
@ -51,7 +51,7 @@ namespace rsx
|
||||||
|
|
||||||
struct zcull_info
|
struct zcull_info
|
||||||
{
|
{
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
u32 region;
|
u32 region;
|
||||||
u32 size;
|
u32 size;
|
||||||
|
@ -64,7 +64,7 @@ namespace rsx
|
||||||
// bleh, may need to break these out, might be unnecessary to do both always
|
// bleh, may need to break these out, might be unnecessary to do both always
|
||||||
struct tile_state
|
struct tile_state
|
||||||
{
|
{
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
tile_info tiles[15]{};
|
tile_info tiles[15]{};
|
||||||
zcull_info zculls[8]{};
|
zcull_info zculls[8]{};
|
||||||
|
@ -72,7 +72,7 @@ namespace rsx
|
||||||
|
|
||||||
struct buffer_state
|
struct buffer_state
|
||||||
{
|
{
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
u32 width{0};
|
u32 width{0};
|
||||||
u32 height{0};
|
u32 height{0};
|
||||||
|
@ -82,7 +82,7 @@ namespace rsx
|
||||||
|
|
||||||
struct display_buffers_state
|
struct display_buffers_state
|
||||||
{
|
{
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
std::array<buffer_state, 8> buffers{};
|
std::array<buffer_state, 8> buffers{};
|
||||||
u32 count{0};
|
u32 count{0};
|
||||||
|
|
|
@ -1112,7 +1112,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static constexpr usz align = Align;
|
static constexpr usz align = Align;
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
atomic_t() noexcept = default;
|
atomic_t() noexcept = default;
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ namespace stx
|
||||||
using under = decltype(int_or_enum());
|
using under = decltype(int_or_enum());
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
se_t() noexcept = default;
|
se_t() noexcept = default;
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ namespace utils
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept Bitcopy = (std::is_arithmetic_v<T>) || (std::is_enum_v<T>) || Integral<T> || requires (T& obj)
|
concept Bitcopy = (std::is_arithmetic_v<T>) || (std::is_enum_v<T>) || Integral<T> || requires ()
|
||||||
{
|
{
|
||||||
std::enable_if_t<static_cast<bool>(std::remove_cv_t<T>::enable_bitcopy)>();
|
std::enable_if_t<std::conjunction_v<typename T::enable_bitcopy>>();
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -92,7 +92,7 @@ union alignas(16) v128
|
||||||
__m128d vd;
|
__m128d vd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static constexpr bool enable_bitcopy = true;
|
using enable_bitcopy = std::true_type;
|
||||||
|
|
||||||
static v128 from64(u64 _0, u64 _1 = 0)
|
static v128 from64(u64 _0, u64 _1 = 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue