Commit bcf50eb4 authored by Danylo Piliaiev's avatar Danylo Piliaiev 💬
Browse files

turnip: do not ignore early_fragment_tests

Specifying "early_fragment_tests" in fragment shader takes precedence
over our internal conditions.

Fixes test:
 dEQP-VK.fragment_operations.early_fragment.early_fragment_tests_stencil

Fixes: b2a60c15

 "turnip: add LRZ early-z support"
Signed-off-by: Danylo Piliaiev's avatarDanylo Piliaiev <dpiliaiev@igalia.com>
parent a50d5b13
Pipeline #319250 waiting for manual action with stages
in 8 seconds
......@@ -3594,6 +3594,10 @@ tu6_build_depth_plane_z_mode(struct tu_cmd_buffer *cmd)
if (cmd->state.pipeline->lrz.force_late_z || !depth_test_enable)
zmode = A6XX_LATE_Z;
/* User defined early tests take precedence above all else */
if (cmd->state.pipeline->lrz.early_fragment_tests)
zmode = A6XX_EARLY_Z;
tu_cs_emit_pkt4(&cs, REG_A6XX_GRAS_SU_DEPTH_PLANE_CNTL, 1);
tu_cs_emit(&cs, A6XX_GRAS_SU_DEPTH_PLANE_CNTL_Z_MODE(zmode));
......
......@@ -1442,6 +1442,7 @@ tu6_emit_fs_outputs(struct tu_cs *cs,
if (pipeline) {
pipeline->lrz.fs_has_kill = fs->has_kill;
pipeline->lrz.early_fragment_tests = fs->shader->nir->info.fs.early_fragment_tests;
if ((fs->shader && !fs->shader->nir->info.fs.early_fragment_tests) &&
(fs->no_earlyz || fs->has_kill || fs->writes_pos || fs->writes_stencilref || no_earlyz || fs->writes_smask)) {
......
......@@ -862,6 +862,7 @@ struct tu_lrz_pipeline
uint32_t force_disable_mask;
bool fs_has_kill;
bool force_late_z;
bool early_fragment_tests;
};
struct tu_lrz_state
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment