ChromaKit icon indicating copy to clipboard operation
ChromaKit copied to clipboard

Use SIMD storage and calculations

Open PimCoumans opened this issue 8 months ago • 0 comments

Updates all color types to use SIMD3<Double> as their actual color storage, which makes these types more usable with lower level graphics code (like Metal). The color matrix is now a simd type too, making the dot product logic very simple.

Notes:

  • I haven’t done any performance comparisons, but hopefully this makes the conversions a tad more efficient.
  • Simd matrix structs are stored in columns rather than rows. I think we can improve the performance more by ‘rotating’ all matrices so they’re initialized with init(_ col0: SIMD3<Double>, _ col1: SIMD3<Double>, _ col2: SIMD3<Double>) instead of init(rows: [SIMD3<Double>]) which I think manually has to run through the provided array and set the correct values.

PimCoumans avatar Jul 31 '25 09:07 PimCoumans