[Mesa-dev] [PATCH] st/mesa: Fix assertions for copying texture image to finalized miptree.

Michel Dänzer michel at daenzer.net
Tue Oct 23 07:05:47 PDT 2012


On Die, 2012-10-23 at 15:27 +0200, Marek Olšák wrote: 
> On Tue, Oct 23, 2012 at 3:24 PM, Michel Dänzer <michel at daenzer.net> wrote:
> > On Die, 2012-10-23 at 15:21 +0200, Marek Olšák wrote:
> >> On Tue, Oct 23, 2012 at 11:24 AM, Michel Dänzer <michel at daenzer.net> wrote:
> >> > From: Michel Dänzer <michel.daenzer at amd.com>
> >> >
> >> > The layer dimension of array textures is not subject to mipmap minification.
> >> > OTOH we were missing an assertion for the depth dimension.
> >> >
> >> > Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
> >> > For some reason, they only resulted in piglit 'warn' results for me, not
> >> > failures.
> >> >
> >> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56211
> >> >
> >> > NOTE: This is a candidate for the stable branches.
> >> >
> >> > Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> >> > ---
> >> >
> >> > Can anyone think of something else I'm missing for these assertions?
> >> >
> >> >  src/mesa/state_tracker/st_cb_texture.c |    5 ++++-
> >> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
> >> > index b19dc67..03c09ff 100644
> >> > --- a/src/mesa/state_tracker/st_cb_texture.c
> >> > +++ b/src/mesa/state_tracker/st_cb_texture.c
> >> > @@ -1120,7 +1120,10 @@ copy_image_data_to_texture(struct st_context *st,
> >> >
> >> >        assert(src_level <= stImage->pt->last_level);
> >> >        assert(u_minify(stImage->pt->width0, src_level) == stImage->base.Width);
> >> > -      assert(u_minify(stImage->pt->height0, src_level) == stImage->base.Height);
> >> > +      assert(stImage->pt->target == PIPE_TEXTURE_1D_ARRAY ||
> >> > +             u_minify(stImage->pt->height0, src_level) == stImage->base.Height);
> >> > +      assert(stImage->pt->target >= PIPE_TEXTURE_1D_ARRAY ||
> >> > +             u_minify(stImage->pt->depth0, src_level) == stImage->base.Depth);
> >>
> >> Shouldn't we check for 2D_ARRAY here as well?
> >
> > It's included in stImage->pt->target >= PIPE_TEXTURE_1D_ARRAY. Do you
> > think it would be better to spell it out separately?
> 
> Ah sorry, I overlooked that. Well, yeah I think it would.

Actually, just stImage->pt->target == PIPE_TEXTURE_2D_ARRAY should be
enough, as depth should always be 1 for PIPE_TEXTURE_1D_ARRAY. I'll run
that through piglit.


> In any case:
> 
> Reviewed-by: Marek Olšák <maraeo at gmail.com>

Thanks, Marek.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list