turnip: disable LRZ depending on fragment changes
Disable LRZ write if the fragment shader discard the fragments, modify its position or if early-Z is disabled. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5146>
This commit is contained in:
parent
d1fa40bdcf
commit
fdad1ca256
|
@ -2536,6 +2536,17 @@ tu_pipeline_builder_parse_depth_stencil(struct tu_pipeline_builder *builder,
|
||||||
pipeline->lrz.write = false;
|
pipeline->lrz.write = false;
|
||||||
pipeline->lrz.invalidate = true;
|
pipeline->lrz.invalidate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builder->shaders[MESA_SHADER_FRAGMENT]) {
|
||||||
|
const struct ir3_shader_variant *fs = &builder->shaders[MESA_SHADER_FRAGMENT]->ir3_shader->variants[0];
|
||||||
|
if (fs->has_kill || fs->no_earlyz || fs->writes_pos) {
|
||||||
|
pipeline->lrz.write = false;
|
||||||
|
}
|
||||||
|
if (fs->no_earlyz || fs->writes_pos) {
|
||||||
|
pipeline->lrz.enable = false;
|
||||||
|
pipeline->lrz.z_test_enable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue