mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-19 21:28:32 +02:00
nir/uub: fix exclusive scans
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36874>
This commit is contained in:
parent
c7e48f79b7
commit
a2e48d2ede
1 changed files with 7 additions and 0 deletions
|
|
@ -1751,12 +1751,19 @@ get_intrinsic_uub(struct analysis_state *state, struct uub_query q, uint32_t *re
|
|||
case nir_intrinsic_inclusive_scan:
|
||||
case nir_intrinsic_exclusive_scan: {
|
||||
nir_op op = nir_intrinsic_reduction_op(intrin);
|
||||
unsigned bit_size = q.scalar.def->bit_size;
|
||||
bool exclusive = intrin->intrinsic == nir_intrinsic_exclusive_scan;
|
||||
|
||||
if (op == nir_op_umin || op == nir_op_umax || op == nir_op_imin || op == nir_op_imax) {
|
||||
if (!q.head.pushed_queries) {
|
||||
push_uub_query(state, nir_get_scalar(intrin->src[0].ssa, q.scalar.comp));
|
||||
return;
|
||||
} else {
|
||||
*result = src[0];
|
||||
if (exclusive) {
|
||||
uint32_t identity = nir_const_value_as_uint(nir_alu_binop_identity(op, bit_size), bit_size);
|
||||
*result = MAX2(*result, identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue