mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
nak/legalize: Uniform instructions can't have cbuf sources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29591>
This commit is contained in:
parent
7efc113bfe
commit
66a5608c11
1 changed files with 19 additions and 0 deletions
|
|
@ -177,6 +177,17 @@ fn copy_alu_src(
|
|||
src.src_ref = val.into();
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_cbuf(
|
||||
b: &mut impl SSABuilder,
|
||||
src: &mut Src,
|
||||
reg_file: RegFile,
|
||||
src_type: SrcType,
|
||||
) {
|
||||
if matches!(src.src_ref, SrcRef::CBuf(_)) {
|
||||
copy_alu_src(b, src, reg_file, src_type);
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_alu_src_if_not_reg(
|
||||
b: &mut impl SSABuilder,
|
||||
src: &mut Src,
|
||||
|
|
@ -589,6 +600,14 @@ fn legalize_sm70_instr(
|
|||
RegFile::GPR
|
||||
};
|
||||
|
||||
if !matches!(&instr.op, Op::Ldc(_) | Op::Copy(_)) && instr.is_uniform() {
|
||||
// Uniform instructions can't support cbufs
|
||||
let src_types = instr.src_types();
|
||||
for (i, src) in instr.srcs_mut().iter_mut().enumerate() {
|
||||
copy_alu_src_if_cbuf(b, src, gpr, src_types[i]);
|
||||
}
|
||||
}
|
||||
|
||||
match &mut instr.op {
|
||||
Op::FAdd(op) => {
|
||||
let [ref mut src0, ref mut src1] = op.srcs;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue