From 52a3483c2211912bfb54a47d1fadf3e6654489bc Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:09:45 +0200 Subject: [PATCH] wiiu/render: Call `GX2DrawDone` when destroying render targets --- src/render/wiiu/SDL_rtexture_wiiu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/render/wiiu/SDL_rtexture_wiiu.c b/src/render/wiiu/SDL_rtexture_wiiu.c index fb4b2b33cb728..1bb4755435c47 100644 --- a/src/render/wiiu/SDL_rtexture_wiiu.c +++ b/src/render/wiiu/SDL_rtexture_wiiu.c @@ -204,9 +204,16 @@ void WIIU_SDL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) data = (WIIU_RenderData *) renderer->driverdata; tdata = (WIIU_TextureData *) texture->driverdata; - if (videodata->hasForeground && WIIU_TextureInUse(data, tdata)) { + if (videodata->hasForeground) { /* Wait for the texture rendering to finish */ - WIIU_TextureWaitDone(data, tdata); + if (WIIU_TextureInUse(data, tdata)) { + WIIU_TextureWaitDone(data, tdata); + } + + /* When destroying a render target wait for the GPU to catch up completely */ + if (texture->access == SDL_TEXTUREACCESS_TARGET) { + GX2DrawDone(); + } } if (data->drawState.texture == texture) {