mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 02:00:12 +01: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>
(cherry picked from commit a2e48d2ede)
This commit is contained in:
parent
0fb416d506
commit
d16922979f
2 changed files with 8 additions and 1 deletions
|
|
@ -3464,7 +3464,7 @@
|
|||
"description": "nir/uub: fix exclusive scans",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1684,12 +1684,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