mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.36k stars 1.33k forks source link

Add common vector math operations to mat3.hpp #16423

Closed mpulkki-mapbox closed 4 years ago

mpulkki-mapbox commented 4 years ago

Move common vec3 math operations defined in bounding_volumes.cpp to mat3.hpp for shared use. These functions are required in the 3D camera development https://github.com/mapbox/mapbox-gl-native/pull/16419.

julianrex commented 4 years ago

A couple of questions (that don't block this PR):

mpulkki-mapbox commented 4 years ago
  • Should the bulk of these be header only (i.e. so they can be inlined)?

This is something to consider if these functions can be measured to be a bottle neck. I wouldn't worry about it yet.

  • Will there be support for platform vector intrinsics? I'd love to see us using vector primitives

These are just convenience functions, but simd instructions would be cool. :)

mpulkki-mapbox commented 4 years ago
  • Should the bulk of these be header only (i.e. so they can be inlined)?

This is something to consider if these functions can be measured to be a bottle neck. I wouldn't worry about it yet.

@julianrex there actually was a noticeable performance regression in tileCover function (on iOS) that was spotted by the ios-benchmark-runner! Moving function definitions to the header file fixed the issue.