mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 16:00:08 +01:00
nak: Use undef for unset FSOut components
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27742>
This commit is contained in:
parent
fdfccfa8fa
commit
1fb74672a9
2 changed files with 8 additions and 2 deletions
|
|
@ -652,6 +652,12 @@ pub trait SSABuilder: Builder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn undef(&mut self) -> SSARef {
|
||||||
|
let dst = self.alloc_ssa(RegFile::GPR, 1);
|
||||||
|
self.push_op(OpUndef { dst: dst.into() });
|
||||||
|
dst
|
||||||
|
}
|
||||||
|
|
||||||
fn copy(&mut self, src: Src) -> SSARef {
|
fn copy(&mut self, src: Src) -> SSARef {
|
||||||
let dst = if src.is_predicate() {
|
let dst = if src.is_predicate() {
|
||||||
self.alloc_ssa(RegFile::Pred, 1)
|
self.alloc_ssa(RegFile::Pred, 1)
|
||||||
|
|
|
||||||
|
|
@ -2249,7 +2249,7 @@ impl<'a> ShaderFromNir<'a> {
|
||||||
for c in 0..4 {
|
for c in 0..4 {
|
||||||
let reg = self.fs_out_regs[i * 4 + c];
|
let reg = self.fs_out_regs[i * 4 + c];
|
||||||
if reg.is_none() {
|
if reg.is_none() {
|
||||||
srcs.push(0.into());
|
srcs.push(b.undef().into());
|
||||||
} else {
|
} else {
|
||||||
srcs.push(reg.into());
|
srcs.push(reg.into());
|
||||||
}
|
}
|
||||||
|
|
@ -2262,7 +2262,7 @@ impl<'a> ShaderFromNir<'a> {
|
||||||
if info.writes_sample_mask {
|
if info.writes_sample_mask {
|
||||||
srcs.push(self.fs_out_regs[mask_idx].into());
|
srcs.push(self.fs_out_regs[mask_idx].into());
|
||||||
} else {
|
} else {
|
||||||
srcs.push(0.into());
|
srcs.push(b.undef().into());
|
||||||
}
|
}
|
||||||
if info.writes_depth {
|
if info.writes_depth {
|
||||||
// Saturate depth writes.
|
// Saturate depth writes.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue