iris,anv: Disable gfx12.0 fast-clears with unaligned pitch

We'll reduce pitch alignment in a following patch. However, CCS
fast-clears don't seem to work unless the pitch is 512B aligned.
Disable fast clears for unaligned pitches.

Prevents the next patch from failing the following piglit tests:
* fbo-attachments-blit-scaled-linear
* hiz-stencil-test-fbo-d24s8
* hiz
* polygon-mode-facing
* clearbuffer-mixed-format
* glsl-lod-bias (transient failure)

No failures have been observed in anv, but there are more restrictions
for fast-clears in that driver compared to iris.

Note:
* The -fbo flag is necessary to make these fail. Otherwise, they end up
  with aligned render targets.
* Each of these tests allocate an image that has a pitch greater than
  512B and they collectively cover all the misalignment options - 128B,
  256B and 384B.

Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29659>
This commit is contained in:
Nanley Chery 2024-03-07 19:01:48 -05:00 committed by Marge Bot
parent 695577e5b0
commit 26802b3224
2 changed files with 21 additions and 0 deletions

View file

@ -147,6 +147,16 @@ can_fast_clear_color(struct iris_context *ice,
return false;
}
/* On gfx12.0, CCS fast clears don't seem to cover the correct portion of
* the aux buffer when the pitch is not 512B-aligned.
*/
if (devinfo->verx10 == 120 &&
res->surf.samples == 1 &&
res->surf.row_pitch_B % 512) {
perf_debug(&ice->dbg, "Pitch not 512B-aligned. Slow clearing surface.");
return false;
}
return true;
}

View file

@ -3485,6 +3485,17 @@ anv_can_fast_clear_color_view(struct anv_device *device,
return false;
}
/* On gfx12.0, CCS fast clears don't seem to cover the correct portion of
* the aux buffer when the pitch is not 512B-aligned.
*/
if (device->info->verx10 == 120 &&
iview->image->planes->primary_surface.isl.samples == 1 &&
iview->image->planes->primary_surface.isl.row_pitch_B % 512) {
anv_perf_warn(VK_LOG_OBJS(&iview->image->vk.base),
"Pitch not 512B-aligned. Slow clearing surface.");
return false;
}
/* Disable sRGB fast-clears for non-0/1 color values on Gfx9. For texturing
* and draw calls, HW expects the clear color to be in two different color
* spaces after sRGB fast-clears - sRGB in the former and linear in the