devkitPro / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
11 stars 12 forks source link

Render to tex improvements #70

Closed mardy closed 3 months ago

mardy commented 3 months ago

Here's a few changes that fix various issues I've met with a game I'm writing, which makes extensive use of the "render to texture" feature.

Easier to review commit by commit (please don't squash them into merging, since the addressed issues are all slightly different).

I honestly haven't understood why the commit "ogc: invalidate current texture contents before copying the EFB onto it" is needed, but without it I do see (minor) random corruption on the generated texture.

WinterMute commented 3 months ago

I honestly haven't understood why the commit "ogc: invalidate current texture contents before copying the EFB onto it" is needed, but without it I do see (minor) random corruption on the generated texture.

Because the GPU doesn't go through the cache and if the CPU has touched that memory before you do the copy then it will get corrupted when those cache lines get evicted.