etnaviv: add linear texture support on GC7000
authorLucas Stach <l.stach@pengutronix.de>
Thu, 28 Mar 2019 09:14:23 +0000 (10:14 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 18 Oct 2019 17:06:35 +0000 (19:06 +0200)
It's just a matter of writing the addressing mode into the
texture descriptor.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
src/gallium/drivers/etnaviv/etnaviv_texture_desc.c

index 8e4aedbda0b2b0343757558146a7f97c45533ea9..aef856b1798a36a0a450306b763978b55422f9c9 100644 (file)
@@ -142,7 +142,9 @@ etna_create_sampler_view_desc(struct pipe_context *pctx, struct pipe_resource *p
 
 #define DESC_SET(x, y) buf[(TEXDESC_##x)>>2] = (y)
    DESC_SET(CONFIG0, COND(!ext && !astc, VIVS_TE_SAMPLER_CONFIG0_FORMAT(format))
-                   | VIVS_TE_SAMPLER_CONFIG0_TYPE(target_hw));
+                   | VIVS_TE_SAMPLER_CONFIG0_TYPE(target_hw) |
+                   COND(res->layout == ETNA_LAYOUT_LINEAR && !util_format_is_compressed(so->format),
+                        VIVS_TE_SAMPLER_CONFIG0_ADDRESSING_MODE(TEXTURE_ADDRESSING_MODE_LINEAR)));
    DESC_SET(CONFIG1, COND(ext, VIVS_TE_SAMPLER_CONFIG1_FORMAT_EXT(format)) |
                      COND(astc, VIVS_TE_SAMPLER_CONFIG1_FORMAT_EXT(TEXTURE_FORMAT_EXT_ASTC)) |
                             VIVS_TE_SAMPLER_CONFIG1_HALIGN(res->halign) | swiz);