mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 01:00:10 +01: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> (cherry picked from commitc64d8a0548)
This commit is contained in:
parent
76724bd376
commit
ca5259ec32
2 changed files with 5 additions and 2 deletions
|
|
@ -1784,7 +1784,7 @@
|
|||
"description": "nouveau/headers: Fix nv_push rust push_inline_data implementation",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "66954d997d801743156f5eeda7a23ba1d9b6c098",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -206,7 +206,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