Bug 96617 - gl_SecondaryFragDataEXT doesn't work for extended blend func
Summary: gl_SecondaryFragDataEXT doesn't work for extended blend func
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 11.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 17:50 UTC by Corentin Wallez
Modified: 2016-06-22 02:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Corentin Wallez 2016-06-21 17:50:32 UTC
Using GL_EXT_blend_func_extended works with gl_FragColor / gl_SecondaryFragColorEXT but not with gl_FragData[0] / gl_SecondaryFragDataEXT[0]

This was found when trying to use the 3.3 core profile in Chromium.

See https://github.com/Kangz/GLDriverBugs/blob/master/gl_secondary_frag_data/Main.cpp#L24 for a repro case (no blue triangle shows up).
Comment 1 Ilia Mirkin 2016-06-21 19:02:29 UTC
https://patchwork.freedesktop.org/patch/94448/

This fixes a hacked up piglit test for me, but need to do more testing before pushing.
Comment 2 Corentin Wallez 2016-06-21 19:19:46 UTC
Thanks for taking a look at this so quickly!
Comment 3 Ilia Mirkin 2016-06-22 02:02:39 UTC
I pushed a slightly improved version of the patch:

commit 36ed1b695e5a0ae5714b79cae3a089b5e7e8bd29
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Tue Jun 21 16:16:17 2016 -0400

    glsl: only match gl_FragData and not gl_SecondaryFragDataEXT

    There's special logic around finding gl_FragData. It latches onto any
    array with FRAG_RESULT_DATA0. However gl_SecondaryFragDataEXT[], added
    by GL_EXT_blend_func_extended, fits those parameters as well. The real
    frag data array should have index 0 though, so we can use that to
    distinguish them.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96617
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.