mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 13:40:11 +01:00
aco/ngg: Make primitive export packing less prone to error.
Use lshl_or instead of lshl_add, which makes it more robust in handling -1 and -2 indices which will now just become null exports, which is what we want. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6964>
This commit is contained in:
parent
0bfe0495c1
commit
3645a3106a
1 changed files with 4 additions and 4 deletions
|
|
@ -10769,19 +10769,19 @@ Temp ngg_pack_prim_exp_arg(isel_context *ctx, unsigned num_vertices, const Temp
|
|||
assert(vtxindex[i].id());
|
||||
|
||||
if (i)
|
||||
tmp = bld.vop3(aco_opcode::v_lshl_add_u32, bld.def(v1), vtxindex[i], Operand(10u * i), tmp);
|
||||
tmp = bld.vop3(aco_opcode::v_lshl_or_b32, bld.def(v1), vtxindex[i], Operand(10u * i), tmp);
|
||||
else
|
||||
tmp = vtxindex[i];
|
||||
|
||||
/* The initial edge flag is always false in tess eval shaders. */
|
||||
if (ctx->stage == ngg_vertex_gs) {
|
||||
Temp edgeflag = bld.vop3(aco_opcode::v_bfe_u32, bld.def(v1), gs_invocation_id, Operand(8 + i), Operand(1u));
|
||||
tmp = bld.vop3(aco_opcode::v_lshl_add_u32, bld.def(v1), edgeflag, Operand(10u * i + 9u), tmp);
|
||||
Temp edgeflag = bld.vop3(aco_opcode::v_bfe_u32, bld.def(v1), gs_invocation_id, Operand(8u + i), Operand(1u));
|
||||
tmp = bld.vop3(aco_opcode::v_lshl_or_b32, bld.def(v1), edgeflag, Operand(10u * i + 9u), tmp);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_null.id())
|
||||
tmp = bld.vop3(aco_opcode::v_lshl_add_u32, bld.def(v1), is_null, Operand(31u), tmp);
|
||||
tmp = bld.vop3(aco_opcode::v_lshl_or_b32, bld.def(v1), is_null, Operand(31u), tmp);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue