nak: fix handling of delays > 15

Fixes: 2b569ecdb6 ("nak: Handle delays > 15")
Acked-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34722>
(cherry picked from commit 9a97a5d57750906a881144b13ab6e089c203d163)
This commit is contained in:
Karol Herbst
2025-04-27 19:29:52 +02:00
committed by Eric Engestrom
parent 6101b0ae4b
commit 84f1dcdc2a
2 changed files with 3 additions and 2 deletions

View File

@@ -144,7 +144,7 @@
"description": "nak: fix handling of delays > 15",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2b569ecdb6531228a1c2eac38da310b8cd0f3cfc",
"notes": null

View File

@@ -452,11 +452,12 @@ fn calc_delays(f: &mut Function, sm: &dyn ShaderModel) -> u32 {
if instr.deps.delay > MAX_INSTR_DELAY {
let mut delay = instr.deps.delay - MAX_INSTR_DELAY;
instr.deps.set_delay(MAX_INSTR_DELAY);
let instrs = vec![instr];
let mut instrs = vec![instr];
while delay > 0 {
let mut nop = Instr::new_boxed(OpNop { label: None });
nop.deps.set_delay(delay.min(MAX_INSTR_DELAY));
delay -= nop.deps.delay;
instrs.push(nop);
}
MappedInstrs::Many(instrs)
} else if matches!(instr.op, Op::SrcBar(_)) {