panfrost: Add panfrost_sample_pattern helper

We always use rotated grids to preserve current behaviour.

Cc stable as it is required for the next commit. If deemed too invasive,
a simpler fix could be backported.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: 21.0 <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8774>
(cherry picked from commit b08100fb96)
This commit is contained in:
Alyssa Rosenzweig 2021-01-29 14:31:18 -05:00 committed by Dylan Baker
parent 8e8ba3402a
commit 714e9a02d1
2 changed files with 13 additions and 1 deletions

View file

@ -2974,7 +2974,7 @@
"description": "panfrost: Add panfrost_sample_pattern helper",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -104,4 +104,16 @@ panfrost_translate_compare_func(enum pipe_compare_func in)
}
}
static inline enum mali_sample_pattern
panfrost_sample_pattern(unsigned samples)
{
switch (samples) {
case 1: return MALI_SAMPLE_PATTERN_SINGLE_SAMPLED;
case 4: return MALI_SAMPLE_PATTERN_ROTATED_4X_GRID;
case 8: return MALI_SAMPLE_PATTERN_D3D_8X_GRID;
case 16: return MALI_SAMPLE_PATTERN_D3D_16X_GRID;
default: unreachable("Unsupported sample count");
}
}
#endif /* __PAN_CMDSTREAM_H__ */