v3dv: disable early Z writes if Z writes are disabled

I saw this while inspecting CL dumps from the UE Shooter demo,
where they disable Z writes for occlusion queries. The hardware
is probably doing this internally, but it doesn't hurt
to do this explicitly and make CL traces consistent with intended
behavior.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8571>
This commit is contained in:
Iago Toral Quiroga 2021-01-19 08:54:52 +01:00 committed by Marge Bot
parent 41d22eb68e
commit 15cf2ab642
3 changed files with 8 additions and 2 deletions

View file

@ -3501,8 +3501,9 @@ emit_configuration_bits(struct v3dv_cmd_buffer *cmd_buffer)
v3dv_return_if_oom(cmd_buffer, NULL);
cl_emit_with_prepacked(&job->bcl, CFG_BITS, pipeline->cfg_bits, config) {
config.early_z_updates_enable = job->ez_state != VC5_EZ_DISABLED;
config.early_z_enable = config.early_z_updates_enable;
config.early_z_enable = job->ez_state != VC5_EZ_DISABLED;
config.early_z_updates_enable = config.early_z_enable &&
pipeline->z_updates_enable;
}
}

View file

@ -2334,6 +2334,8 @@ pack_cfg_bits(struct v3dv_pipeline *pipeline,
config.stencil_enable =
ds_info ? ds_info->stencilTestEnable && has_ds_attachment: false;
pipeline->z_updates_enable = config.z_updates_enable;
};
}

View file

@ -1652,6 +1652,9 @@ struct v3dv_pipeline {
struct v3dv_pipeline_layout *layout;
/* Whether this pipeline enables depth writes */
bool z_updates_enable;
enum v3dv_ez_state ez_state;
bool msaa;