Skip to content

Commit

Permalink
ogc: invalidate current texture contents before copying the EFB onto it
Browse files Browse the repository at this point in the history
This is needed to avoid visual artifacts on the saved texture.
  • Loading branch information
mardy authored and WinterMute committed Apr 22, 2024
1 parent f2c9a67 commit 876486d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/render/ogc/SDL_render_ogc.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ static void load_efb_from_texture(SDL_Renderer *renderer, SDL_Texture *texture)
static void save_efb_to_texture(SDL_Texture *texture)
{
OGC_TextureData *ogc_tex = texture->driverdata;
u32 texture_size;

texture_size = GX_GetTexBufferSize(texture->w, texture->h, ogc_tex->format,
GX_FALSE, 0);
DCInvalidateRange(ogc_tex->texels, texture_size);

GX_SetTexCopySrc(0, 0, texture->w, texture->h);
GX_SetTexCopyDst(texture->w, texture->h, ogc_tex->format, GX_FALSE);
Expand Down

0 comments on commit 876486d

Please sign in to comment.