Remove sceGxmFinish from RenderPresent on Vita. Make sure that rendering is finished on render texture during locking

This commit is contained in:
Northfear 2021-10-31 12:38:08 +02:00 committed by Ryan C. Gordon
parent f3640e26a4
commit fba82ad1cb
1 changed files with 7 additions and 4 deletions

View File

@ -357,12 +357,19 @@ static int
VITA_GXM_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture,
const SDL_Rect *rect, void **pixels, int *pitch)
{
VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata;
*pixels =
(void *) ((Uint8 *) gxm_texture_get_datap(vita_texture->tex)
+ (rect->y * vita_texture->pitch) + rect->x * SDL_BYTESPERPIXEL(texture->format));
*pitch = vita_texture->pitch;
// make sure that rendering is finished on render target textures
if (vita_texture->tex->gxm_rendertarget != NULL) {
sceGxmFinish(data->gxm_context);
}
return 0;
}
@ -973,10 +980,6 @@ VITA_GXM_RenderPresent(SDL_Renderer *renderer)
VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata;
SceCommonDialogUpdateParam updateParam;
if (data->displayData.wait_vblank) {
sceGxmFinish(data->gxm_context);
}
data->displayData.address = data->displayBufferData[data->backBufferIndex];
SDL_memset(&updateParam, 0, sizeof(updateParam));