nak: Revert "nak: Handle non-DW-aligned UBO loads"

This reverts commit 70c9fc66ffab8cb85b37c74b507201097e16da85.  We're now
handling non-DW-aligned UBO loads in NIR where we can handle it a bit
more completely, we don't need to carry the nak_from_nir code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26412>
This commit is contained in:
Faith Ekstrand 2023-11-27 21:16:48 -06:00 committed by Marge Bot
parent 67e6ca1924
commit 01d15d8a38
2 changed files with 5 additions and 21 deletions

View file

@ -2010,24 +2010,9 @@ impl<'a> ShaderFromNir<'a> {
offset: off_imm.try_into().unwrap(),
};
if off.is_zero() {
if off_imm % 4 == 0 {
for (i, comp) in dst.iter().enumerate() {
let i = i16::try_from(i).unwrap();
b.copy_to(
(*comp).into(),
cb.offset(i * 4).into(),
);
}
} else {
let delta: u8 = (off_imm % 4).try_into().unwrap();
let aligned_cb = cb.offset(-i16::from(delta));
let tmp = b.copy(aligned_cb.into());
let prmt = match size_B {
1 => [delta, 4, 4, 4],
2 => [delta, delta + 1, 4, 4],
_ => panic!("Invalid load_ubo"),
};
b.prmt_to(dst.into(), tmp.into(), 0.into(), prmt);
for (i, comp) in dst.iter().enumerate() {
let i = u16::try_from(i).unwrap();
b.copy_to((*comp).into(), cb.offset(i * 4).into());
}
} else {
b.push_op(OpLdc {

View file

@ -742,11 +742,10 @@ pub struct CBufRef {
}
impl CBufRef {
pub fn offset(self, offset: i16) -> CBufRef {
pub fn offset(self, offset: u16) -> CBufRef {
CBufRef {
buf: self.buf,
offset: (i32::from(self.offset) +
i32::from(offset)).try_into().unwrap(),
offset: self.offset + offset,
}
}
}