lima: always set stride in texture descriptor
authorErico Nunes <nunes.erico@gmail.com>
Mon, 1 Feb 2021 00:27:50 +0000 (01:27 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 2 Feb 2021 16:54:47 +0000 (16:54 +0000)
We can just always specify the stride parameter regardless of whether
an alignment was forced or not. This fixes some issues where it is not
straightforward to detect the need to specify stride by checking the
buffer width (e.g. imported dmabuf to be used as texture).

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8549>

src/gallium/drivers/lima/lima_texture.c

index 4ac3631..7079865 100644 (file)
@@ -91,11 +91,8 @@ lima_texture_desc_set_res(struct lima_context *ctx, lima_tex_desc *desc,
    if (lima_res->tiled)
       layout = 3;
    else {
-      /* for padded linear texture */
-      if (lima_res->levels[first_level].width != width) {
-         desc->stride = lima_res->levels[first_level].stride;
-         desc->has_stride = 1;
-      }
+      desc->stride = lima_res->levels[first_level].stride;
+      desc->has_stride = 1;
       layout = 0;
    }