summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2020-12-31 09:42:56 -0300
committerreduz <reduzio@gmail.com>2021-01-05 08:50:18 -0300
commit9a2f18f8e7311d98fa545fdc5b247f14770ea822 (patch)
treed87ce917807682b6e90ca06557b4c19f49713402 /core
parent8a1c37dc2212da7c403b41c37875587083e93c10 (diff)
Reorganize renderer code.
So it can hopefully be made more cache efficient afterwards.
Diffstat (limited to 'core')
-rw-r--r--core/templates/rid.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/core/templates/rid.h b/core/templates/rid.h
index 7fe6dbe473..b9829bd533 100644
--- a/core/templates/rid.h
+++ b/core/templates/rid.h
@@ -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