turnip: disable early_z for VK_FORMAT_S8_UINT

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>
This commit is contained in:
Jonathan Marek 2020-06-21 22:08:45 -04:00 committed by Marge Bot
parent 04148f4411
commit c5b990f435
2 changed files with 7 additions and 5 deletions

View 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

View 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) {