[Mesa-dev] [PATCH 1/2] mesa: MESA_framebuffer_flip_y extension [v3]

Chad Versace chadversary at chromium.org
Wed Jul 18 15:45:24 UTC 2018


On Wed 11 Jul 2018, Chad Versace wrote:
> +Ken, I had a question about GLboolean. I call you by name in the
> comments below.
>
> On Fri 29 Jun 2018, Fritz Koenig wrote:
> > Adds an extension to glFramebufferParameteri
> > that will specify if the framebuffer is vertically
> > flipped. Historically system framebuffers are
> > vertically flipped and user framebuffers are not.
> > Checking to see the state was done by looking at
> > the name field.  This adds an explicit field.
> >
> > v2:
> > * updated spec language [for chadv]
> > * correctly specifying ES 3.1 [for chadv]
> > * refactor access to rb->Name [for jason]
> > * handle GetFramebufferParameteriv [for chadv]
> > v3:
> > * correct _mesa_GetMultisamplefv [for kusmabite]
> > ---
>
> >  docs/specs/MESA_framebuffer_flip_y.spec    | 84 ++++++++++++++++++++++

[snip]

> > diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c
> > index 827a77f722..31b65fb53b 100644
> > --- a/src/mesa/drivers/dri/i915/intel_fbo.c
> > +++ b/src/mesa/drivers/dri/i915/intel_fbo.c
> > @@ -86,7 +86,8 @@ intel_map_renderbuffer(struct gl_context *ctx,
> >  		       GLuint x, GLuint y, GLuint w, GLuint h,
> >  		       GLbitfield mode,
> >  		       GLubyte **out_map,
> > -		       GLint *out_stride)
> > +		       GLint *out_stride,
> > +		       GLboolean inverted_y)

[snip]

> And I believe the internal APIs should use 'bool' instead of
> 'GLboolean'. See commit 786a6472450b50977e6906e27d5f481e00b05d73 .
>
> Ken, should Fritz also use plain 'bool' in struct gl_framebuffer? That
> is, should it be
>
>     struct gl_framebuffer {
>         ...
>         GLboolean FlipY;
> or
>         bool FlipY;

I received feedback on #intel-3d about the GLboolean-vs-bool question.

jekstrand | chadv: The extension?  GLboolean.  Internal calls?  bool.
jekstrand | chadv: GLboolean should die!
   Kayden | chadv: definitely bool, GLboolean is evil
   Kayden | anything not touching the GL API explicitly should be bool
   Kayden | even fields in gl_context should get converted IMO
   anholt | agreed
   Kayden | we've had bugs where somebody returned a pointer as a GLboolean
   Kayden | thinking it would get treated as true/false
   Kayden | and instead it truncated to signed char
   Kayden | so based on the address it would have a random truth value
   Kayden | sorry I neglected to email you back :(
jekstrand | unless you're on a 64-bit system and it just happens to be aligned
          | correctly...

Based on their emphatic feedback, definitely use bool in all driver internal APIs.
And you should probably use bool in struct framebuffer too.


More information about the mesa-dev mailing list