[Mesa-dev] [PATCH 1/2] isl: Get rid of isl_surf_fill_state_info::level0_extent_px

Jason Ekstrand jason at jlekstrand.net
Fri Mar 4 19:30:35 UTC 2016


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Fri, Mar 4, 2016 at 10:03 AM, Nanley Chery <nanleychery at gmail.com> wrote:

> From: Nanley Chery <nanley.g.chery at intel.com>
>
> This field is no longer needed.
>
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
>  src/intel/isl/isl.h               |  9 ---------
>  src/intel/isl/isl_surface_state.c |  8 ++++----
>  src/intel/vulkan/anv_image.c      | 33 +++------------------------------
>  3 files changed, 7 insertions(+), 43 deletions(-)
>
> diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
> index 5a48bce..248a94d 100644
> --- a/src/intel/isl/isl.h
> +++ b/src/intel/isl/isl.h
> @@ -773,15 +773,6 @@ struct isl_surf_fill_state_info {
>     uint32_t mocs;
>
>     /**
> -    * This allows the caller to over-ride the dimensions of the surface.
> -    * This is used at the moment for compressed surfaces to let us hack
> -    * around the fact that we can't actually render to them.
> -    *
> -    * FIXME: We really need to get rid of this.  It's a lie.
> -    */
> -   struct isl_extent4d level0_extent_px;
> -
> -   /**
>      * The clear color for this surface
>      *
>      * Valid values depend on hardware generation.
> diff --git a/src/intel/isl/isl_surface_state.c
> b/src/intel/isl/isl_surface_state.c
> index 1607aa6..fe8f07c 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -257,8 +257,8 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
>        .SurfaceQPitch = get_qpitch(info->surf) >> 2,
>  #endif
>
> -      .Width = info->level0_extent_px.width - 1,
> -      .Height = info->level0_extent_px.height - 1,
> +      .Width = info->surf->logical_level0_px.width - 1,
> +      .Height = info->surf->logical_level0_px.height - 1,
>        .Depth = 0, /* TEMPLATE */
>
>        .SurfacePitch = info->surf->row_pitch - 1,
> @@ -338,7 +338,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
>         *    If the volume texture is MIP-mapped, this field specifies the
>         *    depth of the base MIP level.
>         */
> -      s.Depth = info->level0_extent_px.depth - 1;
> +      s.Depth = info->surf->logical_level0_px.depth - 1;
>
>        /* From the Broadwell PRM >>
> RENDER_SURFACE_STATE::RenderTargetViewExtent:
>         *
> @@ -346,7 +346,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device
> *dev, void *state,
>         *    indicates the extent of the accessible 'R' coordinates minus
> 1 on
>         *    the LOD currently being rendered to.
>         */
> -      s.RenderTargetViewExtent = info->level0_extent_px.depth - 1;
> +      s.RenderTargetViewExtent = info->surf->logical_level0_px.depth - 1;
>        break;
>     default:
>        unreachable(!"bad SurfaceType");
> diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
> index dc1ea9c..c76a5f6 100644
> --- a/src/intel/vulkan/anv_image.c
> +++ b/src/intel/vulkan/anv_image.c
> @@ -540,30 +540,6 @@ anv_image_view_init(struct anv_image_view *iview,
>        },
>     };
>
> -   struct isl_extent4d level0_extent_px;
> -
> -   if (!isl_format_is_compressed(format) &&
> -       isl_format_is_compressed(image->format->isl_format)) {
> -      /* Scale the ImageView extent by the backing Image. This is used
> -       * internally when an uncompressed ImageView is created on a
> -       * compressed Image. The ImageView can therefore be used for copying
> -       * data from a source Image to a destination Image.
> -       */
> -      const struct isl_format_layout * isl_layout =
> image->format->isl_layout;
> -
> -      level0_extent_px.depth  = anv_minify(image->extent.depth,
> range->baseMipLevel);
> -      level0_extent_px.depth  = DIV_ROUND_UP(level0_extent_px.depth,
> isl_layout->bd);
> -
> -      level0_extent_px.height =
> isl_surf_get_array_pitch_el_rows(&surface->isl) * image->array_size;
> -      level0_extent_px.width  = isl_surf_get_row_pitch_el(&surface->isl);
> -      isl_view.base_level = 0;
> -      isl_view.base_array_layer = 0;
> -   } else {
> -      level0_extent_px.width  = image->extent.width;
> -      level0_extent_px.height = image->extent.height;
> -      level0_extent_px.depth  = image->extent.depth;
> -   }
> -
>     iview->extent = (VkExtent3D) {
>        .width  = anv_minify(image->extent.width , range->baseMipLevel),
>        .height = anv_minify(image->extent.height, range->baseMipLevel),
> @@ -586,8 +562,7 @@ anv_image_view_init(struct anv_image_view *iview,
>                            iview->sampler_surface_state.map,
>                            .surf = &surface->isl,
>                            .view = &isl_view,
> -                          .mocs = device->default_mocs,
> -                          .level0_extent_px = level0_extent_px);
> +                          .mocs = device->default_mocs);
>
>        if (!device->info.has_llc)
>           anv_state_clflush(iview->sampler_surface_state);
> @@ -603,8 +578,7 @@ anv_image_view_init(struct anv_image_view *iview,
>                            iview->color_rt_surface_state.map,
>                            .surf = &surface->isl,
>                            .view = &isl_view,
> -                          .mocs = device->default_mocs,
> -                          .level0_extent_px = level0_extent_px);
> +                          .mocs = device->default_mocs);
>
>        if (!device->info.has_llc)
>           anv_state_clflush(iview->color_rt_surface_state);
> @@ -621,8 +595,7 @@ anv_image_view_init(struct anv_image_view *iview,
>                               iview->storage_surface_state.map,
>                               .surf = &surface->isl,
>                               .view = &isl_view,
> -                             .mocs = device->default_mocs,
> -                             .level0_extent_px = level0_extent_px);
> +                             .mocs = device->default_mocs);
>        } else {
>           anv_fill_buffer_surface_state(device,
> iview->storage_surface_state,
>                                         ISL_FORMAT_RAW,
> --
> 2.7.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160304/0b65a5bb/attachment-0001.html>


More information about the mesa-dev mailing list