Skip to content

r300: disable backend DCE for vertex shaders

Pavel Ondračka requested to merge ondracka/mesa:r300_vertex_deadcode into main

The first 8 commits come from !26816 (merged) and are a prerequisite (otherwise we get some shader-db regressions).

We can now safely disable the backend DCE for vertex shaders with no change in shader-db whatsoever and at least one piglit fix (due to bug in the backend DCE). The deadcode pass which was tracking the per-channel uses and doing DCE (and marking unused channels with RC_SWIZZLE_UNUSED) based on that is now replaced by simple pass that just sets RC_SWIZZLE_UNUSED based on the writemask. Once we translate to backend IR directly from NIR, we can do this at the translation, however for now we need this as TGSI has no concept of unused swizzle.

The nir_to_rc commit is needed to emit the correct writemask for indirect constant loads, as right now we would always end with xyzw regardless of the actual uses. The second commits disables the DCE and the last one is a cleanup I found during this (remove the backend fabs lowering for R300/R400 as everything that could have produced abs is now lowered in NIR).

Merge request reports