Skip to content

r300: Request that nir-to-tgsi avoid generating TGSI_OPCODE_CMP.

Emma Anholt requested to merge anholt/mesa:r300-ntt-lrp into main
Given that our fcsels are on float-bools, we can emit the LRP directly and
save the backend having to emit a SLT to turn the CMP src[0] into a bool.

This required passing a codegen flags struct for nir-to-tgsi.  I think
this is a good way forward for it, as the alternative I think has mostly
been adding flags to nir_shader_compiler_options (since adding
PIPE_SHADER_CAPs is an unreasonable amount of pain).

r300 shader-db:
total instructions in shared programs: 1229664 -> 1221393 (-0.67%)
instructions in affected programs: 198838 -> 190567 (-4.16%)
total temps in shared programs: 175252 -> 175088 (-0.09%)
temps in affected programs: 2607 -> 2443 (-6.29%)
total consts in shared programs: 951217 -> 951222 (<.01%)
consts in affected programs: 763 -> 768 (0.66%)

This is a followup to !14880 (closed), just the last commit is actually this MR.

Merge request reports