summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@collabora.com>2021-08-10 13:41:28 -0400
committerDylan Baker <dylan.c.baker@intel.com>2021-08-27 10:00:12 -0700
commit894627ec890e150498f6e3ccd780873271545041 (patch)
treec514c517d25c8067ad73f9c7788d7ad8053e5b8a
parent2f1bc2bb60638f064ab5537aa14fbdea9dbabdf9 (diff)
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@collabora.com> Closes: #5203 Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12312> (cherry picked from commit d051b06a484f4fadd6a71cdd580c76ddb93c597f)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c6
-rw-r--r--src/panfrost/include/panfrost-job.h7
3 files changed, 9 insertions, 6 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 8a89a589836..9a8cae96778 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1417,7 +1417,7 @@
"description": "panfrost: Raise maximum texture size",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 432351ba72d..593f158087d 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -218,11 +218,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 f585d9ebd23..31550a15995 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)
/* Cubemap bloats everything up */
#define MAX_CUBE_FACES (6)