From 210f4aff1e24967b6fa25b228c09d2a8d0b617cb Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 3 Sep 2022 11:53:46 -0400 Subject: [PATCH] asahi: Identify and use first level field of texture As we recently discovered, the layout of level L of a mipmapped 2D image of size WxH is /not/ the same as the layout of a non-mipmapped 2D image of size minify(W, L) x minify(H, L). The difference occurs due to subtleties of the "power of two" miptrees which can force a level to use a larger tile size than it would have required at root level. To handle this quirk correctly, the driver must not implement texture views with address arithmetic -- it must supply instead the base width/height of a texture and use first/last level fields on the texture descriptor to map it. Similar issues occur when writing a particular level of a mipmapped texture, which was handled correctly in the colour case but not the Z/S case. Fixes dEQP-GLES2.functional.texture.mipmap.cube.generate.* Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/lib/cmdbuf.xml | 4 +-- src/gallium/drivers/asahi/agx_state.c | 36 +++++++++++++-------------- src/gallium/drivers/asahi/agx_state.h | 4 +-- src/gallium/drivers/asahi/magic.c | 9 ++++++- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/asahi/lib/cmdbuf.xml b/src/asahi/lib/cmdbuf.xml index 5ea0ea341bb..d77d8c2020a 100644 --- a/src/asahi/lib/cmdbuf.xml +++ b/src/asahi/lib/cmdbuf.xml @@ -226,8 +226,8 @@ - - + +