mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-15 12:50:44 +01:00
intel/isl: Fix QPitch of arrayed MCS
From RENDER_SURFACE_STATE::AuxiliarySurfaceQPitch on BDW+, This field must be set to an integer multiple of the Surface Vertical Alignment Accomplish this by aligning the height of each MCS layer to main surface's vertical alignment. Prevents the following test group from failing on Xe2 when a future commit enables multi-layer fast-clears in anv: dEQP-VK.api.image_clearing.*. clear_color_attachment.multiple_layers. *_clamp_input_sample_count_* The main test I used to debug this: dEQP-VK.api.image_clearing.core. clear_color_attachment.multiple_layers. a8b8g8r8_unorm_pack32_64x11_clamp_input_sample_count_2 Backport-to: 25.3 Reviewed-by: Jianxun Zhang <jianxun.zhang@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37660>
This commit is contained in:
parent
b95839b9c9
commit
eb4a581e44
2 changed files with 17 additions and 3 deletions
|
|
@ -3906,11 +3906,18 @@ isl_surf_get_mcs_surf(const struct isl_device *dev,
|
|||
UNREACHABLE("Invalid sample count");
|
||||
}
|
||||
|
||||
/* isl_genX(surf_fill_state_s) will assert on us if the QPitch is not
|
||||
* aligned by the main surface's vertical alignment. Align the height of
|
||||
* the image so that the QPitch follows.
|
||||
*/
|
||||
const uint32_t aligned_height = isl_align(surf->logical_level0_px.height,
|
||||
surf->image_alignment_el.height);
|
||||
|
||||
return isl_surf_init(dev, mcs_surf,
|
||||
.dim = ISL_SURF_DIM_2D,
|
||||
.format = mcs_format,
|
||||
.width = surf->logical_level0_px.width,
|
||||
.height = surf->logical_level0_px.height,
|
||||
.height = aligned_height,
|
||||
.depth = 1,
|
||||
.levels = 1,
|
||||
.array_len = surf->logical_level0_px.array_len,
|
||||
|
|
|
|||
|
|
@ -911,8 +911,15 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
|
|||
* doesn't expect our definition of the compression, it expects qpitch
|
||||
* in units of samples on the main surface.
|
||||
*/
|
||||
s.AuxiliarySurfaceQPitch =
|
||||
isl_surf_get_array_pitch_sa_rows(info->aux_surf) >> 2;
|
||||
uint32_t aux_qpitch = isl_surf_get_array_pitch_sa_rows(info->aux_surf);
|
||||
|
||||
/* From RENDER_SURFACE_STATE::AuxiliarySurfaceQPitch on BDW+,
|
||||
*
|
||||
* This field must be set to an integer multiple of the Surface
|
||||
* Vertical Alignment
|
||||
*/
|
||||
assert(aux_qpitch % image_align.h == 0);
|
||||
s.AuxiliarySurfaceQPitch = aux_qpitch >> 2;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue