Module: Mesa
Branch: staging/20.1
Commit: 4520242547efb895c7a0893c5cb2418821858f3b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4520242547efb895c7a0893c5cb2418821858f3b

Author: Jonathan Marek <[email protected]>
Date:   Tue Jul  7 18:00:55 2020 -0400

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5796>
(cherry picked from commit 344e764b01202d9894c793d393d060dc5530145b)

---

 .pick_status.json                                | 2 +-
 src/gallium/drivers/freedreno/a2xx/fd2_texture.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index b001618228e..636ca66f137 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -526,7 +526,7 @@
         "description": "freedreno/a2xx: fix compressed textures",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "5a8718f01b3976e1bc82362a907befef68a7f525"
     },
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) |

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to