Bug 107856 - i965 incorrectly calculates the number of layers for texture views (assert)
Summary: i965 incorrectly calculates the number of layers for texture views (assert)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-07 10:08 UTC by Józef Kucia
Modified: 2018-11-16 09:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Apitrace (503.12 KB, application/x-7z-compressed)
2018-09-07 10:08 UTC, Józef Kucia
Details

Description Józef Kucia 2018-09-07 10:08:21 UTC
Created attachment 141470 [details]
Apitrace

get_image_num_layers() returns the number of layers for the original texture instead of the number of layers for the texture view. It leads to asserts in driver code:

../../../../../../mesa-git/src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1940: miptree_layer_range_length: Assertion `start_layer + num_layers <= total_num_layers' failed.
Comment 1 Danylo 2018-10-24 11:25:54 UTC
Hello,

I forgot to write here when sent a patch to fix the issue, here is the patch:
https://patchwork.freedesktop.org/series/49352/

And I wrote a Piglit test which reproduces the issue:
https://patchwork.freedesktop.org/patch/258180/
Comment 2 Danylo 2018-11-16 09:24:43 UTC
commit f9fd0cf4790cb2a530e75d1a2206dbb9d8af7cb2
Author: Danylo Piliaiev <danylo.piliaiev@gmail.com>
Date:   Thu Nov 15 12:03:31 2018 +0200

    i965: Fix calculation of layers array length for isl_view

    Handle all cases in calculation of layers count for isl_view
    taking into account texture view and image unit.
    st_convert_image was taken as a reference.

    When u->Layered is true the whole level is taken with respect to
    image view. In other case only one layer is taken.

    v3: (Józef Kucia and Ilia Mirkin)
        - Rewrote patch by taking st_convert_image as a reference
        - Removed now unused get_image_num_layers function
        - Changed commit message

    v4: (Jason Ekstrand)
        - Added assert

    Fixes: 5a8c8903
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107856

    Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.