mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 22:30:11 +01:00
nil: Add D3D sample layouts
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31585>
This commit is contained in:
parent
279cebf726
commit
097f8b2c7d
2 changed files with 24 additions and 6 deletions
|
|
@ -29,13 +29,15 @@ pub enum ImageDim {
|
|||
#[derive(Clone, Debug, Copy, PartialEq, Default)]
|
||||
#[repr(u8)]
|
||||
pub enum SampleLayout {
|
||||
_1x1 = 0,
|
||||
_2x1 = 1,
|
||||
_2x2 = 2,
|
||||
_4x2 = 3,
|
||||
_4x4 = 4,
|
||||
_1x1,
|
||||
_2x1,
|
||||
_2x1D3d,
|
||||
_2x2,
|
||||
_4x2,
|
||||
_4x2D3d,
|
||||
_4x4,
|
||||
#[default]
|
||||
Invalid = 5,
|
||||
Invalid,
|
||||
}
|
||||
|
||||
impl SampleLayout {
|
||||
|
|
@ -59,8 +61,10 @@ impl SampleLayout {
|
|||
match self {
|
||||
SampleLayout::_1x1 => 1,
|
||||
SampleLayout::_2x1 => 2,
|
||||
SampleLayout::_2x1D3d => 2,
|
||||
SampleLayout::_2x2 => 4,
|
||||
SampleLayout::_4x2 => 8,
|
||||
SampleLayout::_4x2D3d => 8,
|
||||
SampleLayout::_4x4 => 16,
|
||||
SampleLayout::Invalid => panic!("Invalid sample layout"),
|
||||
}
|
||||
|
|
@ -75,8 +79,10 @@ impl SampleLayout {
|
|||
match self {
|
||||
SampleLayout::_1x1 => Extent4D::new(1, 1, 1, 1),
|
||||
SampleLayout::_2x1 => Extent4D::new(2, 1, 1, 1),
|
||||
SampleLayout::_2x1D3d => Extent4D::new(2, 1, 1, 1),
|
||||
SampleLayout::_2x2 => Extent4D::new(2, 2, 1, 1),
|
||||
SampleLayout::_4x2 => Extent4D::new(4, 2, 1, 1),
|
||||
SampleLayout::_4x2D3d => Extent4D::new(4, 2, 1, 1),
|
||||
SampleLayout::_4x4 => Extent4D::new(4, 4, 1, 1),
|
||||
SampleLayout::Invalid => panic!("Invalid sample layout"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,8 +165,14 @@ fn nil_rs_to_nv9097_multi_sample_count(sample_layout: SampleLayout) -> u32 {
|
|||
match sample_layout {
|
||||
SampleLayout::_1x1 => cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_1X1,
|
||||
SampleLayout::_2x1 => cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_2X1,
|
||||
SampleLayout::_2x1D3d => {
|
||||
cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_2X1_D3D
|
||||
}
|
||||
SampleLayout::_2x2 => cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_2X2,
|
||||
SampleLayout::_4x2 => cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_4X2,
|
||||
SampleLayout::_4x2D3d => {
|
||||
cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_4X2_D3D
|
||||
}
|
||||
SampleLayout::_4x4 => cl9097::TEXHEADV2_MULTI_SAMPLE_COUNT_MODE_4X4,
|
||||
SampleLayout::Invalid => panic!("Invalid sample layout"),
|
||||
}
|
||||
|
|
@ -176,8 +182,14 @@ fn nil_rs_to_nvb097_multi_sample_count(sample_layout: SampleLayout) -> u32 {
|
|||
match sample_layout {
|
||||
SampleLayout::_1x1 => clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_1X1,
|
||||
SampleLayout::_2x1 => clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_2X1,
|
||||
SampleLayout::_2x1D3d => {
|
||||
clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_2X1_D3D
|
||||
}
|
||||
SampleLayout::_2x2 => clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_2X2,
|
||||
SampleLayout::_4x2 => clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_4X2,
|
||||
SampleLayout::_4x2D3d => {
|
||||
clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_4X2_D3D
|
||||
}
|
||||
SampleLayout::_4x4 => clb097::TEXHEAD_BL_MULTI_SAMPLE_COUNT_MODE_4X4,
|
||||
SampleLayout::Invalid => panic!("Invalid sample layout"),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue