Skip to content

Commit

Permalink
UPBGE: Use aligned allocator for RAS_BoundingBox::DisplayArraySlot.
Browse files Browse the repository at this point in the history
Struct DisplayArraySlot contains mt::vec3 which must be aligned on
16 bytes, in consideration RAS_BoundingBox::m_slots uses
mt::simd_allocator to allocate with the proper alignement.
  • Loading branch information
panzergame committed Dec 19, 2017
1 parent c83d50e commit a99d456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/gameengine/Rasterizer/RAS_BoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ class RAS_MeshBoundingBox : public RAS_BoundingBox
mt::vec3 m_aabbMax;
};

std::vector<DisplayArraySlot> m_slots;
/// The sub AABB per display array.
// Use aligned allocator because DisplayArraySlot use aligned members.
std::vector<DisplayArraySlot, mt::simd_allocator<DisplayArraySlot> > m_slots;

public:
RAS_MeshBoundingBox(RAS_BoundingBoxManager *manager, const RAS_IDisplayArrayList& displayArrayList);
Expand Down

0 comments on commit a99d456

Please sign in to comment.