duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

gsvector.h (851B)


      1 // SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 //
      5 // Lightweight wrapper over native SIMD types for cross-platform vector code.
      6 //
      7 
      8 #pragma once
      9 
     10 #include "common/intrin.h"
     11 
     12 #if defined(CPU_ARCH_SSE)
     13 #include "common/gsvector_sse.h"
     14 #elif defined(CPU_ARCH_NEON)
     15 #include "common/gsvector_neon.h"
     16 #else
     17 #include "common/gsvector_nosimd.h"
     18 #endif
     19 
     20 class GSMatrix2x2
     21 {
     22 public:
     23   GSMatrix2x2() = default;
     24   GSMatrix2x2(float e00, float e01, float e10, float e11);
     25 
     26   GSMatrix2x2 operator*(const GSMatrix2x2& m) const;
     27 
     28   GSVector2 operator*(const GSVector2& v) const;
     29 
     30   static GSMatrix2x2 Identity();
     31   static GSMatrix2x2 Rotation(float angle_in_radians);
     32 
     33   GSVector2 row(size_t i) const;
     34   GSVector2 col(size_t i) const;
     35 
     36   void store(void* m);
     37 
     38   float E[2][2];
     39 };