r600: partly revert disabling tiling for 1d texture.
authorDave Airlie <airlied@redhat.com>
Wed, 28 Feb 2018 04:37:45 +0000 (04:37 +0000)
committerDave Airlie <airlied@redhat.com>
Wed, 28 Feb 2018 04:59:37 +0000 (04:59 +0000)
Previously we had a check for 1d of narrow 2D textures, however
narrow 2d textures caused gpu hangs, but it was correct for 1d
textures.

This fixes a bunch of 1D image piglits for me.

Fixes: 7b8e1c089d (r600/texture: drop lowering 1d/2d images to linear.)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_texture.c

index 03cdcd22eee2bc935faf93d4160bb209d998dfdc..1fbb682d67110427c92e16d9135cc6254174e91b 100644 (file)
@@ -1053,6 +1053,11 @@ r600_choose_tiling(struct r600_common_screen *rscreen,
                if (templ->bind & PIPE_BIND_LINEAR)
                        return RADEON_SURF_MODE_LINEAR_ALIGNED;
 
+               /* 1D textures should be linear - fixes image operations on 1d */
+               if (templ->target == PIPE_TEXTURE_1D ||
+                   templ->target == PIPE_TEXTURE_1D_ARRAY)
+                       return RADEON_SURF_MODE_LINEAR_ALIGNED;
+
                /* Textures likely to be mapped often. */
                if (templ->usage == PIPE_USAGE_STAGING ||
                    templ->usage == PIPE_USAGE_STREAM)