opengl: Support NV12 textures on GPUs with only 2 texture units

This commit is contained in:
Cameron Cawley authored and Sam Lantinga committed 2022-08-16 07:30:13 -07:00
1 parent 2fcd8f889c
commit 09b6956dcc
1 file changed
+4
+4
View File
@@ -1919,6 +1919,10 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
if (data->shaders && data->num_texture_units >= 3) {
renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12;
renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV;
}
/* We support NV12 textures using 2 textures and a shader */
if (data->shaders && data->num_texture_units >= 2) {
renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_NV12;
renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_NV21;
}