mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 06:40:22 +01:00
nil: Match on gob types in the tiled image copy code
This depends on GOB types but we really only support Turing for now. Add the match statement anyway so we panic if we see an unsupported GOB type instead of pretending it's TuringColor2D and copying anyway. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35660>
This commit is contained in:
parent
d8c43ff46a
commit
76e72d63f0
1 changed files with 27 additions and 17 deletions
|
|
@ -2,7 +2,7 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use crate::extent::{units, Extent4D, Offset4D};
|
||||
use crate::tiling::Tiling;
|
||||
use crate::tiling::{GOBType, Tiling};
|
||||
|
||||
use std::ffi::c_void;
|
||||
use std::ops::Range;
|
||||
|
|
@ -551,14 +551,19 @@ pub unsafe extern "C" fn nil_copy_linear_to_tiled(
|
|||
linear_plane_stride_B,
|
||||
);
|
||||
|
||||
copy_tiled::<CopyGOBTuring2D<RawCopyToTiled>>(
|
||||
*tiling,
|
||||
level_extent_B,
|
||||
tiled_dst,
|
||||
linear_pointer,
|
||||
offset_B,
|
||||
end_B,
|
||||
);
|
||||
match tiling.gob_type {
|
||||
GOBType::TuringColor2D => {
|
||||
copy_tiled::<CopyGOBTuring2D<RawCopyToTiled>>(
|
||||
*tiling,
|
||||
level_extent_B,
|
||||
tiled_dst,
|
||||
linear_pointer,
|
||||
offset_B,
|
||||
end_B,
|
||||
);
|
||||
}
|
||||
_ => panic!("Unsupported GOB type"),
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
|
@ -583,12 +588,17 @@ pub unsafe extern "C" fn nil_copy_tiled_to_linear(
|
|||
linear_plane_stride_B,
|
||||
);
|
||||
|
||||
copy_tiled::<CopyGOBTuring2D<RawCopyToLinear>>(
|
||||
*tiling,
|
||||
level_extent_B,
|
||||
tiled_src,
|
||||
linear_pointer,
|
||||
offset_B,
|
||||
end_B,
|
||||
);
|
||||
match tiling.gob_type {
|
||||
GOBType::TuringColor2D => {
|
||||
copy_tiled::<CopyGOBTuring2D<RawCopyToLinear>>(
|
||||
*tiling,
|
||||
level_extent_B,
|
||||
tiled_src,
|
||||
linear_pointer,
|
||||
offset_B,
|
||||
end_B,
|
||||
);
|
||||
}
|
||||
_ => panic!("Unsupported GOB type"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue