mesa/src/intel/vulkan
Jason Ekstrand d0d039a4d3 anv: Emit pushed UBO bounds checking code in the back-end compiler
This commit fixes performance regressions introduced by e03f965280
in which we started bounds checking our push constants.  This added a
LOT of shader code to shaders which use the robustBufferAccess feature
and led to substantial spilling.  The checking we just added to the FS
back-end is far more efficient for two reasons:

 1. It can be done at a whole register granularity rather than per-
    scalar and so we emit one SIMD8 SEL per 32B GRF rather than one
    SIMD16 SEL (executed as two SELs) for each component loaded.

 2. Because we do it with NoMask instructions, we can do it on whole
    pushed GRFs without splatting them out to SIMD8 or SIME16 values.
    This means that robust buffer access no longer explodes our register
    pressure for no good reason.

As a tiny side-benefit, we're now using can use AND instead of SEL which
means no need for the flag and better scheduling.

Vulkan pipeline database results on ICL:

    Instructions in all programs: 293586059 -> 238009118 (-18.9%)
    SENDs in all programs: 13568515 -> 13568515 (+0.0%)
    Loops in all programs: 149720 -> 149720 (+0.0%)
    Cycles in all programs: 88499234498 -> 84348917496 (-4.7%)
    Spills in all programs: 1229018 -> 184339 (-85.0%)
    Fills in all programs: 1348397 -> 246061 (-81.8%)

This also improves the performance of a few apps:

 - Shadow of the Tomb Raider: +4%
 - Witcher 3: +3.5%
 - UE4 Shooter demo: +2%

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4447>
2020-04-17 14:48:06 +00:00
..
tests anv/block_pool: Ensure allocations have contiguous maps 2020-01-29 09:43:42 -06:00
anv_allocator.c anv/allocator: Use util_dynarray for blocks in anv_state_stream 2020-03-31 08:12:07 +00:00
anv_android.c anv/android: make format_supported_with_usage static 2020-01-28 14:46:38 +02:00
anv_android.h anv: Drop unneeded struct keywords 2020-01-03 11:32:34 -06:00
anv_android_stubs.c anv: Drop unneeded struct keywords 2020-01-03 11:32:34 -06:00
anv_batch_chain.c anv: Re-use one old BT block in reset_batch_bo_chain 2020-01-29 09:43:42 -06:00
anv_blorp.c anv: Swizzle fast-clear values 2020-03-18 21:05:07 +00:00
anv_cmd_buffer.c anv: Stop using cs_prog_data->threads 2020-04-09 19:23:12 -07:00
anv_descriptor_set.c anv: Align UBO sizes to 32B 2020-03-07 04:51:28 +00:00
anv_device.c util/os_file: extend os_read_file to return the file size 2020-03-24 08:30:34 +01:00
anv_dump.c tree-wide: replace MAYBE_UNUSED with ASSERTED 2019-07-31 09:41:05 +01:00
anv_entrypoints_gen.py anv: Move the physical device dispatch table to anv_instance 2020-01-20 22:08:52 +00:00
anv_extensions.py anv: Advertise VK_KHR_shader_non_semantic_info 2020-02-18 09:57:15 -06:00
anv_extensions_gen.py anv: manually add KHR_display to the list of platforms 2019-07-07 15:34:09 +03:00
anv_formats.c anv: Reject modifiers on depth/stencil formats 2020-02-13 15:40:18 +00:00
anv_gem.c intel/common: provide common ioctl routine 2019-08-01 16:38:40 -07:00
anv_gem_stubs.c anv: gem-stubs: return a valid fd got anv_gem_userptr() 2019-09-25 22:02:51 +03:00
anv_genX.h anv: Plumb deref block size through to 3DSTATE_SF 2020-01-30 18:46:28 -06:00
anv_icd.py anv: fix typo 2019-06-29 22:41:06 +01:00
anv_image.c anv/image: Use align_u64 for image offsets 2020-04-02 15:08:42 +00:00
anv_intel.c anv: Take an anv_device in vk_errorf 2020-01-20 22:08:52 +00:00
anv_nir.h anv/gen12: Lower VK_KHR_multiview using Primitive Replication 2020-04-07 17:16:09 +00:00
anv_nir_add_base_work_group_id.c anv: Rework push constant handling 2019-11-18 18:35:14 +00:00
anv_nir_apply_pipeline_layout.c anv: Set alignments on descriptor and constant loads 2020-03-30 15:46:19 +00:00
anv_nir_compute_push_layout.c anv: Emit pushed UBO bounds checking code in the back-end compiler 2020-04-17 14:48:06 +00:00
anv_nir_lower_multiview.c anv/gen12: Lower VK_KHR_multiview using Primitive Replication 2020-04-07 17:16:09 +00:00
anv_nir_lower_ycbcr_textures.c nir: Drop nir_tex_instr::texture_array_size 2020-02-26 18:29:49 +00:00
anv_pass.c anv: Enable Vulkan 1.2 support 2020-01-15 08:34:57 -06:00
anv_perf.c intel/perf: store the probed i915-perf version 2020-03-27 14:14:49 +00:00
anv_pipeline.c anv: Report correct SLM size 2020-04-16 17:26:16 +00:00
anv_pipeline_cache.c anv: Keep the shader stage in anv_shader_bin 2020-03-12 13:18:54 -07:00
anv_private.h anv: Emit pushed UBO bounds checking code in the back-end compiler 2020-04-17 14:48:06 +00:00
anv_queue.c anv: No-op submit and wait calls when no_hw is set 2020-02-06 10:48:33 +00:00
anv_util.c anv: Take a device in anv_perf_warn 2020-01-20 22:08:52 +00:00
anv_wsi.c anv: Add an anv_physical_device field to anv_device 2020-01-20 22:08:52 +00:00
anv_wsi_display.c anv: Stop allocating WSI event fences off the instance 2020-01-20 22:08:52 +00:00
anv_wsi_wayland.c anv: drop unused includes 2018-10-24 18:15:05 +01:00
anv_wsi_x11.c vulkan: drop always-true param 2018-10-26 18:33:11 +01:00
gen7_cmd_buffer.c anv: Split graphics and compute bits from anv_pipeline 2020-03-12 13:18:54 -07:00
gen8_cmd_buffer.c anv: Split graphics and compute bits from anv_pipeline 2020-03-12 13:18:54 -07:00
genX_blorp_exec.c intel/blorp: Always emit URB config on Gen7+ 2020-01-30 18:46:20 -06:00
genX_cmd_buffer.c anv: Emit pushed UBO bounds checking code in the back-end compiler 2020-04-17 14:48:06 +00:00
genX_gpu_memcpy.c anv/gen12: Lower VK_KHR_multiview using Primitive Replication 2020-04-07 17:16:09 +00:00
genX_pipeline.c anv: Stop using cs_prog_data->threads 2020-04-09 19:23:12 -07:00
genX_query.c anv: implement gen9 post sync pipe control workaround 2020-02-05 00:25:48 +00:00
genX_state.c anv: Make AUX table invalidate a PIPE_* bit 2020-01-25 02:18:33 +00:00
meson.build intel: drop unused include directories 2020-03-28 21:36:54 +01:00
TODO anv: Implement pipeline statistics queries 2017-03-17 12:12:50 -07:00
vk_format_info.h anv: Add HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in vk_format 2019-06-24 08:28:18 +03:00