Reorganize renderer code.

So it can hopefully be made more cache efficient afterwards.
This commit is contained in:
reduz 2020-12-31 09:42:56 -03:00
parent 8a1c37dc22
commit 9a2f18f8e7
13 changed files with 864 additions and 390 deletions

View file

@ -40,30 +40,35 @@ class RID {
uint64_t _id = 0;
public:
_FORCE_INLINE_ bool operator==(const RID &p_rid) const {
_ALWAYS_INLINE_ bool operator==(const RID &p_rid) const {
return _id == p_rid._id;
}
_FORCE_INLINE_ bool operator<(const RID &p_rid) const {
_ALWAYS_INLINE_ bool operator<(const RID &p_rid) const {
return _id < p_rid._id;
}
_FORCE_INLINE_ bool operator<=(const RID &p_rid) const {
_ALWAYS_INLINE_ bool operator<=(const RID &p_rid) const {
return _id <= p_rid._id;
}
_FORCE_INLINE_ bool operator>(const RID &p_rid) const {
_ALWAYS_INLINE_ bool operator>(const RID &p_rid) const {
return _id > p_rid._id;
}
_FORCE_INLINE_ bool operator>=(const RID &p_rid) const {
_ALWAYS_INLINE_ bool operator>=(const RID &p_rid) const {
return _id >= p_rid._id;
}
_FORCE_INLINE_ bool operator!=(const RID &p_rid) const {
_ALWAYS_INLINE_ bool operator!=(const RID &p_rid) const {
return _id != p_rid._id;
}
_FORCE_INLINE_ bool is_valid() const { return _id != 0; }
_FORCE_INLINE_ bool is_null() const { return _id == 0; }
_ALWAYS_INLINE_ bool is_valid() const { return _id != 0; }
_ALWAYS_INLINE_ bool is_null() const { return _id == 0; }
_FORCE_INLINE_ uint64_t get_id() const { return _id; }
static _ALWAYS_INLINE_ RID from_uint64(uint64_t p_id) {
RID _rid;
_rid._id = p_id;
return _rid;
}
_ALWAYS_INLINE_ uint64_t get_id() const { return _id; }
_FORCE_INLINE_ RID() {}
_ALWAYS_INLINE_ RID() {}
};
#endif // RID_H