[core] Align line vertex to 4-byte boundary
10 byte vertices are heavily penalized by common GL implementations.
This commit is contained in:
@@ -23,7 +23,7 @@ inline uint16_t packUint8Pair(T a, T b) {
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_pos);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_extrude);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 4, a_pos_offset);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 3, a_pos_normal);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 4, a_pos_normal);
|
||||
MBGL_DEFINE_ATTRIBUTE(float, 3, a_projected_pos);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_label_pos);
|
||||
MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_anchor_pos);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
static_assert(sizeof(LineLayoutVertex) == 10, "expected LineLayoutVertex size");
|
||||
static_assert(sizeof(LineLayoutVertex) == 12, "expected LineLayoutVertex size");
|
||||
|
||||
template <class Values, class...Args>
|
||||
Values makeValues(const RenderLinePaintProperties::PossiblyEvaluated& properties,
|
||||
|
||||
@@ -59,7 +59,8 @@ public:
|
||||
{{
|
||||
p.x,
|
||||
p.y,
|
||||
static_cast<int16_t>(attributes::packUint8Pair(round ? 1 : 0, up ? 1 : 0))
|
||||
static_cast<int16_t>(round ? 1 : 0),
|
||||
static_cast<int16_t>(up ? 1 : -1)
|
||||
}},
|
||||
{{
|
||||
// add 128 to store a byte in an unsigned byte
|
||||
|
||||
Reference in New Issue
Block a user