[Mesa-dev] [PATCH] mesa: Fix GLES2 OES float texture framebuffer rendering.

Erik Faye-Lund erik.faye-lund at collabora.com
Tue Dec 11 10:20:51 UTC 2018


On Mon, 2018-12-10 at 16:31 -0500, Ilia Mirkin wrote:
> On Mon, Dec 10, 2018 at 4:28 PM Nick Kreeger <nick.kreeger at gmail.com>
> wrote:
> > This change enables GLES2 chagnes to render
> > 
> > This change enables GLES2 to render float/half-float textures to a
> > framebuffer when the appropriate OES extensions are available.
> > 
> > This commit regressed OES GLES2 float texture rendering:
> > https://gitlab.freedesktop.org/mesa/mesa/commit/e333035c47a6a4cc88f0f9ca2bced500538bebae
> > ---
> >  src/mesa/main/fbobject.c | 32 +++++++++++++++++++++++---------
> >  1 file changed, 23 insertions(+), 9 deletions(-)
> > 
> > diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> > index 23e4939..dd98487 100644
> > --- a/src/mesa/main/fbobject.c
> > +++ b/src/mesa/main/fbobject.c
> > @@ -869,16 +869,30 @@ test_attachment_completeness(const struct
> > gl_context *ctx, GLenum format,
> >              return;
> >           }
> > 
> > -         /* OES_texture_float allows creation and use of floating
> > point
> > -          * textures with GL_FLOAT, GL_HALF_FLOAT but it does not
> > allow
> > -          * these textures to be used as a render target, this is
> > done via
> > -          * GL_EXT_color_buffer(_half)_float with set of new sized
> > types.
> > -          */
> > -         if (_mesa_is_gles(ctx) && (texObj->_IsFloat || texObj-
> > >_IsHalfFloat)) {
> > -            att_incomplete("bad internal format");
> > -            att->Complete = GL_FALSE;
> > -            return;
> > +         if (_mesa_is_gles(ctx)) {
> > +           /**
> > +            * GL ES 2 will allow GL_FLOAT and GL_HALF_FLOAT to
> > render as a
> > +            * target when the appropriate OES_* extensions are
> > available.
> > +            */
> > +           if ((texObj->_IsFloat &&
> > !_mesa_has_OES_texture_half_float(ctx)) ||
> > +               (texObj->_IsHalfFloat &&
> > !_mesa_has_OES_texture_float(ctx))) {
> > +             att_incomplete("bad internal format");
> > +             att->Complete = GL_FALSE;
> > +             return;
> > +           }
> > +         } else if (_mesa_is_gles3(ctx)) {
> 
> This will never get hit. _mesa_is_gles covers GLES1 and GLES2.
> _mesa_is_gles3 is a subset of that. I think you want to flip the
> order
> around. However it's very very odd for something to work in GLES2 and
> not GLES3.

Yeah, I think the second conditional should be dropped entirely.
OES_texture_half_float and OES_texture_float should also have effect in
GLES3.




More information about the mesa-dev mailing list