nir: Add selection control enum for always taken divergent branches.

The new enum is called nir_selection_control_divergent_always_taken,
and it's almost the same as nir_selection_control_flatten.
The main difference between the two is that "flatten" represents
a choice made by the application but "divergent_always_taken" may
be applied by the compiler stack when it thinks this is beneficial.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17921>
This commit is contained in:
Timur Kristóf
2022-09-07 13:58:30 +02:00
committed by Marge Bot
parent a2ec843727
commit c0d0a7c176

View File

@@ -2825,6 +2825,14 @@ typedef enum {
* The application prefers to keep control flow.
*/
nir_selection_control_dont_flatten = 0x2,
/**
* May be applied by the compiler stack when it knows
* that a branch is divergent, and:
* - either both the if and else are always taken
* - the if or else is empty and the other is always taken
*/
nir_selection_control_divergent_always_taken = 0x3,
} nir_selection_control;
typedef struct nir_if {