nak: Use the RED path for atomics with unused destinations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30354>
This commit is contained in:
committed by
Marge Bot
parent
c347c7cbd8
commit
71639eb837
@@ -2160,8 +2160,15 @@ impl<'a> ShaderFromNir<'a> {
|
||||
self.get_src(&srcs[3])
|
||||
};
|
||||
|
||||
let is_reduction =
|
||||
atom_op.is_reduction() && intrin.def.components_read() == 0;
|
||||
|
||||
b.push_op(OpSuAtom {
|
||||
dst: dst.into(),
|
||||
dst: if self.sm.sm() >= 70 && is_reduction {
|
||||
Dst::None
|
||||
} else {
|
||||
dst.into()
|
||||
},
|
||||
fault: Dst::None,
|
||||
handle: handle,
|
||||
coord: coord,
|
||||
@@ -2329,8 +2336,11 @@ impl<'a> ShaderFromNir<'a> {
|
||||
assert!(intrin.def.num_components() == 1);
|
||||
let dst = b.alloc_ssa(RegFile::GPR, bit_size.div_ceil(32));
|
||||
|
||||
let is_reduction =
|
||||
atom_op.is_reduction() && intrin.def.components_read() == 0;
|
||||
|
||||
b.push_op(OpAtom {
|
||||
dst: dst.into(),
|
||||
dst: if is_reduction { Dst::None } else { dst.into() },
|
||||
addr: addr,
|
||||
cmpr: 0.into(),
|
||||
data: data,
|
||||
|
||||
@@ -2410,6 +2410,22 @@ pub enum AtomOp {
|
||||
CmpExch(AtomCmpSrc),
|
||||
}
|
||||
|
||||
impl AtomOp {
|
||||
pub fn is_reduction(&self) -> bool {
|
||||
match self {
|
||||
AtomOp::Add
|
||||
| AtomOp::Min
|
||||
| AtomOp::Max
|
||||
| AtomOp::Inc
|
||||
| AtomOp::Dec
|
||||
| AtomOp::And
|
||||
| AtomOp::Or
|
||||
| AtomOp::Xor => true,
|
||||
AtomOp::Exch | AtomOp::CmpExch(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for AtomOp {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user