turnip: consider HW limit on number of views when apply multipos opt

Blob doesn't apply multipos optimization starting from 11 views
even on a650, however in practice, with the limit of 16 views,
tests pass on a640/a650 and fail on a630.

Fixes tests:
 dEQP-VK.multiview.draw_indexed.max_multi_view_view_count
 dEQP-VK.multiview.input_attachments.max_multi_view_view_count
 dEQP-VK.multiview.masks.max_multi_view_view_count
 dEQP-VK.multiview.multisample.max_multi_view_view_count
 dEQP-VK.multiview.queries.max_multi_view_view_count
 dEQP-VK.multiview.renderpass2.index.fragment_shader.max_multi_view_view_count
 dEQP-VK.multiview.secondary_cmd_buffer.max_multi_view_view_count

Fixes: 8d275778 ("tu: Enable multi-position output")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9135>
This commit is contained in:
Danylo Piliaiev
2021-02-18 19:15:14 +02:00
committed by Marge Bot
parent 88f42ea93e
commit b6b3b38434
2 changed files with 9 additions and 8 deletions

View File

@@ -54,13 +54,6 @@ dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite
dEQP-VK.memory_model.write_after_read.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_local.image.guard_nonlocal.workgroup.comp,Fail
dEQP-VK.memory.requirements.dedicated_allocation.buffer.regular,Fail
dEQP-VK.memory.requirements.dedicated_allocation.image.transient_tiling_optimal,Fail
dEQP-VK.multiview.draw_indexed.max_multi_view_view_count,Fail
dEQP-VK.multiview.input_attachments.max_multi_view_view_count,Fail
dEQP-VK.multiview.masks.max_multi_view_view_count,Fail
dEQP-VK.multiview.multisample.max_multi_view_view_count,Fail
dEQP-VK.multiview.queries.max_multi_view_view_count,Fail
dEQP-VK.multiview.renderpass2.index.fragment_shader.max_multi_view_view_count,Fail
dEQP-VK.multiview.secondary_cmd_buffer.max_multi_view_view_count,Fail
dEQP-VK.pipeline.extended_dynamic_state.after_pipelines.depth_compare_greater_equal_greater,Fail
dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_always_greater,Fail
dEQP-VK.pipeline.extended_dynamic_state.before_draw.depth_compare_greater_equal_greater_then_equal,Fail

View File

@@ -83,6 +83,13 @@ tu_nir_lower_multiview(nir_shader *nir, uint32_t mask, bool *multi_pos_output,
unsigned num_views = util_logbase2(mask) + 1;
/* Blob doesn't apply multipos optimization starting from 11 views
* even on a650, however in practice, with the limit of 16 views,
* tests pass on a640/a650 and fail on a630.
*/
unsigned max_views_for_multipos =
dev->physical_device->info.a6xx.supports_multiview_mask ? 16 : 10;
/* Speculatively assign output locations so that we know num_outputs. We
* will assign output locations for real after this pass.
*/
@@ -93,7 +100,8 @@ tu_nir_lower_multiview(nir_shader *nir, uint32_t mask, bool *multi_pos_output,
* overflow VPC with the extra copies of gl_Position.
*/
if (likely(!(dev->physical_device->instance->debug_flags & TU_DEBUG_NOMULTIPOS)) &&
num_outputs + (num_views - 1) <= 32 && nir_can_lower_multiview(nir)) {
num_views <= max_views_for_multipos && num_outputs + (num_views - 1) <= 32 &&
nir_can_lower_multiview(nir)) {
*multi_pos_output = true;
/* It appears that the multiview mask is ignored when multi-position