@@ -923,6 +923,25 @@ static inline int PSP_RenderCopy(SDL_Renderer *renderer, void *vertices, SDL_Ren
923
923
return 0 ;
924
924
}
925
925
926
+ static inline void PSP_SendQueueToGPU (SDL_Renderer * renderer ) {
927
+ PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
928
+
929
+ int g_packet_size = sceGuFinish ();
930
+ void * pkt = data -> guList [data -> list_idx ];
931
+ SDL_assert (g_packet_size < GPU_LIST_SIZE );
932
+ sceKernelDcacheWritebackRange (pkt , g_packet_size );
933
+
934
+ sceGuSync (GU_SYNC_SEND , GU_SYNC_WHAT_DONE );
935
+
936
+ // Send the packet to the GPU
937
+ sceGuSendList (GU_TAIL , data -> guList [data -> list_idx ], NULL );
938
+
939
+ // Starting a new list
940
+ data -> list_idx = (data -> list_idx != 0 ) ? 0 : 1 ;
941
+
942
+ sceGuStart (GU_SEND , data -> guList [data -> list_idx ]);
943
+ }
944
+
926
945
static int PSP_RunCommandQueue (SDL_Renderer * renderer , SDL_RenderCommand * cmd , void * vertices , size_t vertsize )
927
946
{
928
947
/* note that before the renderer interface change, this would do extrememly small
@@ -991,6 +1010,9 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
991
1010
}
992
1011
cmd = cmd -> next ;
993
1012
}
1013
+
1014
+ PSP_SendQueueToGPU (renderer );
1015
+
994
1016
return 0 ;
995
1017
}
996
1018
@@ -1004,13 +1026,6 @@ static int PSP_RenderPresent(SDL_Renderer *renderer)
1004
1026
{
1005
1027
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
1006
1028
1007
- int g_packet_size = sceGuFinish ();
1008
- void * pkt = data -> guList [data -> list_idx ];
1009
- SDL_assert (g_packet_size < GPU_LIST_SIZE );
1010
- sceKernelDcacheWritebackRange (pkt , g_packet_size );
1011
-
1012
- sceGuSync (GU_SYNC_FINISH , GU_SYNC_WHAT_DONE );
1013
-
1014
1029
if (((data -> vsync == 2 ) && (data -> vblank_not_reached )) || // Dynamic
1015
1030
(data -> vsync == 1 )) { // Normal VSync
1016
1031
sceDisplayWaitVblankStart ();
@@ -1020,13 +1035,6 @@ static int PSP_RenderPresent(SDL_Renderer *renderer)
1020
1035
data -> backbuffer = data -> frontbuffer ;
1021
1036
data -> frontbuffer = vabsptr (sceGuSwapBuffers ());
1022
1037
1023
- // Send the packet to the GPU
1024
- sceGuSendList (GU_TAIL , data -> guList [data -> list_idx ], NULL );
1025
-
1026
- // Starting a new frame
1027
- data -> list_idx = (data -> list_idx != 0 ) ? 0 : 1 ;
1028
-
1029
- sceGuStart (GU_SEND , data -> guList [data -> list_idx ]);
1030
1038
sceGuDrawBufferList (data -> drawBufferFormat , vrelptr (data -> backbuffer ), PSP_FRAME_BUFFER_WIDTH );
1031
1039
1032
1040
return 0 ;
0 commit comments