mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 11:20:20 +01:00
intel/isl: Allow multisampling with ISL_FORMAT_HiZ
HiZ buffers can be multisampled and, on Broadwell and earlier, simply using interleaved multisampling with a compression block size of 8x4 samples yields the correct HiZ surface size calculations. Unfortunately, choose_msaa_layout was rejecting multisampled HiZ buffers because of format checks. Now that we have a simple helper for determining if a format supports multisampling, that's an easy enough issue to fix. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
This commit is contained in:
parent
baade41a5c
commit
b1311a48e0
2 changed files with 12 additions and 3 deletions
|
|
@ -594,7 +594,6 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
|
|||
assert(info->depth == 1);
|
||||
assert(info->levels == 1);
|
||||
assert(isl_format_supports_multisampling(dev->info, info->format));
|
||||
assert(fmtl->bw == 1 && fmtl->bh == 1);
|
||||
|
||||
*phys_level0_sa = (struct isl_extent4d) {
|
||||
.w = info->width,
|
||||
|
|
@ -606,6 +605,9 @@ isl_calc_phys_level0_extent_sa(const struct isl_device *dev,
|
|||
isl_msaa_interleaved_scale_px_to_sa(info->samples,
|
||||
&phys_level0_sa->w,
|
||||
&phys_level0_sa->h);
|
||||
|
||||
phys_level0_sa->w = isl_align(phys_level0_sa->w, fmtl->bw);
|
||||
phys_level0_sa->h = isl_align(phys_level0_sa->h, fmtl->bh);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -444,9 +444,16 @@ isl_format_supports_multisampling(const struct gen_device_info *devinfo,
|
|||
* - any compressed texture format (BC*)
|
||||
* - any YCRCB* format
|
||||
*
|
||||
* The restriction on the format's size is removed on Broadwell.
|
||||
* The restriction on the format's size is removed on Broadwell. Also,
|
||||
* there is an exception for HiZ which we treat as a compressed format and
|
||||
* is allowed to be multisampled on Broadwell and earlier.
|
||||
*/
|
||||
if (devinfo->gen < 8 && isl_format_get_layout(format)->bpb > 64) {
|
||||
if (format == ISL_FORMAT_HIZ) {
|
||||
/* On SKL+, HiZ is always single-sampled even when the primary surface
|
||||
* is multisampled. See also isl_surf_get_hiz_surf().
|
||||
*/
|
||||
return devinfo->gen <= 8;
|
||||
} else if (devinfo->gen < 8 && isl_format_get_layout(format)->bpb > 64) {
|
||||
return false;
|
||||
} else if (isl_format_is_compressed(format)) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue