return true;
}
+static bool ppir_lower_sat(ppir_block *block, ppir_node *node)
+{
+ /* Turn it into a mov with the saturate output modifier */
+ ppir_alu_node *alu = ppir_node_to_alu(node);
+
+ assert(alu->num_src == 1);
+
+ ppir_dest *move_dest = &alu->dest;
+ move_dest->modifier = ppir_outmod_clamp_fraction;
+ node->op = ppir_op_mov;
+
+ return true;
+}
+
static bool ppir_lower_branch(ppir_block *block, ppir_node *node)
{
ppir_branch_node *branch = ppir_node_to_branch(node);
[ppir_op_load_texture] = ppir_lower_texture,
[ppir_op_select] = ppir_lower_select,
[ppir_op_trunc] = ppir_lower_trunc,
+ [ppir_op_sat] = ppir_lower_sat,
[ppir_op_branch] = ppir_lower_branch,
};
[nir_op_fcsel] = ppir_op_select,
[nir_op_inot] = ppir_op_not,
[nir_op_ftrunc] = ppir_op_trunc,
+ [nir_op_fsat] = ppir_op_sat,
};
static ppir_node *ppir_emit_alu(ppir_block *block, nir_instr *ni)