[Mesa-dev] [PATCH v2 28/35] i965/blorp: Add a z_offset field to blorp_surface_info

Pohjolainen, Topi topi.pohjolainen at intel.com
Wed Aug 17 06:22:24 UTC 2016


On Tue, Jul 26, 2016 at 03:02:19PM -0700, Jason Ekstrand wrote:
> The layer field is in terms of physical layers which isn't quite what the
> sampler will want for 2-D MS array textures.
> ---
>  src/mesa/drivers/dri/i965/brw_blorp.c        |  9 +++++++++
>  src/mesa/drivers/dri/i965/brw_blorp.h        |  3 +++
>  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 11 ++---------
>  3 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
> index bc26e41..64e507a 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp.c
> +++ b/src/mesa/drivers/dri/i965/brw_blorp.c
> @@ -201,6 +201,15 @@ brw_blorp_surface_info_init(struct brw_context *brw,
>        },
>     };
>  
> +   if (brw->gen >= 8 && !is_render_target && info->surf.dim == ISL_SURF_DIM_3D) {
> +      /* On gen8+ we use actual 3-D textures so we need to pass the layer
> +       * through to the sampler.
> +       */
> +      info->z_offset = layer / layer_multiplier;

Agreed offline to move the division by layer_multiplier to the next patch
which start to use this path for 2D msaa. Here for 3D it doesn't really do
anything.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>

> +   } else {
> +      info->z_offset = 0;
> +   }
> +
>     info->level = level;
>     info->layer = layer;
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
> index 282235d..ec12dfe 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp.h
> +++ b/src/mesa/drivers/dri/i965/brw_blorp.h
> @@ -78,6 +78,9 @@ struct brw_blorp_surface_info
>  
>     struct isl_view view;
>  
> +   /* Z offset into a 3-D texture or slice of a 2-D array texture. */
> +   uint32_t z_offset;
> +
>     /**
>      * The miplevel to use.
>      */
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> index a76d130..a35cdb3 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> @@ -1779,15 +1779,8 @@ brw_blorp_blit_miptrees(struct brw_context *brw,
>     brw_blorp_setup_coord_transform(&params.wm_inputs.coord_transform[1],
>                                     src_y0, src_y1, dst_y0, dst_y1, mirror_y);
>  
> -   if (brw->gen >= 8 && params.src.mt->target == GL_TEXTURE_3D) {
> -      /* On gen8+ we use actual 3-D textures so we need to pass the layer
> -       * through to the sampler.
> -       */
> -      params.wm_inputs.src_z = params.src.layer;
> -   } else {
> -      /* On gen7 and earlier, we fake everything with 2-D textures */
> -      params.wm_inputs.src_z = 0;
> -   }
> +   /* For some texture types, we need to pass the layer through the sampler. */
> +   params.wm_inputs.src_z = params.src.z_offset;
>  
>     if (brw->gen > 6 && dst_mt->msaa_layout == INTEL_MSAA_LAYOUT_IMS) {
>        /* We must expand the rectangle we send through the rendering pipeline,
> -- 
> 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