Mesa (main): panfrost: Raise maximum texture size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 25 14:06:02 UTC 2021


Module: Mesa
Branch: main
Commit: d051b06a484f4fadd6a71cdd580c76ddb93c597f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d051b06a484f4fadd6a71cdd580c76ddb93c597f

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Tue Aug 10 13:41:28 2021 -0400

panfrost: Raise maximum texture size

The hardware can handle much larger textures than we allowed. The game
"Cathedral" requires larger textures for some bizarre reason. Raise the
limit so the game runs, syncing MAX_MIP_LEVELS, the comments, and the CAPs.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Closes: #5203
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12312>

---

 src/gallium/drivers/panfrost/pan_screen.c | 6 +++---
 src/panfrost/include/panfrost-job.h       | 7 +++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index eaa2b7e5b33..8c119168a16 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -219,11 +219,11 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
                 return 1;
 
         case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
-                return 4096;
+                return 1 << (MAX_MIP_LEVELS - 1);
+
         case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
-                return 13;
         case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-                return 13;
+                return MAX_MIP_LEVELS;
 
         case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
                 /* Hardware is natively upper left */
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 67c9805e6c4..19e537fcebf 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -232,8 +232,11 @@ typedef uint64_t mali_ptr;
 
 #define MALI_POSITIVE(dim) (dim - 1)
 
-/* 8192x8192 */
-#define MAX_MIP_LEVELS (13)
+/* Mali hardware can texture up to 65536 x 65536 x 65536 and render up to 16384
+ * x 16384, but 8192 x 8192 should be enough for anyone.  The OpenGL game
+ * "Cathedral" requires a texture of width 8192 to start.
+ */
+#define MAX_MIP_LEVELS (14)
 
 /* Used for lod encoding. Thanks @urjaman for pointing out these routines can
  * be cleaned up a lot. */



More information about the mesa-commit mailing list