@@ -209,7 +209,7 @@ static void PSP_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture)
209
209
PSP_Texture * psp_texture = (PSP_Texture * )texture -> driverdata ;
210
210
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
211
211
212
- // gsKit_TexManager_invalidate(data->gsGlobal, psp_texture );
212
+ sceKernelDcacheWritebackAll ( );
213
213
}
214
214
215
215
static int PSP_UpdateTexture (SDL_Renderer * renderer , SDL_Texture * texture ,
@@ -420,7 +420,7 @@ static int PSP_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
420
420
colorA = cmd -> data .color .a ;
421
421
422
422
sceGuClearColor (GU_RGBA (colorR , colorG , colorB , colorA ));
423
- sceGuClearStencil ( colorA );
423
+ sceGuClearDepth ( 0 );
424
424
sceGuClear (GU_COLOR_BUFFER_BIT |GU_DEPTH_BUFFER_BIT );
425
425
426
426
return 0 ;
@@ -580,14 +580,15 @@ static int PSP_RenderPresent(SDL_Renderer *renderer)
580
580
{
581
581
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
582
582
583
+ sceGuFinish ();
584
+ sceGuSync (0 ,0 );
585
+
583
586
if (((data -> vsync == 2 ) && (data -> vblank_not_reached )) || // Dynamic
584
587
(data -> vsync == 1 )) { // Normal VSync
585
588
sceDisplayWaitVblankStart ();
586
589
}
587
590
data -> vblank_not_reached = SDL_TRUE ;
588
591
589
- sceGuFinish ();
590
- sceGuSync (0 ,0 );
591
592
data -> backbuffer = data -> frontbuffer ;
592
593
data -> frontbuffer = vabsptr (sceGuSwapBuffers ());
593
594
@@ -658,6 +659,9 @@ static int PSP_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32
658
659
return SDL_OutOfMemory ();
659
660
}
660
661
662
+ // flush cache so that no stray data remains
663
+ sceKernelDcacheWritebackAll ();
664
+
661
665
/* Specific GU init */
662
666
bufferSize = getMemorySize (PSP_FRAME_BUFFER_WIDTH , PSP_SCREEN_HEIGHT , GU_PSM_8888 );
663
667
doublebuffer = vramalloc (bufferSize * 2 );
@@ -683,6 +687,12 @@ static int PSP_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32
683
687
sceDisplayWaitVblankStart ();
684
688
sceGuDisplay (GU_TRUE );
685
689
690
+ sceGuStart (GU_DIRECT ,list );
691
+
692
+ // Clear the screen
693
+ sceGuClearColor (0 );
694
+ sceGuClear (GU_COLOR_BUFFER_BIT );
695
+
686
696
/* Improve performance when VSYC is enabled and it is not reaching the 60 FPS */
687
697
dynamicVsync = SDL_GetHintBoolean (SDL_HINT_PSP_DYNAMIC_VSYNC , SDL_FALSE );
688
698
data -> vsync = flags & SDL_RENDERER_PRESENTVSYNC ? (dynamicVsync ? 2 : 1 ) : 0 ;
0 commit comments