[Mesa-dev] [PATCH] texgetimage: fix regression with shadow 1d array
Ilia Mirkin
imirkin at alum.mit.edu
Tue Oct 27 19:30:47 PDT 2015
On Tue, Oct 27, 2015 at 10:26 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> since 1ad305b612f389fb04c6d51847427d5ec72fae03
> Brian Paul <brianp at vmware.com>
> Date: Tue Jul 21 18:35:38 2015 -0600
>
> mesa: plumb offset/size parameters through GetTexSubImage code
>
> I found this testing virgl which exercises a bunch of these
> in it's fallbacks.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/mesa/main/texgetimage.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index 682b727..b4321fb 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -91,9 +91,10 @@ get_tex_depth(struct gl_context *ctx, GLuint dimensions,
> if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
> depth = height;
> height = 1;
> - }
> + assert(zoffset + depth <= texImage->Height);
> + } else
> + assert(zoffset + depth <= texImage->Depth);
I would very much prefer if this read
} else {
...
}
Not a big fan of having half of the expr one way, half the other.
Either way though,
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
>
> - assert(zoffset + depth <= texImage->Depth);
> for (img = 0; img < depth; img++) {
> GLubyte *srcMap;
> GLint srcRowStride;
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list