[Mesa-dev] [PATCH] i965: Fix intel_miptree_copy_teximage for GL_TEXTURE_1D_ARRAY
Jason Ekstrand
jason at jlekstrand.net
Fri Jan 30 07:30:45 PST 2015
On Jan 30, 2015 12:04 AM, "Iago Toral Quiroga" <itoral at igalia.com> wrote:
>
> For GL_TEXTURE_1D_ARRAY targets we store the depth of the array
> in the Height field and leave Depth=1 in the underlying texture
*sigh* That's one of those design choices with a long history that everyone
now regrets. We really should fix it properly but it's a lot of work.
> object. When we call intel_miptree_copy_teximage in the process
> of re-creating a miptree (possibily because the number of miplevels
> has changed) we didn't account for this, so we where only copying
> texture images for the first slice.
> ---
> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> Fixes the problems for GL_TEXTURE_1D_ARRAYS described here:
> http://lists.freedesktop.org/archives/mesa-dev/2015-January/075264.html
>
> The GPU hang mentioned there was a different problem and seems to
> be fixed since:
> b52959c60 i965/tiled_memcpy: Add tiled-to-linear paths
No, that just made us stop using the glitter for some test somewhere. This
patch fixes the bug.
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 26e137d..11f1876 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -1249,7 +1249,12 @@ intel_miptree_copy_teximage(struct brw_context
*brw,
> intel_texture_object(intelImage->base.Base.TexObject);
> int level = intelImage->base.Base.Level;
> int face = intelImage->base.Base.Face;
> - GLuint depth = intelImage->base.Base.Depth;
> +
> + GLuint depth;
> + if (intel_obj->base.Target == GL_TEXTURE_1D_ARRAY)
> + depth = intelImage->base.Base.Height;
> + else
> + depth = intelImage->base.Base.Depth;
Looks correct to me.
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
> if (!invalidate) {
> for (int slice = 0; slice < depth; slice++) {
> --
> 2.1.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150130/bcc6e566/attachment.html>
More information about the mesa-dev
mailing list