[Mesa-dev] [PATCH] i965: compute the right number of array layers use base layer

Ilia Mirkin imirkin at alum.mit.edu
Fri Sep 7 15:02:48 UTC 2018


On Fri, Sep 7, 2018 at 10:59 AM, Lionel Landwerlin
<lionel.g.landwerlin at intel.com> wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107856
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 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 42af41aca32..6419876437e 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -1499,14 +1499,14 @@ update_buffer_image_param(struct brw_context *brw,
>
>  static unsigned
>  get_image_num_layers(const struct intel_mipmap_tree *mt, GLenum target,
> -                     unsigned level)
> +                     unsigned level, unsigned layer)
>  {
>     if (target == GL_TEXTURE_CUBE_MAP)
>        return 6;
>
>     return target == GL_TEXTURE_3D ?
>        minify(mt->surf.logical_level0_px.depth, level) :
> -      mt->surf.logical_level0_px.array_len;
> +      minify(mt->surf.logical_level0_px.array_len, layer);

The number of layers doesn't get minified... and if it did, it would
be based on the *level* of a texture, not the layer itself. (For 3d,
depth is minified, as it correctly handled already.)

>  }
>
>  static void
> @@ -1540,7 +1540,9 @@ update_image_surface(struct brw_context *brw,
>           struct intel_texture_object *intel_obj = intel_texture_object(obj);
>           struct intel_mipmap_tree *mt = intel_obj->mt;
>           const unsigned num_layers = u->Layered ?
> -            get_image_num_layers(mt, obj->Target, u->Level) : 1;
> +            get_image_num_layers(mt, obj->Target,
> +                                 obj->MinLevel + u->Level,
> +                                 obj->MinLayer + u->_Layer) : 1;
>
>           struct isl_view view = {
>              .format = format,
> --
> 2.19.0.rc1
>
> _______________________________________________
> 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