mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
agx: fix phi translation corruption
we can't stomp over srcs[], where we allocated our space for sources. unclear how this worked before but it definitely breaks once you have a phi with 7 sources. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179>
This commit is contained in:
parent
f21dbfe5ae
commit
94f0209fb2
2 changed files with 8 additions and 9 deletions
|
|
@ -2146,6 +2146,7 @@ static void
|
|||
agx_emit_phi_deferred(agx_context *ctx, agx_block *block, agx_instr *I)
|
||||
{
|
||||
nir_phi_instr *phi = I->phi;
|
||||
I->phi = NULL;
|
||||
|
||||
/* Guaranteed by lower_phis_to_scalar */
|
||||
assert(phi->def.num_components == 1);
|
||||
|
|
|
|||
|
|
@ -309,15 +309,8 @@ typedef struct {
|
|||
/* Must be first */
|
||||
struct list_head link;
|
||||
|
||||
/* The sources list.
|
||||
*
|
||||
* As a special case to workaround ordering issues when translating phis, if
|
||||
* nr_srcs == 0 and the opcode is PHI, holds a pointer to the NIR phi node.
|
||||
*/
|
||||
union {
|
||||
agx_index *src;
|
||||
nir_phi_instr *phi;
|
||||
};
|
||||
/* The sources list. */
|
||||
agx_index *src;
|
||||
|
||||
/* Data flow */
|
||||
agx_index *dest;
|
||||
|
|
@ -348,6 +341,11 @@ typedef struct {
|
|||
enum agx_atomic_opc atomic_opc;
|
||||
enum agx_lod_mode lod_mode;
|
||||
struct agx_block *target;
|
||||
|
||||
/* As a special case to workaround ordering issues when translating phis,
|
||||
* if nr_srcs == 0 and the opcode is PHI, points to the NIR phi.
|
||||
*/
|
||||
nir_phi_instr *phi;
|
||||
};
|
||||
|
||||
/* For local access */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue