mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 23:08:18 +02:00
kraid: Add a very dumb message slot assignment pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41841>
This commit is contained in:
parent
60c3690165
commit
d771ba7908
3 changed files with 31 additions and 0 deletions
|
|
@ -81,6 +81,10 @@ pub extern "C" fn kraid_compile_nir(
|
|||
dump_shader(&s, "after register assignment");
|
||||
s.validate();
|
||||
|
||||
s.assign_message_slots();
|
||||
dump_shader(&s, "after message slot assignment");
|
||||
s.validate();
|
||||
|
||||
let bin = model.encode_shader(&s);
|
||||
dynarray_append_vec(binary, bin);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ mod encode_v9;
|
|||
mod flow;
|
||||
mod ir;
|
||||
mod isa;
|
||||
mod message_slots;
|
||||
mod model;
|
||||
mod nir;
|
||||
mod ops;
|
||||
|
|
|
|||
26
src/panfrost/compiler/kraid/message_slots.rs
Normal file
26
src/panfrost/compiler/kraid/message_slots.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright © 2026 Collabora, Ltd.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::flow::FlowWaitBit;
|
||||
use crate::ir::*;
|
||||
|
||||
fn op_is_message(op: &Op) -> bool {
|
||||
// TODO: Make this real
|
||||
matches!(
|
||||
op,
|
||||
Op::LdPka(_) | Op::LeaPka(_) | Op::Load(_) | Op::Store(_)
|
||||
)
|
||||
}
|
||||
|
||||
impl Shader<'_> {
|
||||
pub fn assign_message_slots(&mut self) {
|
||||
for b in self.blocks.iter_mut() {
|
||||
for i in b.instrs.iter_mut() {
|
||||
if op_is_message(&i.op) {
|
||||
i.flow.set_msg_slot_idx(0);
|
||||
i.flow.set_wait_bit(FlowWaitBit::Slot0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue