Module: Mesa Branch: master Commit: fdad1ca25650828855e6ae347ee84e53fcef12d2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fdad1ca25650828855e6ae347ee84e53fcef12d2
Author: Samuel Iglesias Gonsálvez <[email protected]> Date: Wed Jun 10 09:35:59 2020 +0200 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5146> --- src/freedreno/vulkan/tu_pipeline.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 5d41732c47c..c2cc4dbd009 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -2536,6 +2536,17 @@ tu_pipeline_builder_parse_depth_stencil(struct tu_pipeline_builder *builder, pipeline->lrz.write = false; 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 _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
