Menu

#103 [libogc] Fix copies to texture targetting GX_TF_IA8 format

closed
nobody
None
5
2012-10-09
2011-09-18
No

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

Discussion

  • Julian Brown

    Julian Brown - 2011-09-18

    GX_CopyTex IA8 bugfix

     
  • Dave Murphy

    Dave Murphy - 2011-09-21

    Just tested and committed to SVN, thanks for the patch - as always, much appreciated

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.