[Mesa-dev] [PATCH] radeon/r200: Fix FBO formats

Roland Scheidegger sroland at vmware.com
Thu Jan 17 07:32:51 PST 2013

Am 16.01.2013 17:52, schrieb Milan Kostić:
>  No, no regress in piglit i've seen at all, only better... i even
> played whole Drawn 2 game:
>  http://www.drawngame.com/games/dark-flight
> under wine in OpenGL mode, it works perfectly now, needs culling under
> fbo which is fixed now and this fix to display text and so works
> exactly the same as with nvidia on Windows.
>  It can further pass 2 more test in piglit if those are ported from intel:
>  fbo-nodepth-test
>  http://cgit.freedesktop.org/mesa/mesa/commit/?id=4d4f2daefabdc4ca1dd778a9265475c65ef52936
>  i've tried that one and it pass and maybe this for fbo-cubemap - but
> not tried:
>  http://cgit.freedesktop.org/mesa/mesa/commit/?id=80513ec8b4c812b9c6249cc5824337a5f04ab34c
>  Now i checked supertuxkart game, it has some problems with alpha in
> XRGB8888 format. Under non-fbo mode kart model have black background,
> and under fbo models are transparent. I fixed it for non fbo case with
> R200_TXFORMAT_ALPHA_IN_MAP for XRGB8888 also in r200_blit, but don't
> know where is this format controled for fbos?  I mentoioned this
> because text is slightly transparent also in that Drawn game, it only
> works with with fbo extension in opengl mode, i guess that needs the
> same fix for XRGB8888 format to expect alpha under fbo, etc... But OK
> that can be another bug :).

I am not quite sure what the bug is. But you can't just tell the
hardware it should always write 1.0 for alpha to a colorbuffer. Well you
could probably achieve this with some different methods:
1) hack up alpha blend
2) change plane mask to never write alpha (though it would probably stay
0.0 forever unless initialized somewhere)
3) hack up fragment shader to write alpha 1.0

But I don't know where the bug happens (I think if you'd blit that
surface to somewhere using 2d blitter you can also tell it it has no
alpha). Or maybe the bug happens because alpha blend is enabled and
relying on destination alpha being 1.0 (by use of destination alpha
blend factor). In this case hacking up alpha blend factors is the
sensible thing to do - other drivers do that as well, but I don't think
radeon/r200 currently do.


More information about the mesa-dev mailing list