turnip: disable early_z for VK_FORMAT_S8_UINT
authorJonathan Marek <jonathan@marek.ca>
Mon, 22 Jun 2020 02:08:45 +0000 (22:08 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 25 Jun 2020 03:02:56 +0000 (03:02 +0000)
This format doesn't have depth, and apparently having earlyz enabled can
cause issues. Fixes at least these tests:

dEQP-VK.renderpass.suballocation.multisample.s8_uint.samples_*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5586>

.gitlab-ci/deqp-freedreno-a630-bypass-fails.txt
src/freedreno/vulkan/tu_pipeline.c

index eabca8fb0bd3445f79d3b20c324a0c2cd0d9bb51..45fac70f001a67cdb93f42d029986901b21ca00d 100644 (file)
@@ -119,5 +119,4 @@ dEQP-VK.renderpass2.dedicated_allocation.formats.d24_unorm_s8_uint.input.clear.s
 dEQP-VK.renderpass2.dedicated_allocation.formats.d24_unorm_s8_uint.input.load.store.self_dep_draw_stencil_read_only
 dEQP-VK.renderpass2.suballocation.formats.d24_unorm_s8_uint.input.clear.store.self_dep_draw_stencil_read_only
 dEQP-VK.renderpass2.suballocation.multisample.d24_unorm_s8_uint.samples_4
-dEQP-VK.renderpass2.suballocation.multisample.s8_uint.samples_4
 dEQP-VK.renderpass2.suballocation.multisample.separate_stencil_usage.d24_unorm_s8_uint.samples_2.test_stencil
index 281695d16cbe42ff6d691526db29184b4be44b31..b0fb1cc9e460e2f768cc4a83f214a14673cd05ff 100644 (file)
@@ -1209,7 +1209,8 @@ static void
 tu6_emit_fs_outputs(struct tu_cs *cs,
                     const struct ir3_shader_variant *fs,
                     uint32_t mrt_count, bool dual_src_blend,
-                    uint32_t render_components)
+                    uint32_t render_components,
+                    bool is_s8_uint)
 {
    uint32_t smask_regid, posz_regid;
 
@@ -1255,7 +1256,7 @@ tu6_emit_fs_outputs(struct tu_cs *cs,
 
    enum a6xx_ztest_mode zmode;
 
-   if (fs->no_earlyz || fs->has_kill || fs->writes_pos) {
+   if (fs->no_earlyz || fs->has_kill || fs->writes_pos || is_s8_uint) {
       zmode = A6XX_LATE_Z;
    } else {
       zmode = A6XX_EARLY_Z;
@@ -1376,14 +1377,16 @@ tu6_emit_program(struct tu_cs *cs,
       tu6_emit_fs_inputs(cs, fs);
       tu6_emit_fs_outputs(cs, fs, builder->color_attachment_count,
                           builder->use_dual_src_blend,
-                          builder->render_components);
+                          builder->render_components,
+                          builder->depth_attachment_format == VK_FORMAT_S8_UINT);
    } else {
       /* TODO: check if these can be skipped if fs is disabled */
       struct ir3_shader_variant dummy_variant = {};
       tu6_emit_fs_inputs(cs, &dummy_variant);
       tu6_emit_fs_outputs(cs, &dummy_variant, builder->color_attachment_count,
                           builder->use_dual_src_blend,
-                          builder->render_components);
+                          builder->render_components,
+                          builder->depth_attachment_format == VK_FORMAT_S8_UINT);
    }
 
    if (gs || hs) {