From 344e764b01202d9894c793d393d060dc5530145b Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Tue, 7 Jul 2020 18:00:55 -0400 Subject: [PATCH] freedreno/a2xx: fix compressed textures Two problems: * Multiply has higher priority than shift * rsc->layout.format isn't initialized for a2xx Fixes: 5a8718f01b397 ("freedreno: Make the slice pitch be bytes, not pixels.") Signed-off-by: Jonathan Marek Part-of: --- src/gallium/drivers/freedreno/a2xx/fd2_texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_texture.c b/src/gallium/drivers/freedreno/a2xx/fd2_texture.c index 938fc6951d8..5545c416191 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_texture.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_texture.c @@ -187,8 +187,8 @@ fd2_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc, A2XX_SQ_TEX_0_SIGN_Y(fmt.sign) | A2XX_SQ_TEX_0_SIGN_Z(fmt.sign) | A2XX_SQ_TEX_0_SIGN_W(fmt.sign) | - A2XX_SQ_TEX_0_PITCH(slice0->pitch >> fdl_cpp_shift(&rsc->layout) * - util_format_get_blockwidth(rsc->layout.format)) | + A2XX_SQ_TEX_0_PITCH((slice0->pitch >> fdl_cpp_shift(&rsc->layout)) * + util_format_get_blockwidth(prsc->format)) | COND(rsc->layout.tile_mode, A2XX_SQ_TEX_0_TILED); so->tex1 = A2XX_SQ_TEX_1_FORMAT(fmt.format) | -- 2.30.2