[Mesa-dev] [PATCH v2 16/35] isl: Fix get_image_offset_sa_gen4_2d for multisample surfaces
Pohjolainen, Topi
topi.pohjolainen at intel.com
Wed Jul 27 09:36:05 UTC 2016
On Tue, Jul 26, 2016 at 03:02:07PM -0700, Jason Ekstrand wrote:
> The function takes a logical array layer but was assuming it was a physical
> array layer. While we'er here, we also make it not assert-fail on gen9 3-D
> surfaces.
Looks good to me:
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/intel/isl/isl.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> index 92658ec..a713eeb 100644
> --- a/src/intel/isl/isl.c
> +++ b/src/intel/isl/isl.c
> @@ -1345,13 +1345,15 @@ isl_buffer_fill_state_s(const struct isl_device *dev, void *state,
> */
> static void
> get_image_offset_sa_gen4_2d(const struct isl_surf *surf,
> - uint32_t level, uint32_t layer,
> + uint32_t level, uint32_t logical_array_layer,
> uint32_t *x_offset_sa,
> uint32_t *y_offset_sa)
> {
> assert(level < surf->levels);
> - assert(layer < surf->phys_level0_sa.array_len);
> - assert(surf->phys_level0_sa.depth == 1);
> + if (surf->dim == ISL_SURF_DIM_3D)
> + assert(logical_array_layer < surf->logical_level0_px.depth);
> + else
> + assert(logical_array_layer < surf->logical_level0_px.array_len);
>
> const struct isl_extent3d image_align_sa =
> isl_surf_get_image_alignment_sa(surf);
> @@ -1359,8 +1361,11 @@ get_image_offset_sa_gen4_2d(const struct isl_surf *surf,
> const uint32_t W0 = surf->phys_level0_sa.width;
> const uint32_t H0 = surf->phys_level0_sa.height;
>
> + const uint32_t phys_layer = logical_array_layer *
> + (surf->msaa_layout == ISL_MSAA_LAYOUT_ARRAY ? surf->samples : 1);
> +
> uint32_t x = 0;
> - uint32_t y = layer * isl_surf_get_array_pitch_sa_rows(surf);
> + uint32_t y = phys_layer * isl_surf_get_array_pitch_sa_rows(surf);
>
> for (uint32_t l = 0; l < level; ++l) {
> if (l == 1) {
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list