[Mesa-dev] [PATCH v2] meta: Compute correct buffer size with SkipRows/SkipPixels

Chris Wilson chris at chris-wilson.co.uk
Tue Sep 1 09:53:10 PDT 2015


On Tue, Sep 01, 2015 at 05:44:30PM +0100, Neil Roberts wrote:
> Looks good to me.
> 
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
> > @@ -324,10 +340,9 @@ _mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims,
> >      * property.
> >      */
> >     image_height = packing->ImageHeight == 0 ? height : packing->ImageHeight;
> > -   full_height = image_height * (depth - 1) + height;
> >  
> >     pbo_tex_image = create_texture_for_pbo(ctx, false, GL_PIXEL_PACK_BUFFER,
> > -                                          width, full_height * depth,
> > +                                          dims, width, height, depth,
> 
> It looks like this bit was wrong previously and this patch fixes it. I
> think it would previously end up creating a texture that is
> height*depth² tall! However it probably wouldn't really matter because
> as far as I can tell this path is only used for an existing PBO so it
> wouldn't end up allocating any buffers or copying any data, it would
> just have the height wrong in the sampler state.

Hmm, it is a good point though as we don't check that the full_height
does comply with the sampler limit. That could cause some problems in a
few corner cases.

Thanks for the review,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list