Skip to content

RID causes native structures to be misaligned #1956

@BenLubar

Description

@BenLubar

Godot version

c2fe519aa640991b7197008b2793dc2e18c71d77 (there are some custom changes but this is a compile time bug)

godot-cpp version

9ae37ac

System information

Linux, compiling for wasm32

Issue description

#include <godot_cpp/classes/glyph.hpp>

The RID field in godot::Glyph is aligned incorrectly.

Steps to reproduce

A correctly laid out struct would be this, or changing RID to be aligned properly in general:

struct Glyph {
	int start = -1;
	int end = -1;

	uint8_t count = 0;
	uint8_t repeat = 1;
	uint16_t flags = 0;

	float x_off = 0.f;
	float y_off = 0.f;
	float advance = 0.f;

	alignas(uint64_t) RID font_rid;
	int font_size = 0;
	int32_t index = 0;

	int span_index = -1;
};

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions