mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
anv: log fast color clear fallback reasons in vkCmdClearAttachments
Signed-off-by: Michael Cheng <michael.cheng@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40658>
This commit is contained in:
parent
63c47734a9
commit
3b7e56482d
2 changed files with 44 additions and 10 deletions
|
|
@ -1779,15 +1779,21 @@ can_fast_clear_color_att(struct anv_cmd_buffer *cmd_buffer,
|
|||
union isl_color_value clear_color =
|
||||
vk_to_isl_color(attachment->clearValue.color);
|
||||
|
||||
if (INTEL_DEBUG(DEBUG_NO_FAST_CLEAR))
|
||||
if (INTEL_DEBUG(DEBUG_NO_FAST_CLEAR)) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
|
||||
"Fast color clear rejected: DEBUG_NO_FAST_CLEAR");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* We don't support fast clearing with conditional rendering at the
|
||||
* moment. All the tracking done around fast clears (clear color updates
|
||||
* and fast-clear type updates) happens unconditionally.
|
||||
*/
|
||||
if (batch->flags & BLORP_BATCH_PREDICATE_ENABLE)
|
||||
if (batch->flags & BLORP_BATCH_PREDICATE_ENABLE) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
|
||||
"Fast color clear rejected: predication enabled");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rectCount > 1) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
|
||||
|
|
@ -1806,8 +1812,11 @@ can_fast_clear_color_att(struct anv_cmd_buffer *cmd_buffer,
|
|||
rect.baseArrayLayer += att->iview->planes[0].isl.base_array_layer;
|
||||
|
||||
bool is_multiview = cmd_buffer->state.gfx.view_mask != 0;
|
||||
if (is_multiview && (cmd_buffer->state.gfx.view_mask != 1))
|
||||
if (is_multiview && (cmd_buffer->state.gfx.view_mask != 1)) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
|
||||
"Fast color clear rejected: multiview mask unsupported");
|
||||
return false;
|
||||
}
|
||||
|
||||
return anv_can_fast_clear_color(cmd_buffer, att->iview->image,
|
||||
att->iview->vk.aspects,
|
||||
|
|
@ -1836,9 +1845,11 @@ clear_color_attachment(struct anv_cmd_buffer *cmd_buffer,
|
|||
vk_to_isl_color(attachment->clearValue.color);
|
||||
|
||||
const struct anv_image_view *iview = att->iview;
|
||||
if (iview &&
|
||||
can_fast_clear_color_att(cmd_buffer, batch, att,
|
||||
attachment, rectCount, pRects)) {
|
||||
if (!iview) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
|
||||
"Fast color clear rejected: missing image view");
|
||||
} else if (can_fast_clear_color_att(cmd_buffer, batch, att,
|
||||
attachment, rectCount, pRects)) {
|
||||
if (iview->image->vk.samples == 1) {
|
||||
exec_ccs_op(cmd_buffer, batch, iview->image,
|
||||
iview->planes[0].isl.format,
|
||||
|
|
@ -1866,6 +1877,10 @@ clear_color_attachment(struct anv_cmd_buffer *cmd_buffer,
|
|||
iview);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
anv_perf_warn(VK_LOG_OBJS(&cmd_buffer->device->vk.base),
|
||||
"Falling back to slow color clear path in "
|
||||
"vkCmdClearAttachments");
|
||||
}
|
||||
|
||||
uint32_t binding_table;
|
||||
|
|
|
|||
|
|
@ -3924,12 +3924,19 @@ anv_can_fast_clear_color(const struct anv_cmd_buffer *cmd_buffer,
|
|||
struct isl_swizzle view_swizzle,
|
||||
union isl_color_value clear_color)
|
||||
{
|
||||
if (INTEL_DEBUG(DEBUG_NO_FAST_CLEAR))
|
||||
if (INTEL_DEBUG(DEBUG_NO_FAST_CLEAR)) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
|
||||
"DEBUG_NO_FAST_CLEAR. Slow clearing.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* We only have fast-clears implemented for the render engine. */
|
||||
if (cmd_buffer->queue_family->engine_class != INTEL_ENGINE_CLASS_RENDER)
|
||||
if (cmd_buffer->queue_family->engine_class != INTEL_ENGINE_CLASS_RENDER) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
|
||||
"queue engine class unsupported for fast clear. "
|
||||
"Slow clearing.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Start by getting the fast clear type. We use the first subpass
|
||||
* layout here because we don't want to fast-clear if the first subpass
|
||||
|
|
@ -3941,6 +3948,8 @@ anv_can_fast_clear_color(const struct anv_cmd_buffer *cmd_buffer,
|
|||
cmd_buffer->queue_family->queueFlags);
|
||||
switch (fast_clear_type) {
|
||||
case ANV_FAST_CLEAR_NONE:
|
||||
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
|
||||
"layout does not support fast clear. Slow clearing.");
|
||||
return false;
|
||||
case ANV_FAST_CLEAR_DEFAULT_VALUE: {
|
||||
uint32_t view_pixel[4] = {};
|
||||
|
|
@ -3967,8 +3976,12 @@ anv_can_fast_clear_color(const struct anv_cmd_buffer *cmd_buffer,
|
|||
if (clear_rect->rect.offset.x != 0 ||
|
||||
clear_rect->rect.offset.y != 0 ||
|
||||
clear_rect->rect.extent.width != image->vk.extent.width ||
|
||||
clear_rect->rect.extent.height != image->vk.extent.height)
|
||||
clear_rect->rect.extent.height != image->vk.extent.height) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
|
||||
"partial clear rect unsupported for fast clear. "
|
||||
"Slow clearing.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* When a CLEAR state is possible for an aux-usage, guarantee that there is
|
||||
* only one clear color at any given time. The heuristic chosen is tuned to
|
||||
|
|
@ -4003,8 +4016,12 @@ anv_can_fast_clear_color(const struct anv_cmd_buffer *cmd_buffer,
|
|||
if (intel_needs_workaround(cmd_buffer->device->info, 18020603990)) {
|
||||
if (isl_format_get_layout(anv_surf->isl.format)->bpb <= 32 &&
|
||||
anv_surf->isl.logical_level0_px.w <= 256 &&
|
||||
anv_surf->isl.logical_level0_px.h <= 256)
|
||||
anv_surf->isl.logical_level0_px.h <= 256) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
|
||||
"Wa_18020603990: small 32bpp surface. "
|
||||
"Slow clearing.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* BSpec 46969 (r45602) tells us that we get no fast-clears for 3D:
|
||||
|
|
@ -4041,6 +4058,8 @@ anv_can_fast_clear_color(const struct anv_cmd_buffer *cmd_buffer,
|
|||
if (intel_needs_workaround(cmd_buffer->device->info, 16021232440) &&
|
||||
(image->vk.extent.height == 16 * 1024 ||
|
||||
image->vk.extent.width == 16 * 1024)) {
|
||||
anv_perf_warn(VK_LOG_OBJS(&image->vk.base),
|
||||
"Wa_16021232440: 16k dimension. Slow clearing.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue