Bug 97032

Summary: [BDW,SKL] piglit.spec.arb_gpu_shader5.arb_gpu_shader5-interpolateatcentroid-flat
Product: Mesa Reporter: Mark Janes <mark.a.janes>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: t_arceri
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Mark Janes 2016-07-21 22:32:09 UTC
This test asserts:

arb_gpu_shader5-interpolateAtCentroid-flat: src/mesa/drivers/dri/i965/brw_fs.cpp:1089: brw_barycentric_mode brw_barycentric_mode(glsl_interp_mode, nir_intrinsic_op): Assertion `mode != INTERP_MODE_FLAT' failed.

Bisected to:
i965: enable GL4.4 for Gen8+
Comment 1 Kenneth Graunke 2016-07-22 00:33:18 UTC
Apparently enabling GL 4.4 disabled varying packing, somehow...which is scary...

It looks like varying packing was sweeping this under the rug.  We need to ignore interpolateAtCentroid/Sample for flats and just give back the flat input.
Comment 2 Kenneth Graunke 2016-07-22 18:06:52 UTC
Apparently varying packing getting disabled was a bug, and Timothy's pushed a fix for that.  However, I'm pretty sure this is still a bug in my code, so here's a patch to fix it:

https://lists.freedesktop.org/archives/mesa-dev/2016-July/124211.html
Comment 3 Kenneth Graunke 2016-07-23 03:34:04 UTC
Fixed on Mesa master, probably with:

commit 0ba7288376dc66f932336862c8a6abb629b47686
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Jul 21 17:42:01 2016 -0700

    nir: Lower interp_var_at_* like a normal load_var for flat inputs.
    
    "flat centroid" and "flat sample" both just mean "flat", so we should
    ignore interpolateAtCentroid/Sample and just return the flat value.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97032
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
    Reviewed-by: Anuj Phogat <anuj.phogat@gmail.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.