Bug 109265 - [regression, bisected] arb_texture_multisample texelfetch piglit test failing on NIR backend
Summary: [regression, bisected] arb_texture_multisample texelfetch piglit test failing...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 01:56 UTC by Timothy Arceri
Modified: 2019-02-28 00:52 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Timothy Arceri 2019-01-10 01:56:35 UTC
For example:

R600_DEBUG=nir ./bin/texelFetch fs sampler2DMS 4 1x71-501x71 -auto -fbo

Bisected to (on VEGA 64):

commit f7ffa504a065dc2631fd38cc5fe885b277f4e7e7 (refs/bisect/bad)
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Sat Jul 29 01:40:48 2017 +0200

    ac/surface: compute tile swizzle for GFX9
    
    Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Comment 1 Marek Olšák 2019-01-11 14:18:12 UTC
The commit has no effect on shaders. The bisecting has most likely been unsuccessful. Setting tile_swizzle = 0 in ac_surface.c reverts the commit.
Comment 2 Marek Olšák 2019-01-11 14:19:49 UTC
Note that f7ffa504a065dc2631fd38cc5fe885b277f4e7e7 indeed broke MSAA, but it was fixed by c5c6e0187fd.
Comment 3 Marek Olšák 2019-01-11 14:28:26 UTC
The test passes with MESA_GLSL_CACHE_DISABLE=1.
Comment 4 Timothy Arceri 2019-01-14 06:19:27 UTC
This is odd. As far as I can tell the shader variant produced after loading from the case is the same as the one produced when the cache is disabled.

Its also a fairly simple program. From tests/texturing/shaders/texelFetch.c the offending program is:

    int vs = piglit_compile_shader_text(GL_VERTEX_SHADER,
            "#version 130\n"
            "#extension GL_ARB_explicit_attrib_location: require\n"
            "layout(location=0) in vec4 pos;\n"
            "void main() {\n"
            "   gl_Position = pos;\n"
            "}\n");
    (void)!asprintf(&fs_code,
            "#version 130\n"
            "#extension GL_ARB_explicit_attrib_location: require\n"
            "#extension GL_ARB_fragment_coord_conventions: require\n"
            "uniform int layer;\n"
            "uniform int si;\n"
            "layout(pixel_center_integer) in vec4 gl_FragCoord;\n"
            "layout(location=0) out %s o;\n"
            "void main() {\n"
            "  o = %s(%sgl_FragCoord.x, gl_FragCoord.y, layer, si);\n"
            "}\n",
            sampler.return_type,
            sampler.return_type,
            sampler.data_type == GL_UNSIGNED_INT ? "" : "-");

We must not be setting a flag somewhere, but I've looked over the code that handles the cache multiple  time now and can't spot any real difference between tgsi and nir.
Comment 5 Timothy Arceri 2019-02-27 23:07:15 UTC
You were right it was a bad bisect due to that patch breaking MSAA also. I found the real issue, fix sent to the list.

https://patchwork.freedesktop.org/patch/288934/
Comment 6 Timothy Arceri 2019-02-28 00:52:48 UTC
Fixed by:

commit 7536af670b7501228628a8c90f9e8456b5aec9e1
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date:   Wed Feb 27 18:26:07 2019 +1100

    glsl: fix shader cache for packed param list
    
    Some types of params such as some builtins are always padded. We
    need to keep track of this so we can restore the list correctly.
    
    Here we also remove a couple of cache entries that are not actually
    required as they get rebuilt by the _mesa_add_parameter() calls.
    
    This patch fixes a bunch of arb_texture_multisample and
    arb_sample_shading piglit tests for the radeonsi NIR backend.
    
    Fixes: edded1237607 ("mesa: rework ParameterList to allow packing")
    
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>


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.