[Mesa-dev] [Mesa-stable] [PATCH 1/4] Revert "mesa: simplify _mesa_is_image_unit_valid for buffers"

Nanley Chery nanleychery at gmail.com
Tue Mar 27 18:53:26 UTC 2018


On Tue, Mar 27, 2018 at 02:09:16PM +0200, Juan A. Suarez Romero wrote:
> On Mon, 2018-03-19 at 20:55 -0400, Marek Olšák wrote:
> > Reviewed-by: Marek Olšák <marek.olsak at amd.com>
> > 
> 
> I understand the R-b is only for first patch, not for the full series.
> 
> Any chance for this series to be reviewed? This was nominated for stable, but
> wasn't reviewed yet, so I can't pick it for 17.3
> 

No worries. I'm planning to take a look at it.

-Nanley

> 
> 	J.A.
> 
> 
> 
> > Marek
> > 
> > On Mon, Mar 19, 2018 at 2:26 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> > > This reverts commit c0ed52f6146c7e24e1275451773bd47c1eda3145.  It was
> > > preventing the image format validation from being done on buffer
> > > textures, which is required to ensure that the application doesn't
> > > attempt to create a buffer texture with an internal format
> > > incompatible with the image unit format (e.g. of different texel
> > > size), which is not allowed by the spec (it's not allowed for *any*
> > > texture target, whether or not there is spec wording restricting this
> > > behavior specifically for buffer textures) and will cause the driver
> > > to calculate texel bounds incorrectly and potentially crash instead of
> > > the expected behavior.
> > > 
> > > Cc: mesa-stable at lists.freedesktop.org
> > > ---
> > >  src/mesa/main/shaderimage.c | 25 ++++++++++++-------------
> > >  1 file changed, 12 insertions(+), 13 deletions(-)
> > > 
> > > diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
> > > index 596eadd4f85..054ab1d95e4 100644
> > > --- a/src/mesa/main/shaderimage.c
> > > +++ b/src/mesa/main/shaderimage.c
> > > @@ -479,13 +479,6 @@ _mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u)
> > >     if (!t)
> > >        return GL_FALSE;
> > > 
> > > -   /* The GL 4.5 Core spec doesn't say anything about buffers. In practice,
> > > -    * the image buffer format is always compatible with the underlying
> > > -    * buffer storage.
> > > -    */
> > > -   if (t->Target == GL_TEXTURE_BUFFER)
> > > -      return GL_TRUE;
> > > -
> > >     if (!t->_BaseComplete && !t->_MipmapComplete)
> > >         _mesa_test_texobj_completeness(ctx, t);
> > > 
> > > @@ -499,14 +492,20 @@ _mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u)
> > >         u->_Layer >= _mesa_get_texture_layers(t, u->Level))
> > >        return GL_FALSE;
> > > 
> > > -   struct gl_texture_image *img = (t->Target == GL_TEXTURE_CUBE_MAP ?
> > > -                                   t->Image[u->_Layer][u->Level] :
> > > -                                   t->Image[0][u->Level]);
> > > +   if (t->Target == GL_TEXTURE_BUFFER) {
> > > +      tex_format = _mesa_get_shader_image_format(t->BufferObjectFormat);
> > > 
> > > -   if (!img || img->Border || img->NumSamples > ctx->Const.MaxImageSamples)
> > > -      return GL_FALSE;
> > > +   } else {
> > > +      struct gl_texture_image *img = (t->Target == GL_TEXTURE_CUBE_MAP ?
> > > +                                      t->Image[u->_Layer][u->Level] :
> > > +                                      t->Image[0][u->Level]);
> > > +
> > > +      if (!img || img->Border || img->NumSamples > ctx->Const.MaxImageSamples)
> > > +         return GL_FALSE;
> > > +
> > > +      tex_format = _mesa_get_shader_image_format(img->InternalFormat);
> > > +   }
> > > 
> > > -   tex_format = _mesa_get_shader_image_format(img->InternalFormat);
> > >     if (!tex_format)
> > >        return GL_FALSE;
> > > 
> > > --
> > > 2.16.1
> > > 
> > > _______________________________________________
> > > mesa-stable mailing list
> > > mesa-stable at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/mesa-stable
> > 
> > _______________________________________________
> > mesa-stable mailing list
> > mesa-stable at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-stable


More information about the mesa-dev mailing list