I found a problem using GX_TF_IA8 format textures as the target of GX_CopyTex operations, which the attached patch fixes. The (partial) source code here illustrates the problem (it's not a self-contained test case, sorry -- though I can fix it up into one if necessary):
http://crtc.t4nk.org/gx-ia8-texcopy/texcopy-test.tar.bz2
The program just renders a 2x2 coloured grid to the EFB, grabs it as a texture (in a given format), then renders the result to the screen.
Using GX_TF_RGBA8 shows the original coloured grid:
http://crtc.t4nk.org/gx-ia8-texcopy/texfmt-GX_TF_RGBA8.png
But, notice that the texture is all messed up if the program is changed to use GX_TF_IA8, like so:
http://crtc.t4nk.org/gx-ia8-texcopy/texfmt-GX_TF_IA8-broken.png
Once the patch is applied however, the copied texture looks correct:
http://crtc.t4nk.org/gx-ia8-texcopy/texfmt-GX_TF_IA8-fixed.png
Also once the patch is applied, GX_CTF_RG8 (etc.) can also be used successfully, e.g.:
http://crtc.t4nk.org/gx-ia8-texcopy/texfmt-GX_CTF_RG8.png
(Red is copied to the intensity channel, green to the alpha channel -- but the alpha channel is ignored for this example when writing to the screen, so this is the correct result).
I'd be delighted for this patch to be included in the next libogc version! I should say that it's tested on a Gamecube, but not a Wii, since I don't (yet!) have one of the latter.
Thanks,
Julian
GX_CopyTex IA8 bugfix
Just tested and committed to SVN, thanks for the patch - as always, much appreciated