mesa/src/intel
Kenneth Graunke abba55382f intel/compiler: Vectorize gl_TessLevelInner/Outer[] writes
Setting the NIR options takes care of iris thanks to the common st/mesa
linking code, and updating brw_nir_link_shaders should handle anv.

The main effort here is updating remap_tess_levels, which needs to
handle vector stores, writemasking, and swizzling.  Unfortunately,
we also need to continue handling the existing single-component
access because it's used for TES inputs, which we don't vectorize.

We could try to vectorize TES inputs too, but they're all pushed
anyway, so it wouldn't buy us much other than deleting this code.
Also, we do have opt_combine_stores, but not one for loads.

One limitation of using nir_vectorize_tess_levels is that it works
on variables, and so isn't able to combine outer/inner writes that
happen to live in the same vec4 slot (for triangle domains).  That
said, it's still better than before.

For writes, we allow the intrinsics to supply up to the full size
of the variable (vec4 for outer, vec2 for inner) even if the domain
only requires a subset of those components (i.e. triangles needs 3).

shader-db results on Icelake:

   total instructions in shared programs: 19605070 -> 19602284 (-0.01%)
   instructions in affected programs: 65338 -> 62552 (-4.26%)
   helped: 271 / HURT: 0
   helped stats (abs) min: 6 max: 24 x̄: 10.28 x̃: 12
   helped stats (rel) min: 1.30% max: 18.18% x̄: 5.80% x̃: 7.59%
   95% mean confidence interval for instructions value: -10.71 -9.85
   95% mean confidence interval for instructions %-change: -6.17% -5.43%
   Instructions are helped.

   total cycles in shared programs: 851854659 -> 851820320 (<.01%)
   cycles in affected programs: 618749 -> 584410 (-5.55%)
   helped: 271 / HURT: 0
   helped stats (abs) min: 69 max: 540 x̄: 126.71 x̃: 108
   helped stats (rel) min: 2.57% max: 37.97% x̄: 6.17% x̃: 5.06%
   95% mean confidence interval for cycles value: -135.89 -117.54
   95% mean confidence interval for cycles %-change: -6.72% -5.63%
   Cycles are helped.

   total sends in shared programs: 1025285 -> 1024355 (-0.09%)
   sends in affected programs: 6454 -> 5524 (-14.41%)
   helped: 271 / HURT: 0
   helped stats (abs) min: 2 max: 8 x̄: 3.43 x̃: 4
   helped stats (rel) min: 5.71% max: 25.00% x̄: 14.98% x̃: 17.39%
   95% mean confidence interval for sends value: -3.57 -3.29
   95% mean confidence interval for sends %-change: -15.42% -14.54%
   Sends are helped.

According to Felix DeGrood, this results in a 10% improvement in
the draw call time for certain draw calls from Strange Brigade.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17944>
2022-09-27 18:17:56 -07:00
..
blorp blorp: defined operations for debug purposes 2022-09-21 12:38:34 +00:00
ci ci/intel: drop glmark2 terrain trace 2022-09-18 18:51:14 +00:00
common intel/l3: Use L3 full-way allocation setting for gfx12.5 (DG2, MTL) 2022-09-23 12:49:37 -07:00
compiler intel/compiler: Vectorize gl_TessLevelInner/Outer[] writes 2022-09-27 18:17:56 -07:00
dev intel/dev: Adjust prefetch_size values for MTL engines 2022-09-22 02:14:47 +00:00
ds intel/utrace: create the callback events for xfb trace points 2022-09-22 06:59:06 +00:00
genxml intel/genxml: add VFG_PREEMPTION_CHICKEN_BITS register 2022-09-14 10:01:23 +00:00
isl intel/utrace: make blorp tracepoints more readable 2022-09-21 12:38:34 +00:00
nullhw-layer intel/nullhw: Use correct macro to fix build regression 2022-08-01 10:54:38 +00:00
perf intel: fix typos found by codespell 2022-06-27 10:20:55 +00:00
tools intel/tools: Also look for 'batch' tag 2022-08-17 02:24:09 +00:00
vulkan anv: implement Wa_14016118574 2022-09-23 12:27:05 +00:00
vulkan_hasvk intel/dev: Adjust prefetch_size values for MTL engines 2022-09-22 02:14:47 +00:00
meson.build intel: add a hasvk vulkan driver 2022-09-02 09:40:45 +00:00