mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-18 13:48:06 +02:00
This will clean code like: vec3 32 ssa_8 = frcp ssa_7.www vec3 32 ssa_9 = fmul ssa_7.xyz, ssa_8 into vec1 32 ssa_8 = frcp ssa_7.w vec3 32 ssa_9 = fmul ssa_7.xyz, ssa_8.xxx This helps r300 driver because we can only do single channel for math ops at a time, so the first version would result in three frcp instructions. The nir_opt_shrink_vectors comments even claim the pass should be doing this, however it actually does it only for nir_op_vecx instructions, so extend this for generic alu instructions. RV530 shader-db: total instructions in shared programs: 135032 -> 133707 (-0.98%) instructions in affected programs: 46121 -> 44796 (-2.87%) helped: 452 HURT: 26 total temps in shared programs: 17051 -> 17033 (-0.11%) temps in affected programs: 1509 -> 1491 (-1.19%) helped: 91 HURT: 30 12.02->12.08 (+0.5%) fps gain in Unigine Sanctuary (n=5) with RV530 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7051 Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com> Reiewed-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20213> |
||
|---|---|---|
| .. | ||
| clc | ||
| glsl | ||
| isaspec | ||
| nir | ||
| spirv | ||
| builtin_type_macros.h | ||
| glsl_types.cpp | ||
| glsl_types.h | ||
| meson.build | ||
| nir_gl_types.h | ||
| nir_types.cpp | ||
| nir_types.h | ||
| shader_enums.c | ||
| shader_enums.h | ||
| shader_info.h | ||