v3d,v3dv: don't disable EZ for passthrough Z writes
The early-Z test uses Z values produced from FEP, so when we write Z from a shader we need to disable EZ. However, there are some instances where want to write the FEP-Z from the shader, in which case we would not need to disable EZ. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14037>
This commit is contained in:

committed by
Marge Bot

parent
a65c605365
commit
d7b79f3531
@@ -1429,7 +1429,8 @@ job_update_ez_state(struct v3dv_job *job,
|
||||
/* If the FS writes Z, then it may update against the chosen EZ direction */
|
||||
struct v3dv_shader_variant *fs_variant =
|
||||
pipeline->shared_data->variants[BROADCOM_SHADER_FRAGMENT];
|
||||
if (fs_variant->prog_data.fs->writes_z) {
|
||||
if (fs_variant->prog_data.fs->writes_z &&
|
||||
!fs_variant->prog_data.fs->writes_z_from_fep) {
|
||||
job->ez_state = V3D_EZ_DISABLED;
|
||||
return;
|
||||
}
|
||||
|
@@ -388,6 +388,7 @@ pack_shader_state_record(struct v3dv_pipeline *pipeline)
|
||||
* shader needs to write the Z value (even just discards).
|
||||
*/
|
||||
shader.fragment_shader_does_z_writes = prog_data_fs->writes_z;
|
||||
|
||||
/* Set if the EZ test must be disabled (due to shader side
|
||||
* effects and the early_z flag not being present in the
|
||||
* shader).
|
||||
|
@@ -605,6 +605,7 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d,
|
||||
*/
|
||||
shader.fragment_shader_does_z_writes =
|
||||
v3d->prog.fs->prog_data.fs->writes_z;
|
||||
|
||||
/* Set if the EZ test must be disabled (due to shader side
|
||||
* effects and the early_z flag not being present in the
|
||||
* shader).
|
||||
@@ -879,7 +880,8 @@ v3d_update_job_ez(struct v3d_context *v3d, struct v3d_job *job)
|
||||
* the chosen EZ direction (though we could use
|
||||
* ARB_conservative_depth's hints to avoid this)
|
||||
*/
|
||||
if (v3d->prog.fs->prog_data.fs->writes_z) {
|
||||
if (v3d->prog.fs->prog_data.fs->writes_z &&
|
||||
!v3d->prog.fs->prog_data.fs->writes_z_from_fep) {
|
||||
job->ez_state = V3D_EZ_DISABLED;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user