summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-07-29 19:06:44 -0400
committerDylan Baker <dylan.c.baker@intel.com>2020-08-07 10:44:36 -0700
commitd0b01658085ef5d0499b5769a104a2e8e6c85e2c (patch)
tree8c5d1f8de990a96078f23943c393cca5af847cbc
parent9a5b5cdf9cd4c2a046616ca3b89f98c0acab34a0 (diff)
Revert "radeonsi: honor a user-specified pitch on gfx10.3"
This reverts commit c4b5fd9ab096a0bb5106b93191b13c81cc32243b. It breaks mipmapping. This is only meant to be used by OpenCL, which allows setting a user pitch for linear images. In all other cases, don't support a custom pitch. Fixes: c4b5fd9ab096a0bb51 "radeonsi: honor a user-specified pitch on gfx10.3" Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6137> (cherry picked from commit 61c671c97e8632cf360ddbd2a6d7b3fe0e63627f)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c26
2 files changed, 7 insertions, 21 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 5a48c71bff7..398f752d94a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -85,7 +85,7 @@
"description": "Revert \"radeonsi: honor a user-specified pitch on gfx10.3\"",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "c4b5fd9ab096a0bb5106b93191b13c81cc32243b"
},
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 4ebcf5088a6..b960583327a 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3747,26 +3747,12 @@ static void gfx10_make_texture_descriptor(
S_00A00C_BASE_LEVEL(res->nr_samples > 1 ? 0 : first_level) |
S_00A00C_LAST_LEVEL(res->nr_samples > 1 ? util_logbase2(res->nr_samples) : last_level) |
S_00A00C_BC_SWIZZLE(gfx9_border_color_swizzle(desc->swizzle)) | S_00A00C_TYPE(type);
-
- if (res->target == PIPE_TEXTURE_1D ||
- res->target == PIPE_TEXTURE_2D) {
- /* 1D, 2D, and 2D_MSAA can set a custom pitch for shader resources
- * starting with gfx10.3 (ignored if pitch <= width). Other texture
- * targets can't. CB and DB can't set a custom pitch for any target.
- */
- if (screen->info.chip_class >= GFX10_3)
- state[4] = S_00A010_DEPTH(tex->surface.u.gfx9.surf_pitch - 1);
- else
- state[4] = 0;
- } else {
- /* Depth is the last accessible layer on gfx9+. The hw doesn't need
- * to know the total number of layers.
- */
- state[4] = S_00A010_DEPTH((type == V_008F1C_SQ_RSRC_IMG_3D && sampler) ?
- depth - 1 : last_layer) |
- S_00A010_BASE_ARRAY(first_layer);
- }
-
+ /* Depth is the the last accessible layer on gfx9+. The hw doesn't need
+ * to know the total number of layers.
+ */
+ state[4] =
+ S_00A010_DEPTH((type == V_008F1C_SQ_RSRC_IMG_3D && sampler) ? depth - 1 : last_layer) |
+ S_00A010_BASE_ARRAY(first_layer);
state[5] = S_00A014_ARRAY_PITCH(!!(type == V_008F1C_SQ_RSRC_IMG_3D && !sampler)) |
S_00A014_MAX_MIP(res->nr_samples > 1 ? util_logbase2(res->nr_samples)
: tex->buffer.b.b.last_level) |