ac/nir/ngg: fix store shared alignment
authorQiang Yu <yuq825@gmail.com>
Wed, 5 Apr 2023 01:52:01 +0000 (09:52 +0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 7 Apr 2023 03:42:25 +0000 (03:42 +0000)
For stream!=0, this align_mul=4 is not true. Not observe any
problem yet, just for correctness.

Fixes: 60ac5dda82e ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>

src/amd/common/ac_nir_lower_ngg.c

index af80322..b6569ac 100644 (file)
@@ -2777,7 +2777,10 @@ lower_ngg_gs_emit_vertex_with_counter(nir_builder *b, nir_intrinsic_instr *intri
       prim_flag = nir_ior(b, prim_flag, odd_flag);
    }
 
-   nir_store_shared(b, nir_u2u8(b, prim_flag), gs_emit_vtx_addr, .base = s->lds_offs_primflags + stream, .align_mul = 4u);
+   nir_store_shared(b, nir_u2u8(b, prim_flag), gs_emit_vtx_addr,
+                    .base = s->lds_offs_primflags + stream,
+                    .align_mul = 4, .align_offset = stream);
+
    nir_instr_remove(&intrin->instr);
    return true;
 }