Perf: make SDL2 use an ARGB8888 texture, which is natively supported via some GPUs + drivers, such as on OSX. This can remove an extraneous pixel-format conversion.

This commit is contained in:
David Ludwig 2017-09-10 14:34:13 -04:00
parent 449936e461
commit 50986dcf46

View File

@ -777,7 +777,7 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
}
SDL_assert(sdl_texture == NULL);
sdl_texture = SDL_CreateTexture(sdl_renderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, width, height);
sdl_texture = SDL_CreateTexture(sdl_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, width, height);
if (!sdl_texture) {
shutdown_sdl_video();
return NULL;