Bug 50291 - broken shaders in oil rush
Summary: broken shaders in oil rush
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Kenneth Graunke
QA Contact:
URL:
Whiteboard:
Keywords:
: 52285 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-23 13:32 UTC by Karol Herbst
Modified: 2012-07-31 05:04 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
snapshot of bug (459.13 KB, image/png)
2012-05-23 13:32 UTC, Karol Herbst
Details

Description Karol Herbst 2012-05-23 13:32:35 UTC
Created attachment 62034 [details]
snapshot of bug

With newest mesa-git version shaders seems to be broken in oil rush as you see in the screenshot. It worked with mesa-git from 17th May (don't know the commit tag).

OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile 
OpenGL version string: 3.0 Mesa 8.1-devel (git-b45052b)
OpenGL shading language version string: 1.30
Comment 1 Kenneth Graunke 2012-06-06 17:13:30 UTC
I'm guessing this is due to Eric's blend_func_extended patches, based on his comments on IRC earlier today.  All Unigine demos seem to be broken.  Reassigning.
Comment 2 Karol Herbst 2012-06-07 15:25:53 UTC
So I found out the commit which produced this error. After reverting this commit, everything seems to be fine.

29362875f2613ad87abe7725ce3c56c36d16cf9b is the first bad commit
commit 29362875f2613ad87abe7725ce3c56c36d16cf9b
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Apr 25 13:58:07 2012 -0700

    i965/gen6+: Add support for GL_ARB_blend_func_extended.
    
    v2: Add support for gen6, and don't turn it on if blending is
        disabled. (fixes GPU hang), and note it in docs/GL3.txt
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

:040000 040000 8feac6c770ffafaa120afd123dea3344d7760f46 4f89a43d6db59d8a02ab42538d74b330e8db2026 M      docs
:040000 040000 d3caa00ed190df2fc0543833079b97b9bcb61a81 35c407844276eee3aa57b55bbfbd7f26519e1678 M      src



git bisect start
# bad: [529476b5e4cd0591e0ec777b9bc2b5bec136822b] i965: Add forgotten bitcast operations in brw_fs_channel_expressions.
git bisect bad 529476b5e4cd0591e0ec777b9bc2b5bec136822b
# good: [5f7204c3bbc070fce2f3351419a64362fe15a8c6] docs: Add 8.0.2 release notes
git bisect good 5f7204c3bbc070fce2f3351419a64362fe15a8c6
# good: [6fe42b603d0ec9e13a8b7d6c46c6d89da3a6a614] mesa: Include glx tests Makefile.in in tarball
git bisect good 6fe42b603d0ec9e13a8b7d6c46c6d89da3a6a614
# good: [878c69fe540a73011b676ead33ac8d9b8c9e63aa] mesa: use _mesa_dirty_texobj() function
git bisect good 878c69fe540a73011b676ead33ac8d9b8c9e63aa
# good: [16b081f1b0acf3158423c9fbed69c85807ce5276] llvmpipe: add masking support to aos blend
git bisect good 16b081f1b0acf3158423c9fbed69c85807ce5276
# good: [982df3c1a5e99e43f28f849419d4379e6e5d5d05] llvmpipe: Color slot interpolation can be flat or perspective, not linear.
git bisect good 982df3c1a5e99e43f28f849419d4379e6e5d5d05
# bad: [a1a0974401c467cb86ef818f22df67c21774a38c] Revert "r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen"
git bisect bad a1a0974401c467cb86ef818f22df67c21774a38c
# good: [a0dffe8701cc5dae955ad20a707833f1f42474a2] tests: include mesa headers
git bisect good a0dffe8701cc5dae955ad20a707833f1f42474a2
# bad: [75dac69262481ac26a823a9d06f7f138ec56b01f] ir_to_mesa: Don't set initial uniform values again
git bisect bad 75dac69262481ac26a823a9d06f7f138ec56b01f
# good: [03c9044c2edf8301779fe5d0173d7e6d1e7ee1c2] i915: Drop gen4+ code from the forked clear code.
git bisect good 03c9044c2edf8301779fe5d0173d7e6d1e7ee1c2
# good: [39a91be20d0592af4f93458364d027b7ade6b2ba] i965/gen7: Add CC viewport setup to blorp code.
git bisect good 39a91be20d0592af4f93458364d027b7ade6b2ba
# bad: [29362875f2613ad87abe7725ce3c56c36d16cf9b] i965/gen6+: Add support for GL_ARB_blend_func_extended.
git bisect bad 29362875f2613ad87abe7725ce3c56c36d16cf9b
# good: [68216f35814ab8d292f37b8c0fa0a5f181b7f20d] i965/gen6+: Add support for fast depth clears.
git bisect good 68216f35814ab8d292f37b8c0fa0a5f181b7f20d
# good: [175ad8050e3337f7065306017ea4eb8eae599f6d] mesa: Keep a computed value for dual source blend func with each buffer.
git bisect good 175ad8050e3337f7065306017ea4eb8eae599f6d
Comment 3 Kenneth Graunke 2012-07-19 08:44:12 UTC
It turns out that this is actually a bug in Unigine's engine, not in our driver.

I've added a workaround to disable GL_ARB_blend_func_extended for Unigine.  In addition to updating to master, you'll need to install the new drirc.

Fixed by:

commit 658a63e5d9777e4cf67e0a72848944bc11533cf8
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Jul 19 01:40:24 2012 -0700

    drirc: Add disable_blend_func_extended workaround for Unigine OilRush.
    
    The previous commit implemented the workaround, cited a bug report
    about OilRush, but actually only enabled the workaround for the demos.
    
    Turn it on for OilRush too.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

commit 040894391a2cf85035c6ad85f3f85c6efb23324b
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Wed Jul 18 00:07:17 2012 -0700

    i965: Add a driconf option to disable GL_ARB_blend_func_extended.
    
    Unigine Heaven (at least) has a bug where it incorrectly uses the
    GL_ARB_blend_func_extended extension.
    
    Dual source blending allows two color outputs per render target;
    individual shader outputs can be assigned to be either the first or
    second blending input by setting the 'index' via one of two methods:
    
    - An API call: glBindFragDataLocationIndexed()
    - The GLSL 'layout' qualifier provided by GL_ARB_explicit_attrib_location
    
    Both of these only work on user defined fragment shader outputs; it's an
    error to use either on built-in outputs like gl_FragData.
    
    Unigine uses gl_FragData and gl_FragColor exclusively, and doesn't even
    attempt to use either method to set index == 1.  However, it does set
    the blending function to SRC1 enums, which requires a fragment shader
    output with index == 1 or else rendering is undefined.
    
    In other words, enabling ARB_blend_func_extended causes Unigine to
    render incorrectly, resulting in an apparent regression, even though our
    driver code (as far as I can tell) is perfectly fine.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
Comment 4 Karol Herbst 2012-07-19 16:43:46 UTC
yeah thanks, this fixed it for me too.
Comment 5 Ian Romanick 2012-07-23 18:14:02 UTC
*** Bug 52285 has been marked as a duplicate of this bug. ***
Comment 6 meng 2012-07-31 03:04:17 UTC
(In reply to comment #3)
>  In addition to updating to master, you'll need to install the new drirc.

Hi,can you give me advice how to install drirc?
Comment 7 meng 2012-07-31 05:04:41 UTC
Take the new drirc from mesa source,Unigine demo Heaven and Tropics work well with mesa commit dcf8754cce1.


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.