Skip to content

Commit 876486d

Browse files
mardyWinterMute
authored andcommitted
ogc: invalidate current texture contents before copying the EFB onto it
This is needed to avoid visual artifacts on the saved texture.
1 parent f2c9a67 commit 876486d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/render/ogc/SDL_render_ogc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ static void load_efb_from_texture(SDL_Renderer *renderer, SDL_Texture *texture)
140140
static void save_efb_to_texture(SDL_Texture *texture)
141141
{
142142
OGC_TextureData *ogc_tex = texture->driverdata;
143+
u32 texture_size;
144+
145+
texture_size = GX_GetTexBufferSize(texture->w, texture->h, ogc_tex->format,
146+
GX_FALSE, 0);
147+
DCInvalidateRange(ogc_tex->texels, texture_size);
143148

144149
GX_SetTexCopySrc(0, 0, texture->w, texture->h);
145150
GX_SetTexCopyDst(texture->w, texture->h, ogc_tex->format, GX_FALSE);

0 commit comments

Comments
 (0)