lima/ppir: fix creation of mov node for non-ssa tex dest
In ppir when a texture node has only a single successor, it is used directly to output the texture lookup value, in order to save the insertion of a mov. However, a sequence like this can happen: r0 = (float)tex r8 (coord), 0 (texture), 0 (sampler) r1 = mov r0.z In this case, even if the mov is a single successor, the assumption that only the elements needed by the successor node cannot be made. The target register can also be read or written elsewhere and so the simplification cannot be made. Add an exception to cover this case. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8517>
This commit is contained in:
parent
b6f8f3a3ba
commit
250b511f8e
|
@ -162,7 +162,7 @@ static bool ppir_lower_texture(ppir_block *block, ppir_node *node)
|
|||
{
|
||||
ppir_dest *dest = ppir_node_get_dest(node);
|
||||
|
||||
if (ppir_node_has_single_succ(node)) {
|
||||
if (ppir_node_has_single_succ(node) && dest->type == ppir_target_ssa) {
|
||||
ppir_node *succ = ppir_node_first_succ(node);
|
||||
dest->type = ppir_target_pipeline;
|
||||
dest->pipeline = ppir_pipeline_reg_sampler;
|
||||
|
|
Loading…
Reference in New Issue