mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 22:40:09 +01:00
nil: Add a helper to get samples from a SampleLayout
Fixes: 6a84d5439d ("nvk: Move the ANTI_ALIAS_CONTROL logic to the MME")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
This commit is contained in:
parent
cf31388a9a
commit
f8c0377421
1 changed files with 16 additions and 0 deletions
|
|
@ -55,6 +55,22 @@ impl SampleLayout {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn samples(&self) -> u32 {
|
||||
match self {
|
||||
SampleLayout::_1x1 => 1,
|
||||
SampleLayout::_2x1 => 2,
|
||||
SampleLayout::_2x2 => 4,
|
||||
SampleLayout::_4x2 => 8,
|
||||
SampleLayout::_4x4 => 16,
|
||||
SampleLayout::Invalid => panic!("Invalid sample layout"),
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn nil_sample_layout_samples(self) -> u32 {
|
||||
self.samples()
|
||||
}
|
||||
|
||||
pub fn px_extent_sa(&self) -> Extent4D<units::Samples> {
|
||||
match self {
|
||||
SampleLayout::_1x1 => Extent4D::new(1, 1, 1, 1),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue