[Mesa-dev] [PATCH 03/15] i965: Prepare tex, img and rt state emission for isl based miptrees

Jason Ekstrand jason at jlekstrand.net
Thu Jun 15 20:56:34 UTC 2017


On Tue, Jun 13, 2017 at 12:10 PM, Topi Pohjolainen <
topi.pohjolainen at gmail.com> wrote:

> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> index c6cac22e3b..6b05e8ab26 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -143,7 +143,10 @@ brw_emit_surface_state(struct brw_context *brw,
>
>     struct isl_surf surf;
>
> -   get_isl_surf(brw, mt, target, &view, &tile_x, &tile_y, &offset, &surf);
> +   if (mt->surf.size > 0)
> +      surf = mt->surf;
> +   else
> +      get_isl_surf(brw, mt, target, &view, &tile_x, &tile_y, &offset,
> &surf);
>
>     union isl_color_value clear_color = { .u32 = { 0, 0, 0, 0 } };
>
> @@ -559,9 +562,16 @@ brw_update_texture_surface(struct gl_context *ctx,
>        /* If this is a view with restricted NumLayers, then our effective
> depth
>         * is not just the miptree depth.
>         */
> -      const unsigned view_num_layers =
> -         (obj->Immutable && obj->Target != GL_TEXTURE_3D) ?
> obj->NumLayers :
> -
> mt->logical_depth0;
> +      unsigned view_num_layers;
> +      if (obj->Immutable && obj->Target != GL_TEXTURE_3D) {
> +         view_num_layers = obj->NumLayers;
> +      } else if (mt->surf.size > 0) {
> +         view_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?
> +                              mt->surf.logical_level0_px.depth :
> +                              mt->surf.logical_level0_px.array_len;
>

Strictly speaking, I don't think you need to handle the 3D case specially
here.  The only thing view_num_layers is used for is to set up the isl_view
and ISL ignores array_len for 3D textures.

--Jason


> +      } else {
> +         view_num_layers = mt->logical_depth0;
> +      }
>
>        /* Handling GL_ALPHA as a surface format override breaks 1.30+ style
>         * texturing functions that return a float, as our code generation
> always
> --
> 2.11.0
>
> _______________________________________________
> 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/20170615/3223b1e4/attachment-0001.html>


More information about the mesa-dev mailing list