mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 08:08:06 +02:00
tu: Add LRZ disable reason to renderpass tracepoint
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29707>
This commit is contained in:
parent
3b4133acf8
commit
aba7140b38
4 changed files with 27 additions and 11 deletions
|
|
@ -2066,7 +2066,9 @@ tu_cmd_render_tiles(struct tu_cmd_buffer *cmd,
|
|||
trace_end_render_pass(&cmd->trace, &cmd->cs, true,
|
||||
cmd->state.rp.drawcall_count,
|
||||
cmd->state.rp.drawcall_bandwidth_per_sample_sum /
|
||||
cmd->state.rp.drawcall_count);
|
||||
cmd->state.rp.drawcall_count,
|
||||
cmd->state.lrz.valid,
|
||||
cmd->state.rp.lrz_disable_reason);
|
||||
|
||||
/* We have trashed the dynamically-emitted viewport, scissor, and FS params
|
||||
* via the patchpoints, so we need to re-emit them if they are reused for a
|
||||
|
|
@ -2106,7 +2108,9 @@ tu_cmd_render_sysmem(struct tu_cmd_buffer *cmd,
|
|||
trace_end_render_pass(&cmd->trace, &cmd->cs, false,
|
||||
cmd->state.rp.drawcall_count,
|
||||
cmd->state.rp.drawcall_bandwidth_per_sample_sum /
|
||||
cmd->state.rp.drawcall_count);
|
||||
cmd->state.rp.drawcall_count,
|
||||
cmd->state.lrz.valid,
|
||||
cmd->state.rp.lrz_disable_reason);
|
||||
}
|
||||
|
||||
template <chip CHIP>
|
||||
|
|
@ -3869,6 +3873,8 @@ tu_render_pass_state_merge(struct tu_render_pass_state *dst,
|
|||
dst->drawcall_count += src->drawcall_count;
|
||||
dst->drawcall_bandwidth_per_sample_sum +=
|
||||
src->drawcall_bandwidth_per_sample_sum;
|
||||
if (!dst->lrz_disable_reason)
|
||||
dst->lrz_disable_reason = src->lrz_disable_reason;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -310,6 +310,8 @@ struct tu_render_pass_state
|
|||
* just intended to be a rough estimate that is easy to calculate.
|
||||
*/
|
||||
uint32_t drawcall_bandwidth_per_sample_sum;
|
||||
|
||||
const char *lrz_disable_reason;
|
||||
};
|
||||
|
||||
/* These are the states of the suspend/resume state machine. In addition to
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@
|
|||
* before using LRZ.
|
||||
*/
|
||||
|
||||
static inline void
|
||||
tu_lrz_disable_reason(struct tu_cmd_buffer *cmd, const char *reason) {
|
||||
cmd->state.rp.lrz_disable_reason = reason;
|
||||
perf_debug(cmd->device, "Disabling LRZ because '%s'", reason);
|
||||
}
|
||||
|
||||
template <chip CHIP>
|
||||
static void
|
||||
tu6_emit_lrz_buffer(struct tu_cs *cs, struct tu_image *depth_image)
|
||||
|
|
@ -262,6 +268,8 @@ tu_lrz_begin_renderpass(struct tu_cmd_buffer *cmd)
|
|||
{
|
||||
const struct tu_render_pass *pass = cmd->state.pass;
|
||||
|
||||
cmd->state.rp.lrz_disable_reason = "";
|
||||
|
||||
int lrz_img_count = 0;
|
||||
for (unsigned i = 0; i < pass->attachment_count; i++) {
|
||||
if (cmd->state.attachments[i]->image->lrz_height)
|
||||
|
|
@ -274,9 +282,7 @@ tu_lrz_begin_renderpass(struct tu_cmd_buffer *cmd)
|
|||
* and tiling passes, but it is untested and would add complexity for
|
||||
* presumably extremely rare case.
|
||||
*/
|
||||
perf_debug(cmd->device,
|
||||
"Invalidating LRZ because there are several subpasses with "
|
||||
"different depth attachments in a single renderpass");
|
||||
tu_lrz_disable_reason(cmd, "Several subpasses with different depth attachments");
|
||||
|
||||
for (unsigned i = 0; i < pass->attachment_count; i++) {
|
||||
struct tu_image *image = cmd->state.attachments[i]->image;
|
||||
|
|
@ -681,7 +687,7 @@ tu6_calculate_lrz_state(struct tu_cmd_buffer *cmd,
|
|||
perf_debug(cmd->device, "Skipping LRZ due to FS");
|
||||
temporary_disable_lrz = true;
|
||||
} else {
|
||||
perf_debug(cmd->device, "Disabling LRZ due to FS (TODO: fix for gpu-direction-tracking case");
|
||||
tu_lrz_disable_reason(cmd, "FS writes depth or has side-effects (TODO: fix for gpu-direction-tracking case)");
|
||||
disable_lrz = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -702,7 +708,7 @@ tu6_calculate_lrz_state(struct tu_cmd_buffer *cmd,
|
|||
* so if there is a depth write - LRZ must be disabled.
|
||||
*/
|
||||
if (z_write_enable) {
|
||||
perf_debug(cmd->device, "Invalidating LRZ due to ALWAYS/NOT_EQUAL");
|
||||
tu_lrz_disable_reason(cmd, "Depth write + ALWAYS/NOT_EQUAL");
|
||||
disable_lrz = true;
|
||||
gras_lrz_cntl.dir = LRZ_DIR_INVALID;
|
||||
} else {
|
||||
|
|
@ -746,7 +752,7 @@ tu6_calculate_lrz_state(struct tu_cmd_buffer *cmd,
|
|||
lrz_direction != TU_LRZ_UNKNOWN &&
|
||||
cmd->state.lrz.prev_direction != lrz_direction) {
|
||||
if (z_write_enable) {
|
||||
perf_debug(cmd->device, "Invalidating LRZ due to direction change");
|
||||
tu_lrz_disable_reason(cmd, "Depth write + compare-op direction change");
|
||||
disable_lrz = true;
|
||||
} else {
|
||||
perf_debug(cmd->device, "Skipping LRZ due to direction change");
|
||||
|
|
@ -792,7 +798,7 @@ tu6_calculate_lrz_state(struct tu_cmd_buffer *cmd,
|
|||
*/
|
||||
if (!lrz_allowed) {
|
||||
if (z_write_enable) {
|
||||
perf_debug(cmd->device, "Invalidating LRZ due to stencil write");
|
||||
tu_lrz_disable_reason(cmd, "Stencil write");
|
||||
disable_lrz = true;
|
||||
} else {
|
||||
perf_debug(cmd->device, "Skipping LRZ due to stencil write");
|
||||
|
|
@ -823,7 +829,7 @@ tu6_calculate_lrz_state(struct tu_cmd_buffer *cmd,
|
|||
* fragments from draw A which should be visible due to draw B.
|
||||
*/
|
||||
if (reads_dest && z_write_enable && cmd->device->instance->conservative_lrz) {
|
||||
perf_debug(cmd->device, "Invalidating LRZ due to blend+depthwrite");
|
||||
tu_lrz_disable_reason(cmd, "Depth write + blending");
|
||||
disable_lrz = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,9 @@ begin_end_tp('render_pass',
|
|||
# Args known only at the end of the renderpass:
|
||||
end_args=[Arg(type='bool', var='tiledRender', c_format='%s', to_prim_type='({} ? "true" : "false")'),
|
||||
Arg(type='uint32_t', var='drawCount', c_format='%u'),
|
||||
Arg(type='uint32_t', var='avgPerSampleBandwidth', c_format='%u'),])
|
||||
Arg(type='uint32_t', var='avgPerSampleBandwidth', c_format='%u'),
|
||||
Arg(type='bool', var='lrz', c_format='%s', to_prim_type='({} ? "true" : "false")'),
|
||||
Arg(type='const char *', var='lrzDisableReason', c_format='%s'),])
|
||||
|
||||
|
||||
begin_end_tp('binning_ib')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue