mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
nouveau/headers: Fix nv_push rust push_inline_data implementation
Signed-off-by: Mary Guillemard <mary@mary.zone>
Fixes: 66954d997d ("nouveau/headers: Add an nv_push crate in Rust")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36093>
This commit is contained in:
parent
63cdad6bb7
commit
c64d8a0548
1 changed files with 4 additions and 1 deletions
|
|
@ -207,7 +207,10 @@ impl Push {
|
|||
|
||||
/// Push an array of dwords into the push buffer
|
||||
pub fn push_inline_data(&mut self, data: &[u32]) {
|
||||
if self.last_inc != usize::MAX {
|
||||
if let Some(last) = self.mem.get_mut(self.last_inc) {
|
||||
let last = MthdHeader::from_bits_mut(last);
|
||||
last.add_len(data.len().try_into().unwrap());
|
||||
} else {
|
||||
panic!("Inline data must only be placed after a method header");
|
||||
}
|
||||
self.mem.extend_from_slice(data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue