tu: Lower ViewIndex to 0 when multiview is disabled
This is an optimization, but it also seems to be required because the HW sometimes fails to set ViewIndex to 0. This fixes flakes with dEQP-VK.renderpass2.fragment_density_map.*multiviewport where the VS for the main renderpass is reused for the copy renderpass afterwards and it copies ViewIndex to ViewportIndex expecting it to be 0 since multiview is disabled for the copy renderpass. Closes: #13534 Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37206>
This commit is contained in:
@@ -270,7 +270,6 @@ dEQP-VK.tessellation.invariance.*
|
||||
# Updated by ci-collate
|
||||
spec@arb_gpu_shader_fp64@execution@arb_gpu_shader_fp64-wrong-type-setter
|
||||
spec@ext_external_objects@vk-image-display-overwrite
|
||||
bypass-dEQP-VK.renderpass2.fragment_density_map.2_views.render.non_divisible_density_size.2_samples.static_subsampled_2_2_multiviewport
|
||||
|
||||
# SKQP test which seems to flake out
|
||||
SRGBReadWritePixels
|
||||
|
||||
@@ -2,10 +2,6 @@ KHR-GL46.buffer_storage.map_persistent_dispatch
|
||||
KHR-GL46.buffer_storage.map_persistent_flush
|
||||
KHR-GL46.shader_subroutine.control_flow_and_returned_subroutine_values_used_as_subroutine_input
|
||||
|
||||
# FDM flakes:
|
||||
# See https://gitlab.freedesktop.org/mesa/mesa/-/issues/13534 for possible reproducer.
|
||||
.*dEQP-VK.renderpass2.fragment_density_map.2_views.render.*divisible_density_size.2_samples.static_subsampled_[12]_[12]_multiviewport
|
||||
|
||||
# a618 and a660 seem to have some general instability in tesselation and GS.
|
||||
# Some tess tests also use the GS (tesselation.invariance), but others
|
||||
# don't (spirv_assembly). They don't appear to be correlated to any GPU
|
||||
|
||||
@@ -204,10 +204,6 @@ dEQP-VK.query_pool.statistics_query.fragment_shader_invocations.primary.64bits_d
|
||||
|
||||
dEQP-VK.renderpass.suballocation.multisample_resolve.layers_6.r16_sfloat.samples_4_resolve_level_2
|
||||
|
||||
# FDM flakes:
|
||||
# See https://gitlab.freedesktop.org/mesa/mesa/-/issues/13534 for possible reproducer.
|
||||
.*dEQP-VK.renderpass2.fragment_density_map.2_views.render.*divisible_density_size.2_samples.static_subsampled_[12]_[12]_multiviewport
|
||||
|
||||
dEQP-VK.renderpass2.suballocation.multisample_resolve.layers_6.r8g8b8a8_snorm.samples_4_resolve_level_2
|
||||
dEQP-VK.renderpass2.suballocation.multisample_resolve.r32g32b32a32_sfloat.max_attachments_8_samples_4
|
||||
|
||||
|
||||
@@ -1220,6 +1220,29 @@ tu_nir_lower_layered_fdm(nir_shader *shader,
|
||||
nir_metadata_control_flow, &state);
|
||||
}
|
||||
|
||||
static bool
|
||||
lower_view_to_zero_filter(const nir_instr *instr, const void *cb)
|
||||
{
|
||||
return instr->type == nir_instr_type_intrinsic;
|
||||
}
|
||||
|
||||
static nir_def *
|
||||
lower_view_to_zero(nir_builder *b, nir_instr *instr, void *cb)
|
||||
{
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
if (intrin->intrinsic != nir_intrinsic_load_view_index)
|
||||
return NULL;
|
||||
|
||||
return nir_imm_int(b, 0);
|
||||
}
|
||||
|
||||
static bool
|
||||
tu_nir_lower_view_to_zero(nir_shader *shader)
|
||||
{
|
||||
return nir_shader_lower_instructions(shader, lower_view_to_zero_filter,
|
||||
lower_view_to_zero, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
shared_type_info(const struct glsl_type *type, unsigned *size, unsigned *align)
|
||||
{
|
||||
@@ -2672,6 +2695,9 @@ tu_shader_create(struct tu_device *dev,
|
||||
tu_nir_lower_multiview(nir, key->multiview_mask, dev);
|
||||
}
|
||||
|
||||
if (!key->multiview_mask)
|
||||
tu_nir_lower_view_to_zero(nir);
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT && key->force_sample_interp) {
|
||||
nir->info.fs.uses_sample_shading = true;
|
||||
nir_foreach_shader_in_variable(var, nir) {
|
||||
|
||||
Reference in New Issue
Block a user