hrydgard/ppsspp — pull request #6254 by unknownbrackets (2014-06-08 02:42:32+00:00)
Title: Correct framebuf clamping, tex projection from framebuf

Probably flipping the drawing will be better (less work in frag shader), although it means fixing a lot of places - scissor, throughmode, blitting, readpixels, ge debugger, etc.

Anyway, for now, this defers flipping when projecting to the frag shader. That seems to really help the case of #4421 I know about (at least for me.)

Another issue was the clamping: it was clamping to the edge. In Kingdom Hearts, for example, the framebuffer is necessarily 128x64, but the part textured from is only 64x64. Clamping was clamping to texel 64, rather than texel 63, sometimes showing artifacts from the other region of the framebuffer. Clamping to a half pixel fixes that (hopefully precision will be okay on mobile...)

While testing this, I found that Dragon Ball Z uses individual bits of the writemask, unfortunately. We could at least try using glStencilMask, but it won't work well. I wonder if it's worth reporting. If games use it super conservatively, we could potentially do it in the shader like blending on GLES 3.

-[Unknown]