Skip to content

Commit

Permalink
wiiu/render: Call GX2DrawDone when destroying render targets
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryOderNichts committed Sep 3, 2024
1 parent 80499f9 commit 52a3483
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/render/wiiu/SDL_rtexture_wiiu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 52a3483

Please sign in to comment.