Parcourir la source

video: don't use NEON blitters when SDL_HasNEON returns false

Anonymous Maarten il y a 2 semaines
Parent
commit
2038005657
2 fichiers modifiés avec 7 ajouts et 7 suppressions
  1. 4 6
      src/video/SDL_blit_A.c
  2. 3 1
      src/video/SDL_blit_N.c

+ 4 - 6
src/video/SDL_blit_A.c

@@ -1533,17 +1533,15 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface)
                 }
 #endif
 #if defined(SDL_NEON_INTRINSICS) && (__ARM_ARCH >= 8) && (defined(__aarch64__) || defined(_M_ARM64))
-                // To prevent "unused function" compiler warnings/errors
-                (void)Blit8888to8888PixelAlpha;
-                (void)Blit8888to8888PixelAlphaSwizzle;
-                return Blit8888to8888PixelAlphaSwizzleNEON;
-#else
+                if (SDL_HasNEON()) {
+                    return Blit8888to8888PixelAlphaSwizzleNEON;
+                }
+#endif
                 if (sf->format == df->format) {
                     return Blit8888to8888PixelAlpha;
                 } else {
                     return Blit8888to8888PixelAlphaSwizzle;
                 }
-#endif
             }
             return BlitNtoNPixelAlpha;
 

+ 3 - 1
src/video/SDL_blit_N.c

@@ -3127,7 +3127,9 @@ SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
             }
 #endif
 #if defined(SDL_NEON_INTRINSICS) && (__ARM_ARCH >= 8) && (defined(__aarch64__) || defined(_M_ARM64))
-            return Blit8888to8888PixelSwizzleNEON;
+            if (SDL_HasNEON()) {
+                return Blit8888to8888PixelSwizzleNEON;
+            }
 #endif
         }
 #if defined(SDL_SVE2_INTRINSICS) && (__ARM_ARCH >= 8) && (defined(__aarch64__) || defined(_M_ARM64))