nak: Plumb through LDC modes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28474>
This commit is contained in:
committed by
Marge Bot
parent
189b4193ee
commit
f4ac517cc8
@@ -1492,7 +1492,15 @@ impl SM70Instr {
|
||||
);
|
||||
|
||||
self.set_mem_type(73..76, op.mem_type);
|
||||
self.set_field(78..80, 0_u8); // subop
|
||||
self.set_field(
|
||||
78..80,
|
||||
match op.mode {
|
||||
LdcMode::Indexed => 0_u8,
|
||||
LdcMode::IndexedLinear => 1_u8,
|
||||
LdcMode::IndexedSegmented => 2_u8,
|
||||
LdcMode::IndexedSegmentedLinear => 3_u8,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
fn encode_stg(&mut self, op: &OpSt) {
|
||||
|
||||
@@ -2502,10 +2502,12 @@ impl<'a> ShaderFromNir<'a> {
|
||||
dst: dst.into(),
|
||||
cb: cb.into(),
|
||||
offset: off,
|
||||
mode: LdcMode::Indexed,
|
||||
mem_type: MemType::from_size(size_B, false),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
panic!("Indirect UBO indices not yet supported");
|
||||
}
|
||||
self.set_dst(&intrin.def, dst);
|
||||
|
||||
@@ -3811,6 +3811,25 @@ impl DisplayOp for OpLd {
|
||||
}
|
||||
impl_display_for_op!(OpLd);
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub enum LdcMode {
|
||||
Indexed,
|
||||
IndexedLinear,
|
||||
IndexedSegmented,
|
||||
IndexedSegmentedLinear,
|
||||
}
|
||||
|
||||
impl fmt::Display for LdcMode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
LdcMode::Indexed => Ok(()),
|
||||
LdcMode::IndexedLinear => write!(f, ".il"),
|
||||
LdcMode::IndexedSegmented => write!(f, ".is"),
|
||||
LdcMode::IndexedSegmentedLinear => write!(f, ".isl"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(SrcsAsSlice, DstsAsSlice)]
|
||||
pub struct OpLdc {
|
||||
@@ -3822,6 +3841,7 @@ pub struct OpLdc {
|
||||
#[src_type(GPR)]
|
||||
pub offset: Src,
|
||||
|
||||
pub mode: LdcMode,
|
||||
pub mem_type: MemType,
|
||||
}
|
||||
|
||||
@@ -3830,7 +3850,7 @@ impl DisplayOp for OpLdc {
|
||||
let SrcRef::CBuf(cb) = self.cb.src_ref else {
|
||||
panic!("Not a cbuf");
|
||||
};
|
||||
write!(f, "ldc{} {}[", self.mem_type, cb.buf)?;
|
||||
write!(f, "ldc{}{} {}[", self.mode, self.mem_type, cb.buf)?;
|
||||
if self.offset.is_zero() {
|
||||
write!(f, "+{:#x}", cb.offset)?;
|
||||
} else if cb.offset == 0 {
|
||||
|
||||
Reference in New Issue
Block a user