[Mesa-dev] [PATCH v2 15/18] extensions: enable EXT_color_buffer_float for ES2/ES3

Matt Turner mattst88 at gmail.com
Mon Jan 14 11:13:30 PST 2013


On Sat, Jan 12, 2013 at 8:11 PM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/mesa/main/extensions.c |    1 +
>  src/mesa/main/fbobject.c   |   26 +++++++++++++++++---------
>  src/mesa/main/readpix.c    |    2 ++
>  3 files changed, 20 insertions(+), 9 deletions(-)
>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index c3c73fc..8461195 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -231,6 +231,7 @@ static const struct extension extension_table[] = {
>     { "GL_EXT_unpack_subimage",                     o(dummy_true),                                         ES2, 2011 },
>     { "GL_EXT_vertex_array_bgra",                   o(EXT_vertex_array_bgra),                   GL,             2008 },
>     { "GL_EXT_vertex_array",                        o(dummy_true),                              GLL,            1995 },
> +   { "GL_EXT_color_buffer_float",                  o(dummy_true),                              ES2,            2013 },

Align ES2 with the other ES2s.

>
>     /* OES extensions */
>     { "GL_OES_blend_equation_separate",             o(EXT_blend_equation_separate),                  ES1,       2009 },
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index a219398..abb9f34 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -1217,21 +1217,27 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
>               ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
>     case GL_R16F:
>     case GL_R32F:
> -      return (_mesa_is_desktop_gl(ctx) &&
> -             ctx->Extensions.ARB_texture_rg &&
> -             ctx->Extensions.ARB_texture_float) ? GL_RED : 0;
> +      return ((_mesa_is_desktop_gl(ctx) &&
> +               ctx->Extensions.ARB_texture_rg &&
> +               ctx->Extensions.ARB_texture_float) ||
> +              (ctx->API == API_OPENGLES2) /* EXT_color_buffer_float */ )
> +         ? GL_RED : 0;

I wonder if there is any hardware that can do ES 2 but not
floating-point color buffers?


More information about the mesa-dev mailing list