Skip to content

Commit ac3fb35

Browse files
committed
video: don't use NEON blitters when SDL_HasNEON returns false
1 parent f6f4664 commit ac3fb35

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/video/SDL_blit_A.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,17 +1505,15 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface)
15051505
}
15061506
#endif
15071507
#if defined(SDL_NEON_INTRINSICS) && (__ARM_ARCH >= 8) && (defined(__aarch64__) || defined(_M_ARM64))
1508-
// To prevent "unused function" compiler warnings/errors
1509-
(void)Blit8888to8888PixelAlpha;
1510-
(void)Blit8888to8888PixelAlphaSwizzle;
1511-
return Blit8888to8888PixelAlphaSwizzleNEON;
1512-
#else
1508+
if (SDL_HasNEON()) {
1509+
return Blit8888to8888PixelAlphaSwizzleNEON;
1510+
}
1511+
#endif
15131512
if (sf->format == df->format) {
15141513
return Blit8888to8888PixelAlpha;
15151514
} else {
15161515
return Blit8888to8888PixelAlphaSwizzle;
15171516
}
1518-
#endif
15191517
}
15201518
return BlitNtoNPixelAlpha;
15211519

src/video/SDL_blit_N.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3118,7 +3118,9 @@ SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
31183118
}
31193119
#endif
31203120
#if defined(SDL_NEON_INTRINSICS) && (__ARM_ARCH >= 8) && (defined(__aarch64__) || defined(_M_ARM64))
3121-
return Blit8888to8888PixelSwizzleNEON;
3121+
if (SDL_HasNEON()) {
3122+
return Blit8888to8888PixelSwizzleNEON;
3123+
}
31223124
#endif
31233125
}
31243126

0 commit comments

Comments
 (0)