Skip to content

Commit 3cff32a

Browse files
committed
Merge pull request godotengine#98910 from darksylinc/matias-id_arm32
Force `RDD::id` to be always `uint64_t`
2 parents b0a8540 + e69a0c7 commit 3cff32a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

servers/rendering/rendering_device_driver.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ struct VersatileResourceTemplate {
120120
class RenderingDeviceDriver : public RenderingDeviceCommons {
121121
public:
122122
struct ID {
123-
size_t id = 0;
123+
uint64_t id = 0;
124124
_ALWAYS_INLINE_ ID() = default;
125-
_ALWAYS_INLINE_ ID(size_t p_id) :
125+
_ALWAYS_INLINE_ ID(uint64_t p_id) :
126126
id(p_id) {}
127127
};
128128

@@ -138,11 +138,9 @@ class RenderingDeviceDriver : public RenderingDeviceCommons {
138138
_ALWAYS_INLINE_ bool operator!=(const m_name##ID &p_other) const { return id != p_other.id; } \
139139
_ALWAYS_INLINE_ m_name##ID(const m_name##ID &p_other) : ID(p_other.id) {} \
140140
_ALWAYS_INLINE_ explicit m_name##ID(uint64_t p_int) : ID(p_int) {} \
141-
_ALWAYS_INLINE_ explicit m_name##ID(void *p_ptr) : ID((size_t)p_ptr) {} \
141+
_ALWAYS_INLINE_ explicit m_name##ID(void *p_ptr) : ID((uint64_t)p_ptr) {} \
142142
_ALWAYS_INLINE_ m_name##ID() = default; \
143-
}; \
144-
/* Ensure type-punnable to pointer. Makes some things easier.*/ \
145-
static_assert(sizeof(m_name##ID) == sizeof(void *));
143+
};
146144

147145
// Id types declared before anything else to prevent cyclic dependencies between the different concerns.
148146
DEFINE_ID(Buffer);

0 commit comments

Comments
 (0)