On 01/14/2011 02:58 PM, Eric Anholt wrote:
Module: Mesa
Branch: master
Commit: 65c41d55a06137115f0b4c67f9a3fd2708f0b625
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=65c41d55a06137115f0b4c67f9a3fd2708f0b625

Author: Eric Anholt<e...@anholt.net>
Date:   Thu Jan 13 10:05:50 2011 -0800

mesa: Simplify _mesa_base_fbo_format by making it exceptions to teximages.

The comment of "this is just like teximages except for..." is a pretty
good clue that we're handling this wrong.  By just using the teximage
code, we catch a bunch of cases we'd missed, like GL_RED and GL_RG.


_mesa_base_fbo_format() also serves as an error checking function so that invalid internalFormat parameters to glRenderBufferStorage() are rejected.

We need to reject compressed formats, index formats, dudv formats, ycbcr formats, etc. I think we lost that with your change. Maybe we need to pass a 'renderable' flag into the function so we can do the extra checking.

If _mesa_base_tex_format() is going to be overloaded with FBO format checking, the comment on that function needs to be updated. Maybe even rename _mesa_base_tex_format() to _mesa_base_surface_format() or something like that to make it clear that it's not just used for texture internal formats.

The original comment was correct- they're similar functions, but not the same.

-Brian
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to