Commit 739f4e1eb2ba02d295675dabcf47706fca2a4445

José Cadete 2021-02-01T23:14:28

Only call sceGxmFinish when vsync is on Also fix oversight with supported textures

diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c
index 4be15d5..e131719 100644
--- a/src/render/vitagxm/SDL_render_vita_gxm.c
+++ b/src/render/vitagxm/SDL_render_vita_gxm.c
@@ -115,8 +115,8 @@ SDL_RenderDriver VITA_GXM_RenderDriver = {
             [1] = SDL_PIXELFORMAT_ARGB8888,
             [2] = SDL_PIXELFORMAT_RGB888,
             [3] = SDL_PIXELFORMAT_BGR888,
-            [2] = SDL_PIXELFORMAT_RGB565,
-            [3] = SDL_PIXELFORMAT_BGR565
+            [4] = SDL_PIXELFORMAT_RGB565,
+            [5] = SDL_PIXELFORMAT_BGR565
         },
         .max_texture_width = 1024,
         .max_texture_height = 1024,
@@ -1086,9 +1086,11 @@ VITA_GXM_RenderPresent(SDL_Renderer *renderer)
     VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
     SceCommonDialogUpdateParam updateParam;
 
-    if(data->drawing) {
+    if (data->drawing) {
         sceGxmEndScene(data->gxm_context, NULL, NULL);
-        sceGxmFinish(data->gxm_context);
+        if (data->displayData.wait_vblank) {
+            sceGxmFinish(data->gxm_context);
+        }
     }
 
     data->displayData.address = data->displayBufferData[data->backBufferIndex];